/** * Implements the 'system' service operations for JSON/XML RPC */ @Service(name = "system") public class SystemHandler { HandlerRegistry registry; public SystemHandler(HandlerRegistry registry) { this.registry = registry; } @Operation(httpMethods = "GET") public Set<String> listMethods(RequestItem request) { if ("protocol".equalsIgnoreCase(request.getFilterBy()) && FilterOperation.equals == request.getFilterOperation() && "REST".equalsIgnoreCase(request.getFilterValue())) { return registry.getSupportedRestServices(); } return registry.getSupportedRpcServices(); } }
private void createRpcHandler(Provider<?> handlerProvider, Service service, Operation op, Method m) { try { MethodCaller methodCaller = new MethodCaller(m, false); String opName = m.getName(); // Use the override if its defined if (op.name().length() > 0) { opName = op.name(); } RpcInvocationHandler rpcHandler = new RpcInvocationHandler(methodCaller, handlerProvider, beanJsonConverter, new ExecutionListenerWrapper(service.name(), opName, executionListener)); rpcOperations.put(service.name() + '.' + opName, rpcHandler); } catch (NoSuchMethodException nme) { LOG.log(Level.INFO, "No RPC binding for " + service.name() + '.' + m.getName()); } }
private void createRpcHandler(Provider<?> handlerProvider, Service service, Operation op, Method m) { try { MethodCaller methodCaller = new MethodCaller(m, false); String opName = m.getName(); // Use the override if its defined if (op.name().length() > 0) { opName = op.name(); } RpcInvocationHandler rpcHandler = new RpcInvocationHandler(methodCaller, handlerProvider, beanJsonConverter, new ExecutionListenerWrapper(service.name(), opName, executionListener)); rpcOperations.put(service.name() + '.' + opName, rpcHandler); } catch (NoSuchMethodException nme) { LOG.log(Level.INFO, "No RPC binding for " + service.name() + '.' + m.getName()); } }
/** * Implements the 'system' service operations for JSON/XML RPC */ @Service(name = "system") public class SystemHandler { HandlerRegistry registry; public SystemHandler(HandlerRegistry registry) { this.registry = registry; } @Operation(httpMethods = "GET") public Set<String> listMethods(RequestItem request) { if ("protocol".equalsIgnoreCase(request.getFilterBy()) && FilterOperation.equals == request.getFilterOperation() && "REST".equalsIgnoreCase(request.getFilterValue())) { return registry.getSupportedRestServices(); } return registry.getSupportedRpcServices(); } }
private void createRpcHandler(Provider<?> handlerProvider, Service service, Operation op, Method m) { try { MethodCaller methodCaller = new MethodCaller(m, false); String opName = m.getName(); // Use the override if its defined if (op.name().length() > 0) { opName = op.name(); } RpcInvocationHandler rpcHandler = new RpcInvocationHandler(methodCaller, handlerProvider, beanJsonConverter, new ExecutionListenerWrapper(service.name(), opName, executionListener)); rpcOperations.put(service.name() + '.' + opName, rpcHandler); } catch (NoSuchMethodException nme) { LOG.log(Level.INFO, "No RPC binding for " + service.name() + '.' + m.getName()); } }
/** * Implements the 'system' service operations for JSON/XML RPC */ @Service(name = "system") public class SystemHandler { HandlerRegistry registry; public SystemHandler(HandlerRegistry registry) { this.registry = registry; } @Operation(httpMethods = "GET") public Set<String> listMethods(RequestItem request) { if ("protocol".equalsIgnoreCase(request.getFilterBy()) && FilterOperation.equals == request.getFilterOperation() && "REST".equalsIgnoreCase(request.getFilterValue())) { return registry.getSupportedRestServices(); } return registry.getSupportedRpcServices(); } }
private void createRpcHandler(Provider<?> handlerProvider, Service service, Operation op, Method m) { try { MethodCaller methodCaller = new MethodCaller(m, false); String opName = m.getName(); // Use the override if its defined if (op.name().length() > 0) { opName = op.name(); } RpcInvocationHandler rpcHandler = new RpcInvocationHandler(methodCaller, handlerProvider, beanJsonConverter, new ExecutionListenerWrapper(service.name(), opName, executionListener)); rpcOperations.put(service.name() + '.' + opName, rpcHandler); } catch (NoSuchMethodException nme) { LOG.log(Level.INFO, "No RPC binding for " + service.name() + '.' + m.getName()); } }
/** * Implements the 'system' service operations for JSON/XML RPC */ @Service(name = "system") public class SystemHandler { HandlerRegistry registry; public SystemHandler(HandlerRegistry registry) { this.registry = registry; } @Operation(httpMethods = "GET") public Set<String> listMethods(RequestItem request) { if ("protocol".equalsIgnoreCase(request.getFilterBy()) && FilterOperation.equals == request.getFilterOperation() && "REST".equalsIgnoreCase(request.getFilterValue())) { return registry.getSupportedRestServices(); } return registry.getSupportedRpcServices(); } }
private void createRpcHandler(Provider<?> handlerProvider, Service service, Operation op, Method m) { try { MethodCaller methodCaller = new MethodCaller(m, false); String opName = m.getName(); // Use the override if its defined if (op.name().length() > 0) { opName = op.name(); } RpcInvocationHandler rpcHandler = new RpcInvocationHandler(methodCaller, handlerProvider, beanJsonConverter, new ExecutionListenerWrapper(service.name(), opName, executionListener)); rpcOperations.put(service.name() + '.' + opName, rpcHandler); } catch (NoSuchMethodException nme) { LOG.log(Level.INFO, "No RPC binding for " + service.name() + '.' + m.getName()); } }
/** * Implements the 'system' service operations for JSON/XML RPC */ @Service(name = "system") public class SystemHandler { HandlerRegistry registry; public SystemHandler(HandlerRegistry registry) { this.registry = registry; } @Operation(httpMethods = "GET") public Set<String> listMethods(RequestItem request) { if ("protocol".equalsIgnoreCase(request.getFilterBy()) && FilterOperation.equals == request.getFilterOperation() && "REST".equalsIgnoreCase(request.getFilterValue())) { return registry.getSupportedRestServices(); } return registry.getSupportedRpcServices(); } }
/** * RPC/REST handler for groups requests * @since 2.0.0 */ @Service(name = "groups", path = "/{userId}") public class GroupHandler { private final GroupService service; private final CollectionOptionsFactory collectionOptionsFactory; @Inject public GroupHandler(GroupService service, CollectionOptionsFactory collectionOptionsFactory) { this.service = service; this.collectionOptionsFactory = collectionOptionsFactory; } @Operation(httpMethods = "GET") public Future<?> get(SocialRequestItem request) throws ProtocolException { Set<UserId> userIds = request.getUsers(); CollectionOptions options = collectionOptionsFactory.create(request); // Preconditions HandlerPreconditions.requireNotEmpty(userIds, "No userId specified"); HandlerPreconditions.requireSingular(userIds, "Only one userId must be specified"); return service.getGroups(userIds.iterator().next(), options, request.getFields(), request.getToken()); } }
/** * RPC/REST handler for groups requests * @since 2.0.0 */ @Service(name = "groups", path = "/{userId}") public class GroupHandler { private final GroupService service; @Inject public GroupHandler(GroupService service) { this.service = service; } @Operation(httpMethods = "GET") public Future<?> get(SocialRequestItem request) throws ProtocolException { Set<UserId> userIds = request.getUsers(); CollectionOptions options = new CollectionOptions(request); // Preconditions HandlerPreconditions.requireNotEmpty(userIds, "No userId specified"); HandlerPreconditions.requireSingular(userIds, "Only one userId must be specified"); return service.getGroups(userIds.iterator().next(), options, request.getFields(), request.getToken()); } }
/** * RPC/REST handler for groups requests * @since 2.0.0 */ @Service(name = "groups", path = "/{userId}") public class GroupHandler { private final GroupService service; private final CollectionOptionsFactory collectionOptionsFactory; @Inject public GroupHandler(GroupService service, CollectionOptionsFactory collectionOptionsFactory) { this.service = service; this.collectionOptionsFactory = collectionOptionsFactory; } @Operation(httpMethods = "GET") public Future<?> get(SocialRequestItem request) throws ProtocolException { Set<UserId> userIds = request.getUsers(); CollectionOptions options = collectionOptionsFactory.create(request); // Preconditions HandlerPreconditions.requireNotEmpty(userIds, "No userId specified"); HandlerPreconditions.requireSingular(userIds, "Only one userId must be specified"); return service.getGroups(userIds.iterator().next(), options, request.getFields(), request.getToken()); } }
@Service(name = "cache") public class InvalidationHandler {
@Service(name = "cache") public class InvalidationHandler {