public APIThrottleHandler() { this.accessController = new AccessRateController(); this.roleBasedAccessController = new RoleBasedAccessRateController(); this.applicationRoleBasedAccessController = new RoleBasedAccessRateController(); }
protected AccessInformation getAccessInformation(ThrottleContext hardThrottleContext, String throttleKey, String productionHardLimit) throws ThrottleException { return roleBasedAccessController.canAccess(hardThrottleContext, throttleKey, productionHardLimit); }
public APIThrottleHandler() { this.accessController = new AccessRateController(); this.roleBasedAccessController = new RoleBasedAccessRateController(); this.applicationRoleBasedAccessController = new RoleBasedAccessRateController(); }
roleBasedAccessController.canAccess(resourceContext, resourceAndHTTPVerbKey, resourceAndHTTPVerbThrottlingTier);
public ThrottleHandler() { this.debugOn = log.isDebugEnabled(); this.accessRateController = new AccessRateController(); this.roleBasedAccessController = new RoleBasedAccessRateController(); }
info = applicationRoleBasedAccessController.canAccess(applicationThrottleContext, applicationId, applicationRoleId); if (log.isDebugEnabled()) { resourceContext.setThrottleId(id + "resource"); info = roleBasedAccessController.canAccess(resourceContext, resourceAndHTTPVerbKey, resourceAndHTTPVerbThrottlingTier); info = roleBasedAccessController.canAccess(context, apiKey, consumerRoleID); info = roleBasedAccessController.canAccess(hardThrottleContext, throttleKey, APIThrottleConstants.PRODUCTION_HARD_LIMIT); } else if (APIConstants.API_KEY_TYPE_SANDBOX.equals(authContext.getKeyType())) { hardThrottleContext.setThrottleId(id + APIThrottleConstants.SANDBOX_HARD_LIMIT); info = roleBasedAccessController.canAccess(hardThrottleContext, throttleKey, APIThrottleConstants.SANDBOX_HARD_LIMIT);
public ThrottleHandler() { if (log.isDebugEnabled()) { log.debug("Throttle Handler initialized"); } this.roleBasedAccessController = new RoleBasedAccessRateController(); /** * This method will initialize data publisher and this data publisher will be used to push events to central policy * server. */ if (throttleDataPublisher == null) { // The publisher initializes in the first request only synchronized (this) { throttleDataPublisher = new ThrottleDataPublisher(); } } }
context.setThrottleId(throttleId); AccessInformation infor = roleBasedAccessController.canAccess(context, consumerKey, consumerRoleID); StatCollector.collect(infor, consumerKey, ThrottleConstants.ROLE_BASE);