Package org.openengsb.core.api.model

Examples of org.openengsb.core.api.model.ContextId


        }
        return configurations;
    }

    private String getFileNameForMetaData(Map<String, String> metaData) throws PersistenceException {
        ContextId contextId = ContextId.fromMetaData(metaData);
        return String.format("%s.%s", contextId.getId(), CONTEXT_FILE_EXTENSION);
    }
View Full Code Here


        return String.format("%s.%s", contextId.getId(), CONTEXT_FILE_EXTENSION);
    }

    private ConfigItem<Map<String, String>> loadContextConfigurationFromFile(File configurationFile) {
        String contextFileName = FilenameUtils.removeExtension(configurationFile.getName());
        ContextId contextId = new ContextId(contextFileName);
        ContextConfiguration contextConfig = new ContextConfiguration(contextId.toMetaData(), null);
        return contextConfig;
    }
View Full Code Here

    @Override
    public void createContext(String contextId) {
        LOGGER.debug("Creating context %s", contextId);
        ContextConfiguration contextConfiguration =
            new ContextConfiguration(new ContextId(contextId).toMetaData(), null);
        try {
            getConfigPersistenceService().persist(contextConfiguration);
        } catch (InvalidConfigurationException e) {
            LOGGER.error("Error storing context " + contextId + ": Invalid configuration", e);
        } catch (PersistenceException e) {
View Full Code Here

    @Override
    public void deleteContext(String contextId) {
        LOGGER.debug("deleting context {}", contextId);
        try {
            getConfigPersistenceService().remove(new ContextId(contextId).toMetaData());
        } catch (PersistenceException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

        return availableContexts;
    }

    private Context getContextById(String currentContextId) {
        ContextId contextId = new ContextId(currentContextId);
        List<ContextConfiguration> contexts = getContextConfigurationsOrEmptyOnError(contextId.toMetaData());
        if (contexts.isEmpty()) {
            return null;
        }
        return contexts.get(0).toContext();
    }
View Full Code Here

TOP

Related Classes of org.openengsb.core.api.model.ContextId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.