Search in sources :

Example 1 with ConfigurationException

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);
    }
}
Also used : ConfigurationException(kieker.common.exception.ConfigurationException) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) IOException(java.io.IOException)

Example 2 with ConfigurationException

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);
    }
}
Also used : ConfigurationException(kieker.common.exception.ConfigurationException) IOException(java.io.IOException)

Example 3 with ConfigurationException

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);
    }
}
Also used : ConfigurationException(kieker.common.exception.ConfigurationException) IOException(java.io.IOException)

Example 4 with ConfigurationException

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);
    }
}
Also used : ConfigurationException(kieker.common.exception.ConfigurationException) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) ArrayList(java.util.ArrayList) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) IOException(java.io.IOException) File(java.io.File) SAXException(org.xml.sax.SAXException)

Example 5 with ConfigurationException

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);
    }
}
Also used : DBException(org.iobserve.model.persistence.DBException) ResourceEnvironment(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment) DataProtectionModel(org.iobserve.model.privacy.DataProtectionModel) CorrespondenceModel(org.iobserve.model.correspondence.CorrespondenceModel) IOException(java.io.IOException) System(org.palladiosimulator.pcm.system.System) ModelImporter(org.iobserve.model.ModelImporter) Repository(org.palladiosimulator.pcm.repository.Repository) Allocation(org.palladiosimulator.pcm.allocation.Allocation) ConfigurationException(kieker.common.exception.ConfigurationException)

Aggregations

IOException (java.io.IOException)5 ConfigurationException (kieker.common.exception.ConfigurationException)5 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 ModelImporter (org.iobserve.model.ModelImporter)1 CorrespondenceModel (org.iobserve.model.correspondence.CorrespondenceModel)1 DBException (org.iobserve.model.persistence.DBException)1 DataProtectionModel (org.iobserve.model.privacy.DataProtectionModel)1 Allocation (org.palladiosimulator.pcm.allocation.Allocation)1 Repository (org.palladiosimulator.pcm.repository.Repository)1 ResourceEnvironment (org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment)1 System (org.palladiosimulator.pcm.system.System)1 SAXException (org.xml.sax.SAXException)1