public static OMElement serializeInboundEndpoint(OMElement parent, InboundEndpoint inboundEndpoint) { OMElement inboundEndpointElt = serializeInboundEndpoint(inboundEndpoint); if (parent != null) { parent.addChild(inboundEndpointElt); } return inboundEndpointElt; }
public void testSerializeInboundEP() throws Exception { ep = factory.createInboundEndpoint(AXIOMUtil.stringToOM(sampleEP2), config); OMElement elm = serializer.serializeInboundEndpoint(ep); Assert.assertNotNull("Serialized endpoint is null", elm); Assert.assertEquals("Invalid EP name for serialized inbound endpoint", "HttpListenerEP2", ep.getName()); }
public static InboundEndpoint defineInboundEndpoint(SynapseConfiguration config, OMElement elem, Properties properties) { InboundEndpoint inboundEndpoint = null; try { inboundEndpoint = InboundEndpointFactory.createInboundEndpoint(elem, config); config.addInboundEndpoint(inboundEndpoint.getName(), inboundEndpoint); } catch (Exception e) { String msg = "Inbound Endpoint configuration cannot be built"; handleConfigurationError(SynapseConstants.FAIL_SAFE_MODE_INBOUND_ENDPOINT, msg, e); } return inboundEndpoint; }
public void testCreateInvalidInboundEP() throws Exception { InboundEndpointFactory factory = new InboundEndpointFactory(); try { ep = factory.createInboundEndpoint(AXIOMUtil.stringToOM(invalidSampleEP), config); Assert.fail("Expected exception is not thrown for invalid inbound EP"); } catch (SynapseException e) { Assert.assertEquals(e.getMessage().contains("Inbound Endpoint name cannot be null"), true); } } }
parameter.addAttribute(InboundEndpointConstants.INBOUND_ENDPOINT_PARAMETER_KEY, inboundEndpoint.getParameterKey(strKey), null); }else if (isWellFormedXML(paramEntry.getValue())) { try { OMElement omElement = AXIOMUtil.stringToOM(paramEntry.getValue());
public void testSerializeInboundEPWithParent() throws Exception { ep = factory.createInboundEndpoint(AXIOMUtil.stringToOM(sampleEP3), config); OMElement elm2 = serializer.serializeInboundEndpoint(AXIOMUtil.stringToOM(parentElm), ep); Assert.assertNotNull("Serialized endpoint with parent is null", elm2); Assert.assertEquals("Invalid EP name for serialized inbound endpoint", "HttpListenerEP3", ep.getName()); }
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 void testCreateValidInboundEP() throws Exception { ep = factory.createInboundEndpoint(AXIOMUtil.stringToOM(sampleEP), config); Assert.assertNotNull("Inbound Endpoint is null", ep); Assert.assertEquals("Invalid EP name for inbound endpoint", "HttpListenerEP1", ep.getName()); }
@Override public void restoreSynapseArtifact(String artifactName) { if (log.isDebugEnabled()) { log.debug("Restoring the Inbound Endpoint with name : " + artifactName + " : Started"); } try { InboundEndpoint inboundEndpoint = getSynapseConfiguration().getInboundEndpoint(artifactName); CustomLogSetter.getInstance().setLogAppender((inboundEndpoint != null) ? inboundEndpoint.getArtifactContainerName() : ""); OMElement inboundEndpointElement = InboundEndpointSerializer.serializeInboundEndpoint(inboundEndpoint); if (inboundEndpoint.getFileName() != null) { String fileName = getServerConfigurationInformation().getSynapseXMLLocation() + File.separator + MultiXMLConfigurationBuilder.INBOUND_ENDPOINT_DIR + File.separator + inboundEndpoint.getFileName(); writeToFile(inboundEndpointElement, fileName); if (log.isDebugEnabled()) { log.debug("Restoring the Inbound Endpoint with name : " + artifactName + " : Completed"); } log.info("Inbound Endpoint named '" + artifactName + "' has been restored"); } else { handleSynapseArtifactDeploymentError("Couldn't restore the Inbound Endpoint named '" + artifactName + "', filename cannot be found"); } } catch (Exception e) { handleSynapseArtifactDeploymentError( "Restoring of the Inbound Endpoint named '" + artifactName + "' has failed", e); } } }
public void testCreateInboundEPWithEmptyName() throws Exception { ep = factory.createInboundEndpoint(AXIOMUtil.stringToOM(sampleEP4), config); Assert.assertNotNull("Serialized endpoint with empty name is null", ep); Assert.assertEquals(ep.getName().isEmpty(), true); }
Collection<InboundEndpoint> inboundEndpoints = synCfg.getInboundEndpoints(); for (InboundEndpoint inboundEndpoint : inboundEndpoints) { InboundEndpointSerializer.serializeInboundEndpoint(definitions, inboundEndpoint);
InboundEndpoint inboundEndpoint = InboundEndpointFactory.createInboundEndpoint(artifactConfig, getSynapseConfiguration()); if (inboundEndpoint != null) { inboundEndpoint.setArtifactContainerName(customLogContent);
InboundEndpointSerializer.serializeInboundEndpoint(definitions,inboundEndpoint);
InboundEndpoint inboundEndpoint = InboundEndpointFactory.createInboundEndpoint(artifactConfig, getSynapseConfiguration());