public OMElement serializeEndpoint(Endpoint epr, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { File eprDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.ENDPOINTS_DIR); OMElement eprElem = EndpointSerializer.getElementFromEndpoint(epr); String fileName = epr.getFileName(); if (fileName != null) { if (currentDirectory == rootDirectory) { handleDeployment(eprDir, fileName, epr.getName(), synapseConfig.getArtifactDeploymentStore()); } File eprFile = new File(eprDir, fileName); writeToFile(eprElem, eprFile); } else if (parent != null) { parent.addChild(eprElem); } return eprElem; }
public OMElement serializeInboundEndpoint(InboundEndpoint inboundEndpoint, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { File inboundEndpointDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.INBOUND_ENDPOINT_DIR); OMElement inboundEndpointElt = InboundEndpointSerializer.serializeInboundEndpoint(inboundEndpoint); String fileName = inboundEndpoint.getFileName(); if (fileName != null) { if (currentDirectory == rootDirectory) { handleDeployment(inboundEndpointDir, fileName, inboundEndpoint.getName(), synapseConfig.getArtifactDeploymentStore()); } File apiFile = new File(inboundEndpointDir, fileName); writeToFile(inboundEndpointElt, apiFile); } else if (parent != null) { parent.addChild(inboundEndpointElt); } return inboundEndpointElt; }
public OMElement serializeProxy(ProxyService service, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { File proxyDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.PROXY_SERVICES_DIR); OMElement proxyElem = ProxyServiceSerializer.serializeProxy(null, service); String fileName = service.getFileName(); if (fileName != null) { if (currentDirectory == rootDirectory) { handleDeployment(proxyDir, fileName, service.getName(), synapseConfig.getArtifactDeploymentStore()); } File proxyFile = new File(proxyDir, fileName); writeToFile(proxyElem, proxyFile); } else if (parent != null) { parent.addChild(proxyElem); } return proxyElem; }
public OMElement serializeProxy(ProxyService service, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { File proxyDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.PROXY_SERVICES_DIR); OMElement proxyElem = ProxyServiceSerializer.serializeProxy(null, service); String fileName = service.getFileName(); if (fileName != null) { if (currentDirectory == rootDirectory) { handleDeployment(proxyDir, fileName, service.getName(), synapseConfig.getArtifactDeploymentStore()); } File proxyFile = new File(proxyDir, fileName); writeToFile(proxyElem, proxyFile); } else if (parent != null) { parent.addChild(proxyElem); } return proxyElem; }
public OMElement serializeAPI(API api, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { File apiDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.REST_API_DIR); OMElement apiElement = APISerializer.serializeAPI(api); String fileName = api.getFileName(); if (fileName != null) { if (currentDirectory == rootDirectory) { handleDeployment(apiDir, fileName, api.getName(), synapseConfig.getArtifactDeploymentStore()); } File apiFile = new File(apiDir, fileName); writeToFile(apiElement, apiFile); } else if (parent != null) { parent.addChild(apiElement); } return apiElement; }
public OMElement serializeMessageStore(MessageStore messagestore,SynapseConfiguration synConfig, OMElement parent) throws Exception { File messageStoreDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.MESSAGE_STORE_DIR); OMElement messageStoreElem = MessageStoreSerializer.serializeMessageStore(null, messagestore); String fileName = messagestore.getFileName(); if (fileName != null) { if (currentDirectory == rootDirectory) { handleDeployment(messageStoreDir, fileName, messagestore.getName(),synConfig .getArtifactDeploymentStore()); } File messageStoreFile = new File(messageStoreDir , fileName); writeToFile(messageStoreElem , messageStoreFile); } else if (parent != null) { parent.addChild(messageStoreElem); } return messageStoreElem; }
public OMElement serializeEndpoint(Endpoint epr, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { File eprDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.ENDPOINTS_DIR); OMElement eprElem = EndpointSerializer.getElementFromEndpoint(epr); String fileName = epr.getFileName(); if (fileName != null) { if (currentDirectory == rootDirectory) { handleDeployment(eprDir, fileName, epr.getName(), synapseConfig.getArtifactDeploymentStore()); } File eprFile = new File(eprDir, fileName); writeToFile(eprElem, eprFile); } else if (parent != null) { parent.addChild(eprElem); } return eprElem; }
public OMElement serializeImport(SynapseImport synapseImport, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { File importDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.SYNAPSE_IMPORTS_DIR); OMElement importElement = SynapseImportSerializer.serializeImport(synapseImport); String fileName = synapseImport.getFileName(); if (fileName != null) { if (currentDirectory == rootDirectory) { handleDeployment(importDir, fileName, synapseImport.getName(), synapseConfig.getArtifactDeploymentStore()); } File importFile = new File(importDir, fileName); writeToFile(importElement, importFile); } else if (parent != null) { parent.addChild(importElement); } return importElement; }
public OMElement serializeMessageProcessor(MessageProcessor messageProcessor, SynapseConfiguration synapseConfiguration , OMElement parent) throws Exception { File messageProcessorDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.MESSAGE_PROCESSOR_DIR); OMElement messageProcessorElem = MessageProcessorSerializer.serializeMessageProcessor(null, messageProcessor); String fileName = messageProcessor.getFileName(); if (fileName != null) { if (currentDirectory == rootDirectory) { handleDeployment(messageProcessorDir, fileName, messageProcessor.getName(), synapseConfiguration.getArtifactDeploymentStore()); } File messageProcessorFile = new File(messageProcessorDir , fileName); writeToFile(messageProcessorElem , messageProcessorFile); } else if (parent != null) { parent.addChild(messageProcessorElem); } return messageProcessorElem; }
public OMElement serializeTemplate(Template template, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { File seqDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.TEMPLATES_DIR); OMElement seqElem = new TemplateSerializer().serializeEndpointTemplate(template, null); String fileName = template.getFileName(); if (fileName != null) { if (currentDirectory == rootDirectory) { handleDeployment(seqDir, fileName, template.getName(), synapseConfig.getArtifactDeploymentStore()); } File seqFile = new File(seqDir, fileName); writeToFile(seqElem, seqFile); } else if (parent != null) { parent.addChild(seqElem); } return seqElem; }
public OMElement serializeTemplate(Template template, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { File seqDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.TEMPLATES_DIR); OMElement seqElem = new TemplateSerializer().serializeEndpointTemplate(template, null); String fileName = template.getFileName(); if (fileName != null) { if (currentDirectory == rootDirectory) { handleDeployment(seqDir, fileName, template.getName(), synapseConfig.getArtifactDeploymentStore()); } File seqFile = new File(seqDir, fileName); writeToFile(seqElem, seqFile); } else if (parent != null) { parent.addChild(seqElem); } return seqElem; }
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 serializeSequence(SequenceMediator seq, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { File seqDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.SEQUENCES_DIR); OMElement seqElem = MediatorSerializerFinder.getInstance().getSerializer(seq). serializeMediator(null, seq); String fileName = seq.getFileName(); if (fileName != null) { if (currentDirectory == rootDirectory) { handleDeployment(seqDir, fileName, seq.getName(), synapseConfig.getArtifactDeploymentStore()); } File seqFile = new File(seqDir, fileName); writeToFile(seqElem, seqFile); } else if (parent != null) { parent.addChild(seqElem); } return seqElem; }
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 serializeTemplate(TemplateMediator template, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { File seqDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.TEMPLATES_DIR); OMElement seqElem = MediatorSerializerFinder.getInstance().getSerializer(template). serializeMediator(null, template); String fileName = template.getFileName(); if (fileName != null) { if (currentDirectory == rootDirectory) { handleDeployment(seqDir, fileName, template.getName(), synapseConfig.getArtifactDeploymentStore()); } File seqFile = new File(seqDir, fileName); writeToFile(seqElem, seqFile); } else if (parent != null) { parent.addChild(seqElem); } return seqElem; }
public OMElement serializeTask(Startup task, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { File tasksDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.TASKS_DIR); OMElement taskElem = StartupFinder.getInstance().serializeStartup(null, task); if (task.getFileName() != null) { String fileName = task.getFileName(); if (currentDirectory == rootDirectory) { handleDeployment(tasksDir, fileName, task.getName(), synapseConfig.getArtifactDeploymentStore()); } File taskFile = new File(tasksDir, fileName); writeToFile(taskElem, taskFile); } else if (parent != null) { parent.addChild(taskElem); } return taskElem; }
public OMElement serializeTask(Startup task, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { File tasksDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.TASKS_DIR); OMElement taskElem = StartupFinder.getInstance().serializeStartup(null, task); if (task.getFileName() != null) { String fileName = task.getFileName(); if (currentDirectory == rootDirectory) { handleDeployment(tasksDir, fileName, task.getName(), synapseConfig.getArtifactDeploymentStore()); } File taskFile = new File(tasksDir, fileName); writeToFile(taskElem, taskFile); } else if (parent != null) { parent.addChild(taskElem); } return taskElem; }
public OMElement serializeTemplate(TemplateMediator template, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { File seqDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.TEMPLATES_DIR); OMElement seqElem = MediatorSerializerFinder.getInstance().getSerializer(template). serializeMediator(null, template); String fileName = template.getFileName(); if (fileName != null) { if (currentDirectory == rootDirectory) { handleDeployment(seqDir, fileName, template.getName(), synapseConfig.getArtifactDeploymentStore()); } File seqFile = new File(seqDir, fileName); writeToFile(seqElem, seqFile); } else if (parent != null) { parent.addChild(seqElem); } return seqElem; }
public OMElement serializeExecutor(PriorityExecutor source, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { File executorDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.EXECUTORS_DIR); OMElement eventDirElem = PriorityExecutorSerializer.serialize(null, source, SynapseConstants.SYNAPSE_NAMESPACE); File entriesDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.EXECUTORS_DIR); String fileName = source.getFileName(); if (source.getFileName() != null) { if (currentDirectory == rootDirectory) { handleDeployment(entriesDir, fileName, source.getName(), synapseConfig.getArtifactDeploymentStore()); } File eventSrcFile = new File(executorDir, source.getFileName()); writeToFile(eventDirElem, eventSrcFile); } else if (parent != null) { parent.addChild(eventDirElem); } return eventDirElem; }
public OMElement serializeExecutor(PriorityExecutor source, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { File executorDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.EXECUTORS_DIR); OMElement eventDirElem = PriorityExecutorSerializer.serialize(null, source, SynapseConstants.SYNAPSE_NAMESPACE); File entriesDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.EXECUTORS_DIR); String fileName = source.getFileName(); if (source.getFileName() != null) { if (currentDirectory == rootDirectory) { handleDeployment(entriesDir, fileName, source.getName(), synapseConfig.getArtifactDeploymentStore()); } File eventSrcFile = new File(executorDir, source.getFileName()); writeToFile(eventDirElem, eventSrcFile); } else if (parent != null) { parent.addChild(eventDirElem); } return eventDirElem; }