Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMElement


     */
    private Endpoint createEndpointWithName(OMElement epConfig, boolean anonymousEndpoint,
                                            Properties properties) {
       
        Endpoint ep = createEndpoint(epConfig, anonymousEndpoint, properties);
        OMElement descriptionElem = epConfig.getFirstChildWithName(DESCRIPTION_Q);
        if (descriptionElem != null) {
            ep.setDescription(descriptionElem.getText());
        }

        // if the endpoint doesn't have a name we will generate a unique name.
        if (anonymousEndpoint && ep.getName() == null) {
            String uuid = UIDGenerator.generateUID();
View Full Code Here


        if (configElement.getAttribute(new QName("template")) != null) {
            return new TemplateEndpointFactory();
        }

        OMElement addressElement = configElement.getFirstChildWithName(
                new QName(SynapseConstants.SYNAPSE_NAMESPACE, "address"));
        if (addressElement != null) {
            return AddressEndpointFactory.getInstance();
        }

        OMElement wsdlElement = configElement.getFirstChildWithName(
                new QName(SynapseConstants.SYNAPSE_NAMESPACE, "wsdl"));
        if (wsdlElement != null) {
            return WSDLEndpointFactory.getInstance();
        }

        OMElement defaultElement = configElement.getFirstChildWithName(
                new QName(SynapseConstants.SYNAPSE_NAMESPACE, "default"));
        if (defaultElement != null) {
            return DefaultEndpointFactory.getInstance();
        }

        OMElement lbElement = configElement.getFirstChildWithName
                (new QName(SynapseConstants.SYNAPSE_NAMESPACE, "loadbalance"));
        if (lbElement != null) {
            OMElement sessionElement = configElement.
                    getFirstChildWithName(new QName(SynapseConstants.SYNAPSE_NAMESPACE, "session"));
            if (sessionElement != null) {
                return SALoadbalanceEndpointFactory.getInstance();
            } else {
                return LoadbalanceEndpointFactory.getInstance();
            }
        }

        OMElement dlbElement = configElement.getFirstChildWithName
                (new QName(SynapseConstants.SYNAPSE_NAMESPACE, "dynamicLoadbalance"));
        if (dlbElement != null) {
            //TODO: Handle Session affinity & failover
            return DynamicLoadbalanceEndpointFactory.getInstance();
        }

        OMElement foElement = configElement.getFirstChildWithName
                (new QName(SynapseConstants.SYNAPSE_NAMESPACE, "failover"));
        if (foElement != null) {
            return FailoverEndpointFactory.getInstance();
        }
View Full Code Here

        ArrayList<Endpoint> endpoints = new ArrayList<Endpoint>();
        ArrayList<String> keys = new ArrayList<String>();
        Iterator iter = listEndpointElement.getChildrenWithName(XMLConfigConstants.ENDPOINT_ELT);
        while (iter.hasNext()) {
            OMElement endptElem = (OMElement) iter.next();
            Endpoint endpoint = EndpointFactory.getEndpointFromElement(endptElem, true, properties);
            if (endpoint instanceof IndirectEndpoint) {
                String key = ((IndirectEndpoint) endpoint).getKey();
                if (!keys.contains(key)) {
                    keys.add(key);
View Full Code Here

        }

        FailoverEndpoint failoverEndpoint = (FailoverEndpoint) endpoint;

        fac = OMAbstractFactory.getOMFactory();
        OMElement endpointElement
                = fac.createOMElement("endpoint", SynapseConstants.SYNAPSE_OMNAMESPACE);

        // serialize the parameters
        serializeProperties(failoverEndpoint, endpointElement);

        OMElement failoverElement
                = fac.createOMElement("failover", SynapseConstants.SYNAPSE_OMNAMESPACE);
        endpointElement.addChild(failoverElement);

        serializeCommonAttributes(endpoint,endpointElement);

        for (Endpoint childEndpoint : failoverEndpoint.getChildren()) {
            failoverElement.addChild(EndpointSerializer.getElementFromEndpoint(childEndpoint));
        }

        if (!failoverEndpoint.isDynamic()) {
            failoverElement.addAttribute("dynamic", "false", null);
        }

        return endpointElement;
    }
View Full Code Here

                OMDocument omDoc = OMAbstractFactory.getSOAP11Factory().createOMDocument();
                omDoc.addChild(envelope);
               
                SOAPBody body = envelope.getBody();
                OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXOMBuilder(parser);
                OMElement bodyElement = builder.getDocumentElement();
                if (addTextAroundBody) {
                    OMFactory fac = OMAbstractFactory.getOMFactory();
                    body.addChild(fac.createOMText("\n"));
                    body.addChild(bodyElement);
                    body.addChild(fac.createOMText("\n"));
View Full Code Here

    protected static SVGImpl generateSVGImpl(java.io.InputStream is) throws java.io.IOException {
      byte[] b=new byte[is.available()];
      is.read(b);
   
      BPELInterface bpel = new BPELImpl();
        OMElement bpelStr = bpel.load(new String(b));
       
        bpel.processBpelString(bpelStr);

        LayoutManager layoutManager = BPEL2SVGFactory.getInstance().getLayoutManager();
        layoutManager.setVerticalLayout(true);
View Full Code Here

    public void processBpelString(OMElement om) {

        if (om != null) {

            OMElement startElement = bpelElement.getFirstChildWithName(new QName("http://docs.oasis-open.org/wsbpel/2.0/process/executable", BPEL2SVGFactory.SEQUENCE_START_TAG)); // namesapce should be changed, exceptions should be handled.
            if (startElement != null) {
                processActivity = new ProcessImpl(bpelElement);
                processActivity.setLinkProperties(links, sources,targets);
                processActivity.processSubActivities(bpelElement);
            }else{
View Full Code Here

    private String getUserAgent(MessageContext messageContext) {
        String userAgentString = "Axis2";
        boolean locked = false;
        if (messageContext.getParameter(HTTPConstants.USER_AGENT) != null) {
            OMElement userAgentElement =
                    messageContext.getParameter(HTTPConstants.USER_AGENT).getParameterElement();
            userAgentString = userAgentElement.getText().trim();
            OMAttribute lockedAttribute = userAgentElement.getAttribute(new QName("locked"));
            if (lockedAttribute != null) {
                if (lockedAttribute.getAttributeValue().equalsIgnoreCase("true")) {
                    locked = true;
                }
            }
View Full Code Here

        atbRequestCheckEligibility.setNameAsOnCard("cardname");
        atbRequestCheckEligibility.setYearOfRedemption(2);


        try {
            OMElement omElement = echCheckEligibility1.getOMElement(CheckEligibility1.MY_QNAME, OMAbstractFactory.getSOAP12Factory());
            String omElementString = omElement.toStringWithConsume();
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            CheckEligibility1 result = CheckEligibility1.Factory.parse(xmlReader);
            assertEquals(result.getAtbRequestCheckEligibility().getCardNumber(), "carnumber");
            assertEquals(result.getAtbRequestCheckEligibility().getClientId(), "clientid");
            assertEquals(result.getAtbRequestCheckEligibility().getExpirationDate(), "date");
View Full Code Here

        atbRequestCheckEligibility[1].setNameAsOnCard("cardname");
        atbRequestCheckEligibility[1].setYearOfRedemption(2);


        try {
            OMElement omElement = echCheckEligibility2.getOMElement(CheckEligibility2.MY_QNAME, OMAbstractFactory.getSOAP12Factory());
            String omElementString = omElement.toStringWithConsume();
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            CheckEligibility2 result = CheckEligibility2.Factory.parse(xmlReader);
            assertEquals(result.getAtbRequestCheckEligibility()[0].getCardNumber(), "carnumber");
            assertEquals(result.getAtbRequestCheckEligibility()[0].getClientId(), "clientid");
            assertEquals(result.getAtbRequestCheckEligibility()[0].getExpirationDate(), "date");
View Full Code Here

TOP

Related Classes of org.apache.axiom.om.OMElement

Copyright © 2015 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.