private static void registerType(OperationInterceptorRegistry registry, Class<? extends Service> serviceType) { registry.addServiceInterceptor(serviceType, null, ProjectInterceptor::handleServiceOp); registry.addFactoryServiceInterceptor(serviceType, null, ProjectInterceptor::handleFactoryOp); }
@Override public ServiceHost startService(Operation post, Service service) { interceptors.subscribeToService(service); return super.startService(post, service); }
protected OperationInterceptorRegistry createInterceptorRegistry() { return new OperationInterceptorRegistry(); }
public static void register(OperationInterceptorRegistry registry) { registry.addServiceInterceptor( EventLogService.class, Action.DELETE, UnauthorizedDeleteInterceptor::handleDelete); registry.addServiceInterceptor( RequestStatusService.class, Action.DELETE, UnauthorizedDeleteInterceptor::handleDelete); }
/** * Checks whether there are registered interceptors for the given service, and if there are, * adds them to the operation processing chain of the service. */ public void subscribeToService(Service service) { Collection<InterceptorData> interceptors = checkForInterceptor(service); if (interceptors != null) { OperationProcessingChain chain = getServiceOperationProcessingChain(service); for (InterceptorData data : interceptors) { DeferredOperationPredicate filter = new DeferredOperationPredicate(service, data.action, data.interceptor); filter.init(); chain.getFilters().add(filter); } } }
@Override public ServiceHost startFactory(Service service) { interceptors.subscribeToService(service); return super.startFactory(service); }
private VerificationHost createHost() throws Throwable { OperationInterceptorRegistry interceptors = new OperationInterceptorRegistry(); ServiceHost.Arguments args = new ServiceHost.Arguments(); args.sandbox = null; // ask runtime to pick a random storage location args.port = 0; // ask runtime to pick a random port args.isAuthorizationEnabled = false; VerificationHost h = new VerificationHost(); h = VerificationHost.initialize(h, args); h.start(); return h; }
public static void register(OperationInterceptorRegistry registry) { registry.addServiceInterceptor( ResourcePoolService.class, Action.DELETE, InUsePlacementZoneInterceptor::handleDelete); }
public static void register(OperationInterceptorRegistry registry) { registry.addFactoryServiceInterceptor( AuthCredentialsService.class, Action.POST, AuthCredentialsInterceptor::handlePatchPostPut); registry.addServiceInterceptor( AuthCredentialsService.class, Action.POST, AuthCredentialsInterceptor::handlePatchPostPut); registry.addServiceInterceptor( AuthCredentialsService.class, Action.PUT, AuthCredentialsInterceptor::handlePatchPostPut); registry.addServiceInterceptor( AuthCredentialsService.class, Action.PATCH, AuthCredentialsInterceptor::handlePatchPostPut); registry.addServiceInterceptor( AuthCredentialsService.class, Action.DELETE, AuthCredentialsInterceptor::handleDelete); }
@Override public ServiceHost startFactory(Service service) { interceptors.subscribeToService(service); return super.startFactory(service); }
public static void register(OperationInterceptorRegistry registry) { registry.addFactoryServiceInterceptor( ResourcePoolService.class, Action.POST, SchedulerPlacementZoneInterceptor::handlePostOrPut); registry.addServiceInterceptor( ResourcePoolService.class, Action.PUT, SchedulerPlacementZoneInterceptor::handlePostOrPut); registry.addServiceInterceptor( ResourcePoolService.class, Action.PATCH, SchedulerPlacementZoneInterceptor::handlePatch); }
@Override public ServiceHost startService(Operation post, Service service) { interceptors.subscribeToService(service); return super.startService(post, service); }
private static void registerType(OperationInterceptorRegistry registry, Class<? extends Service> serviceType) { registry.addFactoryServiceInterceptor(serviceType, null, CompositeComponentInterceptor::handleFactoryPost); registry.addServiceInterceptor(serviceType, null, CompositeComponentInterceptor::handleServiceOp); }