/** * Create a new RestletCloudFilter with the specified configuration. * * @param context * The current context. * @param restletCloudConfig * The RestletCloudService configuration. */ public RestletCloudFilter(Context context, RestletCloudConfig restletCloudConfig, boolean agentEnabled, boolean firewallEnabled, List<FirewallRule> firewallRules) { super(context); this.firewallRules = firewallRules; this.firewallEnabled = firewallEnabled; this.restletCloudConfig = restletCloudConfig; this.agentEnabled = agentEnabled; this.context = context; validateRedirection(restletCloudConfig); if (agentEnabled) { validateAgentConfiguration(restletCloudConfig); modulesSettings = ModulesSettingsModule.getModulesSettings( restletCloudConfig, null); } refreshRestletCloudFilter(); }
@Override public void run() { agentFilter.refreshRestletCloudFilterIfRevisionChanged(); } }
/** * Retrieves the modules settings from the service and updates the filter. */ public void refreshRestletCloudFilterIfRevisionChanged() { try { ModulesSettings newModulesSettings = ModulesSettingsModule .getModulesSettings(restletCloudConfig, modulesSettings); if (newModulesSettings != null) { modulesSettings = newModulesSettings; LOGGER.info("Updating modules settings"); refreshRestletCloudFilter(); } } catch (Exception e) { LOGGER.log(Level.WARNING, "Unable to retrieve agent settings from platform", e); } }
@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; }
/** * Retrieves the modules settings from the service and updates the filter. */ public void refreshRestletCloudFilterIfRevisionChanged() { try { ModulesSettings newModulesSettings = ModulesSettingsModule .getModulesSettings(restletCloudConfig, modulesSettings); if (newModulesSettings != null) { modulesSettings = newModulesSettings; LOGGER.info("Updating modules settings"); refreshRestletCloudFilter(); } } catch (Exception e) { LOGGER.log(Level.WARNING, "Unable to retrieve agent settings from platform", e); } }
@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; }
/** * Create a new RestletCloudFilter with the specified configuration. * * @param context * The current context. * @param restletCloudConfig * The RestletCloudService configuration. */ public RestletCloudFilter(Context context, RestletCloudConfig restletCloudConfig, boolean agentEnabled, boolean firewallEnabled, List<FirewallRule> firewallRules) { super(context); this.firewallRules = firewallRules; this.firewallEnabled = firewallEnabled; this.restletCloudConfig = restletCloudConfig; this.agentEnabled = agentEnabled; this.context = context; validateRedirection(restletCloudConfig); if (agentEnabled) { validateAgentConfiguration(restletCloudConfig); modulesSettings = ModulesSettingsModule.getModulesSettings( restletCloudConfig, null); } refreshRestletCloudFilter(); }
@Override public void run() { agentFilter.refreshRestletCloudFilterIfRevisionChanged(); } }
/** * Retrieves the modules settings from the service and updates the filter. */ public void refreshRestletCloudFilterIfRevisionChanged() { try { ModulesSettings newModulesSettings = ModulesSettingsModule .getModulesSettings(restletCloudConfig, modulesSettings); if (newModulesSettings != null) { modulesSettings = newModulesSettings; LOGGER.info("Updating modules settings"); refreshRestletCloudFilter(); } } catch (Exception e) { LOGGER.log(Level.WARNING, "Unable to retrieve agent settings from platform", e); } }
@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; }
/** * Create a new RestletCloudFilter with the specified configuration. * * @param context * The current context. * @param restletCloudConfig * The RestletCloudService configuration. */ public RestletCloudFilter(Context context, RestletCloudConfig restletCloudConfig, boolean agentEnabled, boolean firewallEnabled, List<FirewallRule> firewallRules) { super(context); this.firewallRules = firewallRules; this.firewallEnabled = firewallEnabled; this.restletCloudConfig = restletCloudConfig; this.agentEnabled = agentEnabled; this.context = context; validateRedirection(restletCloudConfig); if (agentEnabled) { validateAgentConfiguration(restletCloudConfig); modulesSettings = ModulesSettingsModule.getModulesSettings( restletCloudConfig, null); } refreshRestletCloudFilter(); }
@Override public void run() { agentFilter.refreshRestletCloudFilterIfRevisionChanged(); } }
/** * Retrieves the modules settings from the service and updates the filter. */ public void refreshRestletCloudFilterIfRevisionChanged() { try { ModulesSettings newModulesSettings = ModulesSettingsModule .getModulesSettings(restletCloudConfig, modulesSettings); if (newModulesSettings != null) { modulesSettings = newModulesSettings; LOGGER.info("Updating modules settings"); refreshRestletCloudFilter(); } } catch (Exception e) { LOGGER.log(Level.WARNING, "Unable to retrieve agent settings from platform", e); } }
@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; }
/** * Create a new RestletCloudFilter with the specified configuration. * * @param context * The current context. * @param restletCloudConfig * The RestletCloudService configuration. */ public RestletCloudFilter(Context context, RestletCloudConfig restletCloudConfig, boolean agentEnabled, boolean firewallEnabled, List<FirewallRule> firewallRules) { super(context); this.firewallRules = firewallRules; this.firewallEnabled = firewallEnabled; this.restletCloudConfig = restletCloudConfig; this.agentEnabled = agentEnabled; this.context = context; validateRedirection(restletCloudConfig); if (agentEnabled) { validateAgentConfiguration(restletCloudConfig); modulesSettings = ModulesSettingsModule.getModulesSettings( restletCloudConfig, null); } refreshRestletCloudFilter(); }
@Override public void run() { agentFilter.refreshRestletCloudFilterIfRevisionChanged(); } }