Package org.apache.airavata.wsmg.broker.context

Examples of org.apache.airavata.wsmg.broker.context.ProcessingContext


    private static final Logger logger = LoggerFactory.getLogger(WSEProcessingContextBuilder.class);

    public ProcessingContext build(OMElement elem) {

        ProcessingContext processingContext = new ProcessingContext();

        if (elem != null && elem.getLocalName().equals("Subscribe")) {
            logger.debug("found subscribe element");
            onSubscription(processingContext, elem);
View Full Code Here


        return processingContext;
    }

    public ProcessingContext build(SOAPEnvelope elem) {

        ProcessingContext context = null;

        SOAPBody soapBody = elem.getBody();
        if (soapBody != null) {

            context = build(soapBody.getFirstElement());

        } else {
            context = build((OMElement) null);
        }

        context.setEnvelope(elem);
        extractInfoFromHeader(context, elem.getHeader());

        return context;
    }
View Full Code Here

        return context;
    }

    public ProcessingContext build(MessageContext msgContext, WsEventingOperations operation) {

        ProcessingContext processingContext = new ProcessingContext();

        switch (operation) {
        case SUBSCRIBE: {

            Iterator<OMElement> iterator = msgContext.getEnvelope().getBody()
                    .getChildrenWithName(new QName(NameSpaceConstants.WSE_NS.getNamespaceURI(), "Subscribe"));

            if (!iterator.hasNext()) {
                throw new RuntimeException("invalid subscription message - no subscribe element");
            }

            onSubscription(processingContext, iterator.next());
        }
            break;

        }

        processingContext.setMessageConext(msgContext);
        processingContext.setEnvelope(msgContext.getEnvelope());
        extractInfoFromHeader(processingContext, msgContext.getEnvelope().getHeader());
        String topicFromUrl = BrokerUtil.getTopicFromRequestPath(msgContext.getTo().getAddress());

        processingContext.setContextParameter(ContextParameters.TOPIC_FROM_URL, topicFromUrl);

        return processingContext;
    }
View Full Code Here

    WSEProcessingContextBuilder builder = new WSEProcessingContextBuilder();

    public MessageContext process(MessageContext inMsg, String operationName) throws AxisFault {

        WsEventingOperations msgType = WsEventingOperations.valueFrom(operationName);
        ProcessingContext processingContext = builder.build(inMsg, msgType);
        MessageContext outputMsg = null;

        log.debug("WS-Eventing: " + msgType);

        switch (msgType) {
View Full Code Here

    WSEProcessingContextBuilder builder = new WSEProcessingContextBuilder();

    @Override
    protected MessageContext process(MessageContext inMsgContext, String operationName) throws AxisFault {

        ProcessingContext processingContext = builder.build(inMsgContext, WsEventingOperations.PUBLISH);

        try {

            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsgContext
                    .getConfigurationContext().getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);
View Full Code Here

                    processingCtxBuilder = wseBuilder;
                }

                subscriptionId = subscriptionEntry.get(i).getSubscriptionId();

                ProcessingContext context = processingCtxBuilder.build(subscribeXmlElement);
                createSubscription(subscriptionId, context);

            } catch (XMLStreamException e) {
                log.error("error occured while checking subscription db", e);
            }
View Full Code Here

    private static final Logger logger = LoggerFactory.getLogger(WSNotificationProcessingContextBuilder.class);

    public ProcessingContext build(OMElement elem) {

        ProcessingContext processingContext = new ProcessingContext();

        if (elem == null
                || (!elem.getNamespace().getNamespaceURI().equals(NameSpaceConstants.WSNT_NS.getNamespaceURI()))) {

            logger.warn("invalid message payload recieved: " + elem);
View Full Code Here

        }

    }

    public ProcessingContext build(MessageContext msgContext, WsNotificationOperations operation) {
        ProcessingContext context = new ProcessingContext();

        SOAPEnvelope soapEnvelope = msgContext.getEnvelope();

        if (soapEnvelope == null) {
            throw new RuntimeException("invalid message context - envelope is not found");
        }

        SOAPBody soapBody = soapEnvelope.getBody();

        if (soapBody == null) {
            throw new RuntimeException("invalid message context - soap envelope is not found");
        }

        SOAPHeader soapHeader = soapEnvelope.getHeader();

        if (soapHeader == null) {
            throw new RuntimeException("invalid message context - soap header is not found");
        }

        switch (operation) {
        case SUBSCRIBE: {

            Iterator<OMElement> iterator = soapBody.getChildrenWithName(new QName(NameSpaceConstants.WSNT_NS
                    .getNamespaceURI(), "SubscribeRequest"));
            if (!iterator.hasNext()) {
                throw new RuntimeException("invalid message context - unable to find Subscribe information");
            }

            onSubscription(context, iterator.next());
        }
            break;
        }

        context.setEnvelope(soapEnvelope);
        extractInfoFromHeader(context, soapHeader);
        context.setMessageConext(msgContext);
        String topicFromUrl = BrokerUtil.getTopicFromRequestPath(msgContext.getTo().getAddress());
        context.setContextParameter(ContextParameters.TOPIC_FROM_URL, topicFromUrl);

        return context;
    }
View Full Code Here

    public MessageContext process(MessageContext inMsg, String operationName) throws AxisFault {

        WsNotificationOperations msgType = WsNotificationOperations.valueFrom(operationName);

        ProcessingContext processingContext = builder.build(inMsg, msgType);

        MessageContext outputMsg = null;

        switch (msgType) {
        case NOTIFY: {
View Full Code Here

TOP

Related Classes of org.apache.airavata.wsmg.broker.context.ProcessingContext

Copyright © 2018 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.