public FirewallModule(RestletCloudConfig restletCloudConfig, ModulesSettings modulesSettings) { FirewallSettingsResource firewallSettingsClientResource = AgentUtils .getClientResource(restletCloudConfig, modulesSettings, FirewallSettingsResource.class, SETTINGS_PATH); try { firewallSettings = firewallSettingsClientResource.getSettings(); } catch (Exception e) { throw new AgentConfigurationException( "Could not get firewall module configuration from Restlet Cloud connector service", e); } }
/** * Retrieves the modules settings from the service if it has changed, null * otherwise. * * @param restletCloudConfig * The service's configuration * @param modulesSettings * The current modules settings * @return The updated modules settings if it has changed, null otherwise. */ public static ModulesSettings getModulesSettings( RestletCloudConfig restletCloudConfig, ModulesSettings modulesSettings) { // When modulesSettings not null, cell revision header is set ModulesSettingsResource modulesSettingsResource = AgentUtils .getClientResource(restletCloudConfig, modulesSettings, ModulesSettingsResource.class, MODULE_PATH); try { return modulesSettingsResource.getSettings(); } catch (Exception e) { throw new AgentConfigurationException( "Unable to retrieve agent settings from platform", e); } }
@Override public void run() { for (int attemptNumber = 1; attemptNumber <= MAX_ATTEMPTS + 1; attemptNumber++) { try { analyticsClientResource.postLogs(logsToPost); LOGGER.fine(logsToPost.size() + " call logs sent to the analytics service."); break; } catch (Exception e) { if (attemptNumber == MAX_ATTEMPTS) { LOGGER.severe("Posting " + logsToPost.size() + " call logs failed permanently after " + MAX_ATTEMPTS + " attempts."); errorSendLog(logsToPost); } else { LOGGER.warning("Error sending " + logsToPost.size() + " call logs to the analytics service during attempt n°" + attemptNumber + " because \"" + e.getMessage() + "\"."); try { Thread.sleep(getRetryTime(attemptNumber)); } catch (InterruptedException e1) { // ignore } } } } }
public UserInfo load(UserIdentifier userIdentifier) { Credentials credentials = new Credentials( userIdentifier.getIdentifier(), userIdentifier.getSecret()); User user = authenticateClientResource .authenticate(credentials); if (user == null) { // Authentication should throw an error instead of // returning // null throw new AgentException( "Authentication should not return null"); } return new UserInfo(user, userIdentifier.getSecret()); } };
try { operationAuthorizations = authorizationOperationsClientResource .getAuthorizations(); } catch (Exception e) { throw new AgentConfigurationException(
public FirewallModule(RestletCloudConfig restletCloudConfig, ModulesSettings modulesSettings) { FirewallSettingsResource firewallSettingsClientResource = AgentUtils .getClientResource(restletCloudConfig, modulesSettings, FirewallSettingsResource.class, SETTINGS_PATH); try { firewallSettings = firewallSettingsClientResource.getSettings(); } catch (Exception e) { throw new AgentConfigurationException( "Could not get firewall module configuration from Restlet Cloud connector service", e); } }
/** * Retrieves the modules settings from the service if it has changed, null * otherwise. * * @param restletCloudConfig * The service's configuration * @param modulesSettings * The current modules settings * @return The updated modules settings if it has changed, null otherwise. */ public static ModulesSettings getModulesSettings( RestletCloudConfig restletCloudConfig, ModulesSettings modulesSettings) { // When modulesSettings not null, cell revision header is set ModulesSettingsResource modulesSettingsResource = AgentUtils .getClientResource(restletCloudConfig, modulesSettings, ModulesSettingsResource.class, MODULE_PATH); try { return modulesSettingsResource.getSettings(); } catch (Exception e) { throw new AgentConfigurationException( "Unable to retrieve agent settings from platform", e); } }
public UserInfo load(UserIdentifier userIdentifier) { Credentials credentials = new Credentials( userIdentifier.getIdentifier(), userIdentifier.getSecret()); User user = authenticateClientResource .authenticate(credentials); if (user == null) { // Authentication should throw an error instead of // returning // null throw new AgentException( "Authentication should not return null"); } return new UserInfo(user, userIdentifier.getSecret()); } };
@Override public void run() { for (int attemptNumber = 1; attemptNumber <= MAX_ATTEMPTS + 1; attemptNumber++) { try { analyticsClientResource.postLogs(logsToPost); LOGGER.fine(logsToPost.size() + " call logs sent to the analytics service."); break; } catch (Exception e) { if (attemptNumber == MAX_ATTEMPTS) { LOGGER.severe("Posting " + logsToPost.size() + " call logs failed permanently after " + MAX_ATTEMPTS + " attempts."); errorSendLog(logsToPost); } else { LOGGER.warning("Error sending " + logsToPost.size() + " call logs to the analytics service during attempt n°" + attemptNumber + " because \"" + e.getMessage() + "\"."); try { Thread.sleep(getRetryTime(attemptNumber)); } catch (InterruptedException e1) { // ignore } } } } }
try { operationAuthorizations = authorizationOperationsClientResource .getAuthorizations(); } catch (Exception e) { throw new AgentConfigurationException(
public FirewallModule(RestletCloudConfig restletCloudConfig, ModulesSettings modulesSettings) { FirewallSettingsResource firewallSettingsClientResource = AgentUtils .getClientResource(restletCloudConfig, modulesSettings, FirewallSettingsResource.class, SETTINGS_PATH); try { firewallSettings = firewallSettingsClientResource.getSettings(); } catch (Exception e) { throw new AgentConfigurationException( "Could not get firewall module configuration from Restlet Cloud connector service", e); } }
/** * Retrieves the modules settings from the service if it has changed, null * otherwise. * * @param restletCloudConfig * The service's configuration * @param modulesSettings * The current modules settings * @return The updated modules settings if it has changed, null otherwise. */ public static ModulesSettings getModulesSettings( RestletCloudConfig restletCloudConfig, ModulesSettings modulesSettings) { // When modulesSettings not null, cell revision header is set ModulesSettingsResource modulesSettingsResource = AgentUtils .getClientResource(restletCloudConfig, modulesSettings, ModulesSettingsResource.class, MODULE_PATH); try { return modulesSettingsResource.getSettings(); } catch (Exception e) { throw new AgentConfigurationException( "Unable to retrieve agent settings from platform", e); } }
public UserInfo load(UserIdentifier userIdentifier) { Credentials credentials = new Credentials( userIdentifier.getIdentifier(), userIdentifier.getSecret()); User user = authenticateClientResource .authenticate(credentials); if (user == null) { // Authentication should throw an error instead of // returning // null throw new AgentException( "Authentication should not return null"); } return new UserInfo(user, userIdentifier.getSecret()); } };
@Override public void run() { for (int attemptNumber = 1; attemptNumber <= MAX_ATTEMPTS + 1; attemptNumber++) { try { analyticsClientResource.postLogs(logsToPost); LOGGER.fine(logsToPost.size() + " call logs sent to the analytics service."); break; } catch (Exception e) { if (attemptNumber == MAX_ATTEMPTS) { LOGGER.severe("Posting " + logsToPost.size() + " call logs failed permanently after " + MAX_ATTEMPTS + " attempts."); errorSendLog(logsToPost); } else { LOGGER.warning("Error sending " + logsToPost.size() + " call logs to the analytics service during attempt n°" + attemptNumber + " because \"" + e.getMessage() + "\"."); try { Thread.sleep(getRetryTime(attemptNumber)); } catch (InterruptedException e1) { // ignore } } } } }
try { operationAuthorizations = authorizationOperationsClientResource .getAuthorizations(); } catch (Exception e) { throw new AgentConfigurationException(
public FirewallModule(RestletCloudConfig restletCloudConfig, ModulesSettings modulesSettings) { FirewallSettingsResource firewallSettingsClientResource = AgentUtils .getClientResource(restletCloudConfig, modulesSettings, FirewallSettingsResource.class, SETTINGS_PATH); try { firewallSettings = firewallSettingsClientResource.getSettings(); } catch (Exception e) { throw new AgentConfigurationException( "Could not get firewall module configuration from Restlet Cloud connector service", e); } }
/** * Retrieves the modules settings from the service if it has changed, null * otherwise. * * @param restletCloudConfig * The service's configuration * @param modulesSettings * The current modules settings * @return The updated modules settings if it has changed, null otherwise. */ public static ModulesSettings getModulesSettings( RestletCloudConfig restletCloudConfig, ModulesSettings modulesSettings) { // When modulesSettings not null, cell revision header is set ModulesSettingsResource modulesSettingsResource = AgentUtils .getClientResource(restletCloudConfig, modulesSettings, ModulesSettingsResource.class, MODULE_PATH); try { return modulesSettingsResource.getSettings(); } catch (Exception e) { throw new AgentConfigurationException( "Unable to retrieve agent settings from platform", e); } }
public UserInfo load(UserIdentifier userIdentifier) { Credentials credentials = new Credentials( userIdentifier.getIdentifier(), userIdentifier.getSecret()); User user = authenticateClientResource .authenticate(credentials); if (user == null) { // Authentication should throw an error instead of // returning // null throw new AgentException( "Authentication should not return null"); } return new UserInfo(user, userIdentifier.getSecret()); } };
@Override public void run() { for (int attemptNumber = 1; attemptNumber <= MAX_ATTEMPTS + 1; attemptNumber++) { try { analyticsClientResource.postLogs(logsToPost); LOGGER.fine(logsToPost.size() + " call logs sent to the analytics service."); break; } catch (Exception e) { if (attemptNumber == MAX_ATTEMPTS) { LOGGER.severe("Posting " + logsToPost.size() + " call logs failed permanently after " + MAX_ATTEMPTS + " attempts."); errorSendLog(logsToPost); } else { LOGGER.warning("Error sending " + logsToPost.size() + " call logs to the analytics service during attempt n°" + attemptNumber + " because \"" + e.getMessage() + "\"."); try { Thread.sleep(getRetryTime(attemptNumber)); } catch (InterruptedException e1) { // ignore } } } } }
try { operationAuthorizations = authorizationOperationsClientResource .getAuthorizations(); } catch (Exception e) { throw new AgentConfigurationException(