/** * {@inheritDoc} */ @Override public Environment getEnvironment(String id) throws BusinessException { return ciManager.getEnvironment(id); }
/** * {@inheritDoc} */ @Override public List<Profile> getAllProfiles() { return ciManager.getAllProfiles(); }
/** * {@inheritDoc} */ @Override public AgentMappings getAgentMappings() { return ciManager.getAgentMappings(); }
/** * Initialize. */ @PostConstruct public void init() { // WARNING loading must be done in this order loadExistingProfiles(); loadExistingEnvironments(); loadAgentMappings(); loadBusinessContextDefinition(); loadExistingAlertingDefinitions(); }
/** * Save the given {@link AlertingDefinition}. * * @param alertingDefinition * the {@link AlertingDefinition} to save * @throws IOException * if {@link IOException} occurs * @throws JAXBException * if {@link JAXBException} occurs. If saving fails */ private void saveAlertingDefinition(AlertingDefinition alertingDefinition) throws JAXBException, IOException { transformator.marshall(pathResolver.getAlertingDefinitionFilePath(alertingDefinition), alertingDefinition, getRelativeToSchemaPath(pathResolver.getDefaultCiPath()).toString(), ISchemaVersionAware.ConfigurationInterface.SCHEMA_VERSION); }
/** * Saves {@link Environment} to the disk. * * @param environment * {@link Environment} to save. * @throws IOException * If {@link IOException} occurs. * @throws JAXBException * If {@link JAXBException} occurs. If saving fails. */ private void saveEnvironment(Environment environment) throws JAXBException, IOException { transformator.marshall(pathResolver.getEnvironmentFilePath(environment), environment, getRelativeToSchemaPath(pathResolver.getEnvironmentPath()).toString(), ISchemaVersionAware.ConfigurationInterface.SCHEMA_VERSION); }
/** * Saves agent mapping. * * @param agentMappings * To save * @throws IOException * If {@link IOException} occurs. * @throws JAXBException * If {@link JAXBException} occurs. If saving fails. */ private void saveAgentMapping(AgentMappings agentMappings) throws JAXBException, IOException { transformator.marshall(pathResolver.getAgentMappingFilePath(), agentMappings, getRelativeToSchemaPath(pathResolver.getDefaultCiPath()).toString(), ISchemaVersionAware.ConfigurationInterface.SCHEMA_VERSION); }
/** * Returns path pointing to the business context file. * * @return Path to the file. */ public Path getBusinessContextFilePath() { return getDefaultCiPath().resolve(BUSINESS_CONTEXT_CONFIG_FILE); }
/** * {@inheritDoc} */ @Override public Profile getProfile(String id) throws BusinessException { return ciManager.getProfile(id); }
/** * {@inheritDoc} */ @Override public AlertingDefinition getAlertingDefinition(String id) throws BusinessException { return ciManager.getAlertingDefinition(id); }
/** * {@inheritDoc} */ @Override public Collection<Environment> getAllEnvironments() { return ciManager.getAllEnvironments(); }
/** * {@inheritDoc} */ @Override public List<AlertingDefinition> getAlertingDefinitions() { return ciManager.getAlertingDefinitions(); }
/** * Returns given path relative to schema part. * * @param path * path to relativize * @return path relative to schema part * @see #getSchemaPath() */ private Path getRelativeToSchemaPath(Path path) { return path.relativize(pathResolver.getSchemaPath()); }
/** * {@inheritDoc} */ @Override public synchronized ApplicationDefinition getApplicationDefinition(int id) throws BusinessException { if (id == ApplicationDefinition.DEFAULT_ID) { return ApplicationDefinition.DEFAULT_APPLICATION_DEFINITION; } else { return ciManager.getBusinessconContextDefinition().getApplicationDefinition(id); } }
/** * Returns the directory where alert thresholds are saved. * * @return Path to the folder of the alert thresholds. */ public Path getAlertingDefinitionsPath() { return getDefaultCiPath().resolve(ALERTING_DEFINITIONS_FOLDER); }
@Test(expectedExceptions = BusinessException.class) public void getNotExisting() throws Exception { Environment result = manager.getEnvironment("someId"); } }
@Test(expectedExceptions = BusinessException.class) public void getNotExisting() throws Exception { Profile result = manager.getProfile("someId"); } }
/** * Returns path pointing to the agent mapping file. * * @return Path to the file. */ public Path getAgentMappingFilePath() { return getDefaultCiPath().resolve(AGENT_MAPPING_FILE); }
/** * Returns the schema path. * * @return Returns the schema path. */ public Path getSchemaPath() { return getDefaultCiPath().resolve(SCHEMA_FOLDER).resolve(SCHEMA_FILE); }
/** * Returns the schema path. * * @return Returns the schema path. */ public Path getMigrationPath() { return getDefaultCiPath().resolve(SCHEMA_FOLDER).resolve(MIGRATION_FOLDER); }