Package org.wso2.carbon.mediation.initializer.persistence

Examples of org.wso2.carbon.mediation.initializer.persistence.MediationPersistenceManager


                new ProxyServiceParameterObserver(service);
        service.addParameterObserver(paramObserver);
    }

    private void persistProxyService(ProxyService proxy) throws ProxyAdminException {
        MediationPersistenceManager pm = getMediationPersistenceManager();
        if (pm != null) {
            pm.saveItem(proxy.getName(), ServiceBusConstants.ITEM_TYPE_PROXY_SERVICE);
        }
    }
View Full Code Here


            ConfigurationUpdater updater = new ConfigurationUpdater(getServerContextInformation(),
                    getConfigContext(), getMediationPersistenceManager(),
                    (UserRegistry) getConfigSystemRegistry());
            updater.update(configElement);

            MediationPersistenceManager pm = getMediationPersistenceManager();
            if (pm != null) {
                pm.saveItem(null, ServiceBusConstants.ITEM_TYPE_FULL_CONFIG);
            }

        } catch (Exception e) {
            handleException("Error while updating the Synapse configuration", e);
        } finally {
View Full Code Here

        return true;
    }

    public ValidationError[] validateConfiguration(OMElement configElement) {
        MediationPersistenceManager pm = getMediationPersistenceManager();
        if (pm != null) {
            String path = getSynapseConfiguration().getPathToConfigFile();
            MultiXMLConfigurationSerializer serializer = new MultiXMLConfigurationSerializer(path);
            if (!serializer.isWritable()) {
                return new ValidationError[] {
View Full Code Here

        SynapseConfiguration synapseConfig = synapseConfigSvc.getSynapseConfiguration();
        synapseConfig.addSequence(seq.getName(), seq);
        synapseConfig.addEndpoint(endpoint.getName(), endpoint);
        synapseConfig.addProxyService(proxy.getName(), proxy);

        MediationPersistenceManager pm = getMediationPersistenceManager();
        pm.saveItem(seq.getName(), ServiceBusConstants.ITEM_TYPE_SEQUENCE);
        pm.saveItem(endpoint.getName(), ServiceBusConstants.ITEM_TYPE_ENDPOINT);
        pm.saveItem(proxy.getName(), ServiceBusConstants.ITEM_TYPE_PROXY_SERVICE);

        hold();

        try {
            File seqFile = new File(path + File.separator +
View Full Code Here

                String fileName = ServiceBusUtils.generateFileName(messageProcessor.getName());
                messageProcessor.init(getSynapseEnvironment());
                messageProcessor.setFileName(fileName);
                synapseConfiguration.addMessageProcessor(messageProcessor.getName(),
                        messageProcessor);
                MediationPersistenceManager mp = getMediationPersistenceManager();
                mp.saveItem(messageProcessor.getName(), ServiceBusConstants.ITEM_TYPE_MESSAGE_PROCESSOR);

            } else {
                String message = "Unable to create Message Processor ";
                handleException(log, message, null);
            }
View Full Code Here

                messageProcessor.init(getSynapseEnvironment());
                String fileName = ServiceBusUtils.generateFileName(messageProcessor.getName());
                messageProcessor.setFileName(fileName);
                synapseConfiguration.addMessageProcessor(messageProcessor.getName(),
                        messageProcessor);
                MediationPersistenceManager mp = getMediationPersistenceManager();
                mp.saveItem(messageProcessor.getName(),ServiceBusConstants.ITEM_TYPE_MESSAGE_PROCESSOR);
            } else {
                String message = "Unable to Update Message Processor ";
                handleException(log, message, null);
            }
View Full Code Here

            if(processor != null) {
                processor.destroy();
            }


            MediationPersistenceManager pm = getMediationPersistenceManager();
            pm.deleteItem(processor.getName(),
                    fileName,ServiceBusConstants.ITEM_TYPE_MESSAGE_PROCESSOR);

        } else {
            handleException(log, "Message Store " + name + " does not exist", null);
        }
View Full Code Here

                getAxisConfiguration().getParameter(
                ServiceBusConstants.PERSISTENCE_MANAGER);
        if (p != null) {
            return (MediationPersistenceManager) p.getValue();
        } else {
            MediationPersistenceManager persistenceManager =
                    new MediationPersistenceManager(null, path,
                            synapseConfigSvc.getSynapseConfiguration(), 100, "synapse-config");

            try {
                synapseConfigSvc.getSynapseConfiguration().getAxisConfiguration().addParameter(
                    new Parameter(ServiceBusConstants.PERSISTENCE_MANAGER, persistenceManager));
View Full Code Here

            lock.lock();
            SynapseConfiguration synCfg = getSynapseConfiguration();
            Template sequence = synCfg.getEndpointTemplates().get(templateName);
            if (sequence != null) {
                synCfg.removeEndpointTemplate(templateName);
                MediationPersistenceManager pm = getMediationPersistenceManager();
                pm.deleteItem(templateName, sequence.getFileName(),
                              ServiceBusConstants.ITEM_TYPE_TEMPLATE_ENDPOINTS);
            } else {
                handleException("No defined endpoint template with name " + templateName
                                + " found to delete in the Synapse configuration");
            }
View Full Code Here

                log.debug("Deleting endpoint : " + endpointName + " from the configuration");
            }
            SynapseConfiguration synapseConfiguration = getSynapseConfiguration();
            Endpoint endpoint = synapseConfiguration.getDefinedEndpoints().get(endpointName);
            synapseConfiguration.removeEndpoint(endpointName);
            MediationPersistenceManager pm = getMediationPersistenceManager();
            String fileName = null;
            if (endpoint instanceof AbstractEndpoint) {
                fileName = endpoint.getFileName();
            }
            pm.deleteItem(endpointName, fileName, ServiceBusConstants.ITEM_TYPE_ENDPOINT);
            if (log.isDebugEnabled()) {
                log.debug("Endpoint : " + endpointName + " removed from the configuration");
            }
        } finally {
            lock.unlock();
View Full Code Here

TOP

Related Classes of org.wso2.carbon.mediation.initializer.persistence.MediationPersistenceManager

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.