@Override protected Factory<RequestRateLimiterFactory> createValueFactory(final Parameter parameter) { final RateLimiting annotation = parameter.getAnnotation(RateLimiting.class); if (null == annotation) { return null; } else { return new AbstractContainerRequestValueFactory<RequestRateLimiterFactory>() { public RequestRateLimiterFactory provide() { return requestRateLimiterFactory; } }; } }
@Override protected Factory<?> createValueFactory(final Parameter parameter) { final RateLimiting annotation = parameter.getAnnotation(RateLimiting.class); if (null == annotation) { return null; } else { return new AbstractContainerRequestValueFactory<RequestRateLimiterFactory>() { public RequestRateLimiterFactory provide() { return requestRateLimiterFactory; } }; } }
@Override protected Factory<?> createValueFactory(final Parameter parameter) { final Class<?> classType = parameter.getRawType(); final Auth auth = parameter.getAnnotation(Auth.class); if (auth == null) { return null; } if (classType.equals(Client.class)) { return new AbstractContainerRequestValueFactory<Client>() { @Override public Client provide() { return clientAuthFactory.provide(getContainerRequest()); } }; } if (classType.equals(AutomationClient.class)) { return new AbstractContainerRequestValueFactory<AutomationClient>() { @Override public AutomationClient provide() { return automationClientAuthFactory.provide(getContainerRequest()); } }; } if (classType.equals(User.class)) { return new AbstractContainerRequestValueFactory<User>() { @Override public User provide() { return userAuthFactory.provide(getContainerRequest()); } }; } return null; }
@Override protected Factory<?> createValueFactory(Parameter parameter) { if (!parameter.isAnnotationPresent(Auth.class)) { return null; } return new AbstractContainerRequestValueFactory<Principal>() { public Principal provide() { return user; } }; }