@Override public void restoreSynapseArtifact(String artifactName) { if (log.isDebugEnabled()) { log.debug("Restoring the EventSource with name : " + artifactName + " : Started"); } try { SynapseEventSource es = getSynapseConfiguration().getEventSource(artifactName); OMElement esElem = EventSourceSerializer.serializeEventSource(null, es); if (es.getFileName() != null) { String fileName = getServerConfigurationInformation().getSynapseXMLLocation() + File.separator + MultiXMLConfigurationBuilder.EVENTS_DIR + File.separator + es.getFileName(); writeToFile(esElem, fileName); if (log.isDebugEnabled()) { log.debug("Restoring the EventSource with name : " + artifactName + " : Completed"); } log.info("EventSource named '" + artifactName + "' has been restored"); } else { handleSynapseArtifactDeploymentError("Couldn't restore the EventSource named '" + artifactName + "', filename cannot be found"); } } catch (Exception e) { handleSynapseArtifactDeploymentError( "Restoring of the EventSource named '" + artifactName + "' has failed", e); } } }
@Override public void restoreSynapseArtifact(String artifactName) { if (log.isDebugEnabled()) { log.debug("Restoring the EventSource with name : " + artifactName + " : Started"); } try { SynapseEventSource es = getSynapseConfiguration().getEventSource(artifactName); OMElement esElem = EventSourceSerializer.serializeEventSource(null, es); if (es.getFileName() != null) { String fileName = getServerConfigurationInformation().getSynapseXMLLocation() + File.separator + MultiXMLConfigurationBuilder.EVENTS_DIR + File.separator + es.getFileName(); writeToFile(esElem, fileName); if (log.isDebugEnabled()) { log.debug("Restoring the EventSource with name : " + artifactName + " : Completed"); } log.info("EventSource named '" + artifactName + "' has been restored"); } else { handleSynapseArtifactDeploymentError("Couldn't restore the EventSource named '" + artifactName + "', filename cannot be found"); } } catch (Exception e) { handleSynapseArtifactDeploymentError( "Restoring of the EventSource named '" + artifactName + "' has failed", e); } } }
public OMElement serializeEventSource(SynapseEventSource source, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { File eventsDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.EVENTS_DIR); OMElement eventSrcElem = EventSourceSerializer.serializeEventSource(null, source); String fileName = source.getFileName(); if (fileName != null) { if (currentDirectory == rootDirectory) { handleDeployment(eventsDir, fileName, source.getName(), synapseConfig.getArtifactDeploymentStore()); } File eventSrcFile = new File(eventsDir, source.getFileName()); writeToFile(eventSrcElem, eventSrcFile); } else if (parent != null) { parent.addChild(eventSrcElem); } return eventSrcElem; }
public OMElement serializeEventSource(SynapseEventSource source, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { File eventsDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.EVENTS_DIR); OMElement eventSrcElem = EventSourceSerializer.serializeEventSource(null, source); String fileName = source.getFileName(); if (fileName != null) { if (currentDirectory == rootDirectory) { handleDeployment(eventsDir, fileName, source.getName(), synapseConfig.getArtifactDeploymentStore()); } File eventSrcFile = new File(eventsDir, source.getFileName()); writeToFile(eventSrcElem, eventSrcFile); } else if (parent != null) { parent.addChild(eventSrcElem); } return eventSrcElem; }
if (es.getFileName() != null) { handleDeployment(new File(rootDirectory, MultiXMLConfigurationBuilder. EVENTS_DIR), es.getFileName(), es.getName(), deploymentStore);
if (es.getFileName() != null) { handleDeployment(new File(rootDirectory, MultiXMLConfigurationBuilder. EVENTS_DIR), es.getFileName(), es.getName(), deploymentStore);
if (source.getFileName() == null) { EventSourceSerializer.serializeEventSource(definitions, source);
if (source.getFileName() == null) { EventSourceSerializer.serializeEventSource(definitions, source);