/** * 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); }
/** * Returns the directory where profiles are saved. * * @return Profiles directory path. */ public Path getProfilesPath() { return getDefaultCiPath().resolve(PROFILES_FOLDER); }
/** * Returns the directory where environments are saved. * * @return Environments directory path. */ public Path getEnvironmentPath() { return getDefaultCiPath().resolve(ENVIRONMENTS_FOLDER); }
/** * Returns path pointing to the agent mapping file. * * @return Path to the file. */ public Path getAgentMappingFilePath() { return getDefaultCiPath().resolve(AGENT_MAPPING_FILE); }
/** * Returns path pointing to the business context file. * * @return Path to the file. */ public Path getBusinessContextFilePath() { return getDefaultCiPath().resolve(BUSINESS_CONTEXT_CONFIG_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); }
/** * 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 the passed {@link IBusinessContextDefinition}. * * @param businessContextDefinition * {@link IBusinessContextDefinition} to save * @throws IOException * If {@link IOException} occurs. * @throws JAXBException * If {@link JAXBException} occurs. If saving fails. */ private void saveBusinessContext(BusinessContextDefinition businessContextDefinition) throws JAXBException, IOException { businessContextDefinitionReference.set(businessContextDefinition); transformator.marshall(pathResolver.getBusinessContextFilePath(), businessContextDefinition, getRelativeToSchemaPath(pathResolver.getDefaultCiPath()).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); }
final ConfigurationInterfacePathResolver resolverHelper = new ConfigurationInterfacePathResolver(); resolverHelper.init(); when(pathResolver.getDefaultCiPath()).thenReturn(Paths.get(TEST_FOLDER)); when(pathResolver.getAgentMappingFilePath()).thenReturn(Paths.get(TEST_FOLDER).resolve(EXT_RESOURCES_PATH.relativize(resolverHelper.getAgentMappingFilePath()))); when(pathResolver.getEnvironmentPath()).thenReturn(Paths.get(TEST_FOLDER).resolve(EXT_RESOURCES_PATH.relativize(resolverHelper.getEnvironmentPath())));