@Override protected OMElement serializeEndpoint(Endpoint endpoint) { if (!(endpoint instanceof AddressEndpoint)) { handleException("Invalid endpoint type."); } fac = OMAbstractFactory.getOMFactory(); OMElement endpointElement = fac.createOMElement("endpoint", SynapseConstants.SYNAPSE_OMNAMESPACE); AddressEndpoint addressEndpoint = (AddressEndpoint) endpoint; EndpointDefinition epAddress = addressEndpoint.getDefinition(); OMElement addressElement = serializeEndpointDefinition(epAddress); endpointElement.addChild(addressElement); // serialize the properties serializeProperties(addressEndpoint, endpointElement); //serialize attributes serializeCommonAttributes(endpoint, endpointElement); return endpointElement; }
@Override protected OMElement serializeEndpoint(Endpoint endpoint) { if (!(endpoint instanceof AddressEndpoint)) { handleException("Invalid endpoint type."); } fac = OMAbstractFactory.getOMFactory(); OMElement endpointElement = fac.createOMElement("endpoint", SynapseConstants.SYNAPSE_OMNAMESPACE); AddressEndpoint addressEndpoint = (AddressEndpoint) endpoint; EndpointDefinition epAddress = addressEndpoint.getDefinition(); OMElement addressElement = serializeEndpointDefinition(epAddress); endpointElement.addChild(addressElement); // serialize the properties serializeProperties(addressEndpoint, endpointElement); //serialize attributes serializeCommonAttributes(endpoint, endpointElement); return endpointElement; }
@Override public OMElement serializeEndpointDefinition(EndpointDefinition endpointDefinition) { OMElement element = fac.createOMElement("address", SynapseConstants.SYNAPSE_OMNAMESPACE); if (endpointDefinition.getAddress() != null) { element.addAttribute( fac.createOMAttribute("uri", null, endpointDefinition.getAddress())); } else { handleException("Invalid Endpoint. Address is required"); } EndpointDefinitionSerializer serializer = new EndpointDefinitionSerializer(); serializer.serializeEndpointDefinition(endpointDefinition, element); serializeSpecificEndpointProperties(endpointDefinition, element); return element; } }
@Override public OMElement serializeEndpointDefinition(EndpointDefinition endpointDefinition) { OMElement element = fac.createOMElement("address", SynapseConstants.SYNAPSE_OMNAMESPACE); if (endpointDefinition.getAddress() != null) { element.addAttribute( fac.createOMAttribute("uri", null, endpointDefinition.getAddress())); } else { handleException("Invalid Endpoint. Address is required"); } EndpointDefinitionSerializer serializer = new EndpointDefinitionSerializer(); serializer.serializeEndpointDefinition(endpointDefinition, element); serializeSpecificEndpointProperties(endpointDefinition, element); return element; } }