@Override public Filter createInboundFilter(Context context) { RestletCloudConfig restletCloudConfig = new RestletCloudConfig(); restletCloudConfig.setAgentCellId(agentCellId); restletCloudConfig.setAgentCellVersion(agentCellVersion); restletCloudConfig.setAgentServiceUrl(agentServiceUrl); restletCloudConfig.setAgentLogin(agentLogin); restletCloudConfig.setAgentPassword(agentPassword); restletCloudConfig.setReverseProxyEnabled(reverseProxyEnabled); restletCloudConfig.setReverseProxyTargetUrl(reverseProxyTargetUrl); restletCloudConfig.setAgentAnalyticsBufferSize(agentAnalyticsBufferSize); restletCloudConfig.setAgentAnalyticsPostPeriodInSecond(agentAnalyticsPostPeriodInSecond); restletCloudFilter = new RestletCloudFilter(context, restletCloudConfig, agentEnabled, firewallEnabled, firewallRules); if (agentEnabled && agentRefreshPeriodInSecond > 0) { TimerTask task = new AgentConfigurationTimerTask(restletCloudFilter); agentRefreshTimer = new Timer(true); long agentRefreshPeriodInMs = TimeUnit.SECONDS.toMillis(agentRefreshPeriodInSecond); agentRefreshTimer.scheduleAtFixedRate(task, agentRefreshPeriodInMs, agentRefreshPeriodInMs); LOGGER.info("Setting agent refresh timer every " + TimeUnit.SECONDS.toMinutes(agentRefreshPeriodInSecond) + " minutes"); } return restletCloudFilter; }
.<CallLog> newArrayListWithExpectedSize(bufferSize)); bufferSize = restletCloudConfig.getAgentAnalyticsBufferSize(); executorService = new ThreadPoolExecutor(1, THREAD_MAX_NUMBER, 0L, TimeUnit.SECONDS, .build()); postPeriodInSecond = restletCloudConfig.getAgentAnalyticsPostPeriodInSecond(); long postPeriodInMs = TimeUnit.SECONDS.toMillis(postPeriodInSecond);
/** * Terminates the agent if the service's configuration is not correctly set. * * @param config * The service's configuration */ public void validateAgentConfiguration(RestletCloudConfig config) { if (config.getAgentCellId() == null) { throw new IllegalArgumentException( "The cell identifier is mandatory"); } if (config.getAgentCellId() == null) { throw new IllegalArgumentException( "The cell version identifier is mandatory"); } if (StringUtils.isNullOrEmpty(config.getAgentServiceUrl())) { throw new IllegalArgumentException( "The agent service url is mandatory"); } if (StringUtils.isNullOrEmpty(config.getAgentLogin())) { throw new IllegalArgumentException("The agent login is mandatory"); } if (StringUtils.isNullOrEmpty(config.getAgentPassword())) { throw new IllegalArgumentException( "The agent password key is mandatory"); } }
/** * Validates the redirection URL * * @param config * The service's configuration */ public void validateRedirection(RestletCloudConfig config) { if (config.isReverseProxyEnabled() && StringUtils.isNullOrEmpty(config.getReverseProxyTargetUrl())) { throw new IllegalArgumentException( "The redirection url is mandatory when redirection is enabled"); } } }
String resourcePath) { StringBuilder sb = new StringBuilder( restletCloudConfig.getAgentServiceUrl()); if (!restletCloudConfig.getAgentServiceUrl().endsWith("/")) { sb.append("/"); sb.append(restletCloudConfig.getAgentCellId()); sb.append("/versions/"); sb.append(restletCloudConfig.getAgentCellVersion()); if (resourcePath != null) { if (!resourcePath.startsWith("/")) {
restletCloudConfig.getAgentLogin(), restletCloudConfig.getAgentPassword());
String resourcePath) { StringBuilder sb = new StringBuilder( restletCloudConfig.getAgentServiceUrl()); if (!restletCloudConfig.getAgentServiceUrl().endsWith("/")) { sb.append("/"); sb.append(restletCloudConfig.getAgentCellId()); sb.append("/versions/"); sb.append(restletCloudConfig.getAgentCellVersion()); if (resourcePath != null) { if (!resourcePath.startsWith("/")) {
/** * Validates the redirection URL * * @param config * The service's configuration */ public void validateRedirection(RestletCloudConfig config) { if (config.isReverseProxyEnabled() && StringUtils.isNullOrEmpty(config.getReverseProxyTargetUrl())) { throw new IllegalArgumentException( "The redirection url is mandatory when redirection is enabled"); } } }
restletCloudConfig.getAgentLogin(), restletCloudConfig.getAgentPassword());
@Override public Filter createInboundFilter(Context context) { RestletCloudConfig restletCloudConfig = new RestletCloudConfig(); restletCloudConfig.setAgentCellId(agentCellId); restletCloudConfig.setAgentCellVersion(agentCellVersion); restletCloudConfig.setAgentServiceUrl(agentServiceUrl); restletCloudConfig.setAgentLogin(agentLogin); restletCloudConfig.setAgentPassword(agentPassword); restletCloudConfig.setReverseProxyEnabled(reverseProxyEnabled); restletCloudConfig.setReverseProxyTargetUrl(reverseProxyTargetUrl); restletCloudConfig.setAgentAnalyticsBufferSize(agentAnalyticsBufferSize); restletCloudConfig.setAgentAnalyticsPostPeriodInSecond(agentAnalyticsPostPeriodInSecond); restletCloudFilter = new RestletCloudFilter(context, restletCloudConfig, agentEnabled, firewallEnabled, firewallRules); if (agentEnabled && agentRefreshPeriodInSecond > 0) { TimerTask task = new AgentConfigurationTimerTask(restletCloudFilter); agentRefreshTimer = new Timer(true); long agentRefreshPeriodInMs = TimeUnit.SECONDS.toMillis(agentRefreshPeriodInSecond); agentRefreshTimer.scheduleAtFixedRate(task, agentRefreshPeriodInMs, agentRefreshPeriodInMs); LOGGER.info("Setting agent refresh timer every " + TimeUnit.SECONDS.toMinutes(agentRefreshPeriodInSecond) + " minutes"); } return restletCloudFilter; }
/** * Terminates the agent if the service's configuration is not correctly set. * * @param config * The service's configuration */ public void validateAgentConfiguration(RestletCloudConfig config) { if (config.getAgentCellId() == null) { throw new IllegalArgumentException( "The cell identifier is mandatory"); } if (config.getAgentCellId() == null) { throw new IllegalArgumentException( "The cell version identifier is mandatory"); } if (StringUtils.isNullOrEmpty(config.getAgentServiceUrl())) { throw new IllegalArgumentException( "The agent service url is mandatory"); } if (StringUtils.isNullOrEmpty(config.getAgentLogin())) { throw new IllegalArgumentException("The agent login is mandatory"); } if (StringUtils.isNullOrEmpty(config.getAgentPassword())) { throw new IllegalArgumentException( "The agent password key is mandatory"); } }
String resourcePath) { StringBuilder sb = new StringBuilder( restletCloudConfig.getAgentServiceUrl()); if (!restletCloudConfig.getAgentServiceUrl().endsWith("/")) { sb.append("/"); sb.append(restletCloudConfig.getAgentCellId()); sb.append("/versions/"); sb.append(restletCloudConfig.getAgentCellVersion()); if (resourcePath != null) { if (!resourcePath.startsWith("/")) {
/** * Validates the redirection URL * * @param config * The service's configuration */ public void validateRedirection(RestletCloudConfig config) { if (config.isReverseProxyEnabled() && StringUtils.isNullOrEmpty(config.getReverseProxyTargetUrl())) { throw new IllegalArgumentException( "The redirection url is mandatory when redirection is enabled"); } } }
.<CallLog> newArrayListWithExpectedSize(bufferSize)); bufferSize = restletCloudConfig.getAgentAnalyticsBufferSize(); executorService = new ThreadPoolExecutor(1, THREAD_MAX_NUMBER, 0L, TimeUnit.SECONDS, .build()); postPeriodInSecond = restletCloudConfig.getAgentAnalyticsPostPeriodInSecond(); long postPeriodInMs = TimeUnit.SECONDS.toMillis(postPeriodInSecond);
restletCloudConfig.getAgentLogin(), restletCloudConfig.getAgentPassword());
@Override public Filter createInboundFilter(Context context) { RestletCloudConfig restletCloudConfig = new RestletCloudConfig(); restletCloudConfig.setAgentCellId(agentCellId); restletCloudConfig.setAgentCellVersion(agentCellVersion); restletCloudConfig.setAgentServiceUrl(agentServiceUrl); restletCloudConfig.setAgentLogin(agentLogin); restletCloudConfig.setAgentPassword(agentPassword); restletCloudConfig.setReverseProxyEnabled(reverseProxyEnabled); restletCloudConfig.setReverseProxyTargetUrl(reverseProxyTargetUrl); restletCloudConfig.setAgentAnalyticsBufferSize(agentAnalyticsBufferSize); restletCloudConfig.setAgentAnalyticsPostPeriodInSecond(agentAnalyticsPostPeriodInSecond); restletCloudFilter = new RestletCloudFilter(context, restletCloudConfig, agentEnabled, firewallEnabled, firewallRules); if (agentEnabled && agentRefreshPeriodInSecond > 0) { TimerTask task = new AgentConfigurationTimerTask(restletCloudFilter); agentRefreshTimer = new Timer(true); long agentRefreshPeriodInMs = TimeUnit.SECONDS.toMillis(agentRefreshPeriodInSecond); agentRefreshTimer.scheduleAtFixedRate(task, agentRefreshPeriodInMs, agentRefreshPeriodInMs); LOGGER.info("Setting agent refresh timer every " + TimeUnit.SECONDS.toMinutes(agentRefreshPeriodInSecond) + " minutes"); } return restletCloudFilter; }
/** * Terminates the agent if the service's configuration is not correctly set. * * @param config * The service's configuration */ public void validateAgentConfiguration(RestletCloudConfig config) { if (config.getAgentCellId() == null) { throw new IllegalArgumentException( "The cell identifier is mandatory"); } if (config.getAgentCellId() == null) { throw new IllegalArgumentException( "The cell version identifier is mandatory"); } if (StringUtils.isNullOrEmpty(config.getAgentServiceUrl())) { throw new IllegalArgumentException( "The agent service url is mandatory"); } if (StringUtils.isNullOrEmpty(config.getAgentLogin())) { throw new IllegalArgumentException("The agent login is mandatory"); } if (StringUtils.isNullOrEmpty(config.getAgentPassword())) { throw new IllegalArgumentException( "The agent password key is mandatory"); } }
String resourcePath) { StringBuilder sb = new StringBuilder( restletCloudConfig.getAgentServiceUrl()); if (!restletCloudConfig.getAgentServiceUrl().endsWith("/")) { sb.append("/"); sb.append(restletCloudConfig.getAgentCellId()); sb.append("/versions/"); sb.append(restletCloudConfig.getAgentCellVersion()); if (resourcePath != null) { if (!resourcePath.startsWith("/")) {
/** * Validates the redirection URL * * @param config * The service's configuration */ public void validateRedirection(RestletCloudConfig config) { if (config.isReverseProxyEnabled() && StringUtils.isNullOrEmpty(config.getReverseProxyTargetUrl())) { throw new IllegalArgumentException( "The redirection url is mandatory when redirection is enabled"); } } }
.<CallLog> newArrayListWithExpectedSize(bufferSize)); bufferSize = restletCloudConfig.getAgentAnalyticsBufferSize(); executorService = new ThreadPoolExecutor(1, THREAD_MAX_NUMBER, 0L, TimeUnit.SECONDS, .build()); postPeriodInSecond = restletCloudConfig.getAgentAnalyticsPostPeriodInSecond(); long postPeriodInMs = TimeUnit.SECONDS.toMillis(postPeriodInSecond);