/** * Modify and Existing Message processor based on the given XML that is passed from the FE * * @param xml XML configuration for the changed Message processor * @throws AxisFault if Some thing goes wrong when modifying the Message processor */ public void modifyMessageProcessor(String xml) throws AxisFault { try { OMElement msElem = createElement(xml); MessageProcessor messageProcessor = MessageProcessorFactory.createMessageProcessor(msElem); if (messageProcessor != null && messageProcessor.getName() != null) { SynapseConfiguration synapseConfiguration = getSynapseConfiguration(); MessageProcessor removedProcessor = synapseConfiguration.removeMessageProcessor(messageProcessor.getName()); if (removedProcessor != null) { removedProcessor.destroy(); } 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); } } catch (XMLStreamException e) { String message = "Unable to Modify Message Processor "; handleException(log, message, e); } }
@Override public void restoreSynapseArtifact(String artifactName) { super.restoreSynapseArtifact(artifactName); if (mpm != null) { mpm.saveItemToRegistry(artifactName, ServiceBusConstants.ITEM_TYPE_ENDPOINT); } }
@Override public void undeploySynapseArtifact(String artifactName) { super.undeploySynapseArtifact(artifactName); if (mpm != null) { mpm.deleteItemFromRegistry(artifactName, ServiceBusConstants.ITEM_TYPE_ENDPOINT); } }
@Override public String deploySynapseArtifact( OMElement artifactConfig, String fileName, Properties properties) { String taskName = super.deploySynapseArtifact(artifactConfig, fileName, properties); mpm.saveItemToRegistry(taskName, ServiceBusConstants.ITEM_TYPE_TASK); return taskName; }
@Override public String deploySynapseArtifact( OMElement artifactConfig, String fileName, Properties properties) { String epName = super.deploySynapseArtifact(artifactConfig, fileName, properties); if (mpm != null) { mpm.saveItemToRegistry(epName, ServiceBusConstants.ITEM_TYPE_ENDPOINT); } return epName; }
/** * Delete the MessageProcessor instance with given name in the synapse configuration * * @param name of the MessageProcessor to be deleted * @throws AxisFault if Message processor does not exist */ public void deleteMessageProcessor(String name) throws AxisFault { SynapseConfiguration configuration = getSynapseConfiguration(); assert configuration != null; if (configuration.getMessageProcessors().containsKey(name)) { MessageProcessor processor = configuration.removeMessageProcessor(name); String fileName = processor.getFileName(); 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); } }
@Override public void restoreSynapseArtifact(String artifactName) { super.restoreSynapseArtifact(artifactName); mpm.saveItemToRegistry(artifactName, ServiceBusConstants.ITEM_TYPE_TASK); }
@Override public void undeploySynapseArtifact(String artifactName) { super.undeploySynapseArtifact(artifactName); mpm.deleteItemFromRegistry(artifactName, ServiceBusConstants.ITEM_TYPE_TASK); }