use of kieker.common.exception.ConfigurationException in project iobserve-analysis by research-iobserve.
the class RacCreatorMain method checkParameters.
@Override
protected boolean checkParameters(final JCommander commander) throws ConfigurationException {
try {
if (!this.outputPath.isDirectory() || !this.outputPath.exists()) {
RacCreatorMain.LOGGER.error("Output path {} does not exist or is not a directory.", this.outputPath.getCanonicalPath());
commander.usage();
return false;
}
if (!this.inputPath.isDirectory() || !this.inputPath.exists()) {
RacCreatorMain.LOGGER.error("Input path {} does not exist or is not a directory.", this.inputPath.getCanonicalPath());
commander.usage();
return false;
}
if (!ParameterEvaluationUtils.isFileReadable(this.mappingFile, "Mapping file", commander)) {
commander.usage();
return false;
}
if (!ParameterEvaluationUtils.isFileReadable(this.repositoryFile, "Repository file", commander)) {
commander.usage();
return false;
}
return true;
} catch (final IOException e) {
throw new ConfigurationException(e);
}
}
use of kieker.common.exception.ConfigurationException in project iobserve-analysis by research-iobserve.
the class EvaluationMain method checkParameters.
@Override
protected boolean checkParameters(final JCommander commander) throws ConfigurationException {
try {
if (!this.baselineModelLocation.canRead()) {
EvaluationMain.LOGGER.error("reading baseline failed: {}", this.baselineModelLocation.getCanonicalPath());
commander.usage();
return false;
}
if (!this.testModelLocation.canRead()) {
EvaluationMain.LOGGER.error("reading test model failed: {}", this.testModelLocation.getCanonicalPath());
commander.usage();
return false;
}
return true;
} catch (final IOException e) {
throw new ConfigurationException(e);
}
}
use of kieker.common.exception.ConfigurationException in project iobserve-analysis by research-iobserve.
the class ComparisonMain method checkParameters.
@Override
protected boolean checkParameters(final JCommander commander) throws ConfigurationException {
try {
if (!this.baselineModelLocation.canRead()) {
ComparisonMain.LOGGER.error("reading baseline failed: {}", this.baselineModelLocation.getCanonicalPath());
commander.usage();
return false;
}
if (!this.testModelLocation.canRead()) {
ComparisonMain.LOGGER.error("reading test model failed: {}", this.testModelLocation.getCanonicalPath());
commander.usage();
return false;
}
return true;
} catch (final IOException e) {
throw new ConfigurationException(e);
}
}
use of kieker.common.exception.ConfigurationException in project iobserve-analysis by research-iobserve.
the class RacCreatorMain method createTeetimeConfiguration.
@Override
protected ObservationConfiguration createTeetimeConfiguration() throws ConfigurationException {
final Collection<File> inputPaths = new ArrayList<>();
inputPaths.add(this.inputPath);
final File mappedClassesFile = new File(this.outputPath.getAbsolutePath() + File.separator + RacCreatorMain.MAPPED_CLASSES_FILENAME);
final File unmappedClassesFile = new File(this.outputPath.getAbsolutePath() + File.separator + RacCreatorMain.UNMAPPED_CLASSES_FILENAME);
final File racFile = new File(this.outputPath.getAbsolutePath() + File.separator + RacCreatorMain.RAC_FILENAME);
final RepositoryFileReader repositoryFileReader = new RepositoryFileReader(this.repositoryFile);
final ModelMappingReader mappingFileReader = new ModelMappingReader(this.mappingFile);
try {
return new ObservationConfiguration(inputPaths, repositoryFileReader, mappingFileReader, mappedClassesFile, unmappedClassesFile, racFile);
} catch (ParserConfigurationException | SAXException | IOException e) {
throw new ConfigurationException(e);
}
}
use of kieker.common.exception.ConfigurationException in project iobserve-analysis by research-iobserve.
the class PrivacyViolationDetectionServiceMain method createTeetimeConfiguration.
@Override
protected PipelineConfiguration createTeetimeConfiguration() throws ConfigurationException {
/**
* load models.
*/
try {
final ModelImporter modelHandler = new ModelImporter(this.parameterConfiguration.getModelInitDirectory());
/**
* initialize database.
*/
final IModelResource<CorrespondenceModel> correspondenceModelResource = this.loadResourceAndInitDB(CorrespondencePackage.eINSTANCE, modelHandler.getCorrespondenceModel());
final IModelResource<Repository> repositoryModelResource = this.loadResourceAndInitDB(RepositoryPackage.eINSTANCE, modelHandler.getRepositoryModel());
final IModelResource<ResourceEnvironment> resourceEnvironmentModelResource = this.loadResourceAndInitDB(ResourceenvironmentPackage.eINSTANCE, modelHandler.getResourceEnvironmentModel());
final IModelResource<System> systemModelResource = this.loadResourceAndInitDB(SystemPackage.eINSTANCE, modelHandler.getSystemModel());
final IModelResource<Allocation> allocationModelResource = this.loadResourceAndInitDB(AllocationPackage.eINSTANCE, modelHandler.getAllocationModel());
final IModelResource<DataProtectionModel> privacyModelResource = this.loadResourceAndInitDB(PrivacyPackage.eINSTANCE, modelHandler.getPrivacyModel());
return new PipelineConfiguration(this.kiekerConfiguration, correspondenceModelResource, repositoryModelResource, resourceEnvironmentModelResource, systemModelResource, allocationModelResource, privacyModelResource, this.parameterConfiguration.getWarningFile(), this.parameterConfiguration.getAlarmsFile(), this.parameterConfiguration.getModelDumpDirectory());
} catch (final DBException | IOException e) {
throw new ConfigurationException(e);
}
}
Aggregations