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

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


                SynapseConfiguration synapseConfiguration = getSynapseConfiguration();
                String fileName = ServiceBusUtils.generateFileName(messageStore.getName());
                messageStore.setFileName(fileName);
                messageStore.init(getSynapseEnvironment());
                synapseConfiguration.addMessageStore(messageStore.getName(), messageStore);
                MediationPersistenceManager mp = getMediationPersistenceManager();
                mp.saveItem(messageStore.getName(), ServiceBusConstants.ITEM_TYPE_MESSAGE_STORE);
            } else {
                String message = "Unable to create Message Store ";
                handleException(log, message, null);
            }
View Full Code Here


                // then we startup the new.
                String fileName = oldMessageStore.getFileName();
                messageStore.setFileName(fileName);
                messageStore.init(getSynapseEnvironment());
                configuration.addMessageStore(messageStore.getName(),messageStore);
                MediationPersistenceManager mp = getMediationPersistenceManager();
                mp.saveItem(messageStore.getName(),ServiceBusConstants.ITEM_TYPE_MESSAGE_STORE);
            } else {
                assert false;
                String message = "Unexpected Error!!! Message store with name "
                        + messageStore.getName() + " does not exist";
                handleException(log,message,null);
View Full Code Here

            MessageStore removedMessageStore = configuration.getMessageStore(name);
            configuration.removeMessageStore(name);
            String fileName = removedMessageStore.getFileName();
            removedMessageStore.destroy();

            MediationPersistenceManager pm = getMediationPersistenceManager();
            pm.deleteItem(removedMessageStore.getName(),
                    fileName,ServiceBusConstants.ITEM_TYPE_MESSAGE_STORE);

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

            lock.lock();
            SynapseConfiguration synCfg = getSynapseConfiguration();
            SequenceMediator sequence = synCfg.getDefinedSequences().get(sequenceName);
            if (sequence != null) {
                synCfg.removeSequence(sequenceName);
                MediationPersistenceManager pm = getMediationPersistenceManager();
                pm.deleteItem(sequenceName, sequence.getFileName(),
                        ServiceBusConstants.ITEM_TYPE_SEQUENCE);
            } else {
                handleException("No defined sequence with name " + sequenceName
                        + " found to delete in the Synapse configuration");
            }
View Full Code Here

        }
        return null;
    }

    private void persistSequence(SequenceMediator sequence) throws SequenceEditorException {
        MediationPersistenceManager pm = getMediationPersistenceManager();
        pm.saveItem(sequence.getName(), ServiceBusConstants.ITEM_TYPE_SEQUENCE);
    }
View Full Code Here

            lock.lock();
            SynapseConfiguration synapseConfiguration = getSynapseConfiguration();
            SynapseEventSource eventSource = synapseConfiguration.getEventSource(eventsourceName);
            if (eventSource != null) {
                synapseConfiguration.removeEventSource(eventsourceName);
                MediationPersistenceManager pm = getMediationPersistenceManager();
                pm.deleteItem(eventsourceName, eventSource.getFileName(),
                        ServiceBusConstants.ITEM_TYPE_EVENT_SRC);
            } else {
                log.warn("No event source exists by the name : " + eventsourceName);
            }
        } catch (Exception e) {
View Full Code Here

        return synapseEventSource;
    }

    private void persistEventSource(SynapseEventSource eventsource)
            throws EventSourceAdminException {
        MediationPersistenceManager pm = getMediationPersistenceManager();
        pm.saveItem(eventsource.getName(), ServiceBusConstants.ITEM_TYPE_EVENT_SRC);
    }
View Full Code Here

                    createExecutor(SynapseConstants.SYNAPSE_NAMESPACE, executor,
                            true, new Properties());
            ex.setFileName(ServiceBusUtils.generateFileName(ex.getName()));
            ex.init();
            config.addPriorityExecutor(name, ex);
            MediationPersistenceManager pm = getMediationPersistenceManager();
            pm.saveItem(name, ServiceBusConstants.ITEM_TYPE_EXECUTOR);
            log.info("Adding priority-executor with name: " + name);
        } catch (AxisFault axisFault) {
            log.error("Error occured while building a priority executor from " +
                    "the configuration element" + axisFault.getMessage());
            throw axisFault;
View Full Code Here

            PriorityExecutor executor = config.removeExecutor(name);

            if (executor != null) {
                executor.destroy();
                log.info("Removed priority executor with name: " + name);
                MediationPersistenceManager pm = getMediationPersistenceManager();
                pm.deleteItem(name, executor.getFileName(),
                        ServiceBusConstants.ITEM_TYPE_EXECUTOR);
            }
        } finally {
            lock.unlock();
        }
View Full Code Here

            }
            SynapseConfiguration synapseConfiguration = getSynapseConfiguration();
            ProxyService proxy = synapseConfiguration.getProxyService(proxyName);
            if (proxy != null) {
                synapseConfiguration.removeProxyService(proxyName);
                MediationPersistenceManager pm = getMediationPersistenceManager();
                pm.deleteItem(proxyName, proxy.getFileName(),
                        ServiceBusConstants.ITEM_TYPE_PROXY_SERVICE);
                if(log.isDebugEnabled()) {
                    log.debug("Proxy service : " + proxyName + " deleted");
                }
                return SUCCESSFUL;
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.