/** * To create an anonymous list mediator form OMElement * @param el * @param properties bag of properties with additional information * @return List mediator */ public static AnonymousListMediator createAnonymousListMediator( OMElement el, Properties properties) { AnonymousListMediator mediator = new AnonymousListMediator(); { addChildren(el, mediator, properties); } return mediator; }
/** * Serialized this Target object into the given element with the given attribute name. * * @param attributeName Name of the attribute. * @param element Element to serialize this target in to. * @return Element after serializing this target. */ public OMElement serializeTarget(String attributeName, OMElement element) { return new ValueSerializer().serializeValue(value, attributeName, element); }
private void serializeTasks(Collection<Startup> tasks, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { for (Startup task : tasks) { serializeTask(task, synapseConfig, parent); } }
public void testProxyServiceSerializationSenarioThree() throws Exception { String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" " + "name=\"name\" startOnLoad=\"true\" transports=\"http\"><description>" + "description</description><target><inSequence onError=\"ref\"><description>Test documentation</description><send/></inSequence>" + "<outSequence><send/></outSequence></target><publishWSDL key=\"key\"></publishWSDL>" + "<policy key=\"key\"/><parameter name=\"para\">text</parameter></proxy>"; OMElement inputOM = createOMElement(inputXml); ProxyService proxy = ProxyServiceFactory.createProxy(inputOM, new Properties()); OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy); assertTrue(compare(resultOM, inputOM)); }
protected void serializeChildren(OMElement parent, List<Mediator> list) { for (Mediator child : list) { MediatorSerializer medSer = MediatorSerializerFinder.getInstance().getSerializer(child); if (medSer != null) { medSer.serializeMediator(parent, child); } else { handleException("Unable to find a serializer for mediator : " + child.getType()); } } } }
public void testProxyServiceSerializationSenarioOne() throws Exception { String inputXml = "<definitions></definitions>"; String outputXml = "<definitions><!--TestComment--></definitions>"; OMElement inputOM = createOMElement(inputXml); String testComment = "TestComment"; CommentSerializer.serializeComment(inputOM, testComment); OMElement outputOM = createOMElement(outputXml); assertTrue(compare(inputOM, outputOM)); } }
/** * Serialize all the properties to the given paren element. For each and every * property ther will be a seperate property element created inside the parent element. * * @param parent element to which property elements should be added * @param props <code>Collection</code> of propertis */ public static void serializeMediatorProperties(OMElement parent, Collection<MediatorProperty> props) { serializeMediatorProperties(parent, props, PROP_Q); }
public URLRewriteMediatorSerializationTest() { urlRewriteMediatorFactory = new URLRewriteMediatorFactory(); urlRewriteMediatorSerializer = new URLRewriteMediatorSerializer(); }
private void serializeEventSources(Collection<SynapseEventSource> eventSources, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { for (SynapseEventSource source : eventSources) { serializeEventSource(source, synapseConfig, parent); } }
public static synchronized ConfigurationFactoryAndSerializerFinder getInstance() { if (!initialized) { loadConfigurationFatoriesAndSerializers(); } return instance; }
/** * Serialize the property to the given paren element. There will be a element created with * the name property inside the parent element. * * @param parent element to which property elements should be added * @param mp a property to be serialized */ public static void serializeMediatorProperty(OMElement parent, MediatorProperty mp) { serializeMediatorProperty(parent, mp, PROP_Q); }
/** * Serialize all the parameters to the given parent element. For each and every * parameter there will be a separate parameter element created inside the parent element. * * @param parent element to which parameter elements should be added * @param params the list of TemplateParameter objects */ public static void serializeTemplateParameters(OMElement parent, Collection<TemplateParameter> params) { serializeTemplateParameters(parent, params, PARAMETER_Q); }
private void serializeExecutors(Collection<PriorityExecutor> executors, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { for (PriorityExecutor source : executors) { serializeExecutor(source, synapseConfig, parent); } }
public static synchronized MediatorFactoryFinder getInstance() { if (!initialized) { loadMediatorFactories(); } return instance; }
private void serializeMessageProcessors(Collection<MessageProcessor> messageProcessors, SynapseConfiguration synapseConfiguration , OMElement parent) throws Exception{ for (MessageProcessor messageProcessor : messageProcessors) { serializeMessageProcessor(messageProcessor, synapseConfiguration,parent); } }
public static synchronized StartupFinder getInstance() { if (!initialized) { loadStartups(); } return instance; }
private void serializeProxyServices(Collection<ProxyService> proxyServices, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { for (ProxyService service : proxyServices) { serializeProxy(service, synapseConfig, parent); } }
private void serializeLocalRegistryValues(Collection localValues, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { for (Object o : localValues) { serializeLocalEntry(o, synapseConfig, parent); } }
public void testProxyServiceSerializationScenarioSix() throws Exception { String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" startOnLoad=\"true\" " + "name=\"name\" transports=\"http\"><description>description</description><target>" + "<endpoint><address uri=\"http://www.example.com/testepr\"/></endpoint><outSequence><send/>" + "</outSequence></target><publishWSDL endpoint=\"wsdl_ep\"></publishWSDL><policy key=\"key\"/>" + "<parameter name=\"para\">text</parameter></proxy>"; OMElement inputOM = createOMElement(inputXml); ProxyService proxy = ProxyServiceFactory.createProxy(inputOM, new Properties()); OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy); assertTrue(compare(resultOM, inputOM)); } // public void testProxyServiceSerializationSenarioSix() throws Exception {
public void testProxyServiceSerializationSenarioOne() throws Exception { String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" name=\"name\" " + "startOnLoad=\"true\" transports=\"http\"><description>description</description>" + "<target inSequence=\"inseqname\" outSequence=\"outseqname\" faultSequence=\"faultseqname\" />" + "<publishWSDL uri=\"http://uri\" ></publishWSDL><policy key=\"key\"/>" + "<parameter name=\"para\">text</parameter></proxy>"; OMElement inputOM = createOMElement(inputXml); ProxyService proxy = ProxyServiceFactory.createProxy(inputOM, new Properties()); OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy); assertTrue(compare(resultOM, inputOM)); }