Package org.apache.airavata.wsmg.util

Examples of org.apache.airavata.wsmg.util.WsEventingOperations


    private static final Logger log = LoggerFactory.getLogger(WSEventingMsgReceiver.class);
    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) {
        case SUBSCRIBE: {
            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg.getConfigurationContext()
                    .getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);

            brokerConfigContext.getSubscriptionManager().subscribe(processingContext);
            outputMsg = createOutputMessageContext(inMsg, processingContext);
            break;
        }
        case UNSUBSCRIBE: {
            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg.getConfigurationContext()
                    .getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);

            brokerConfigContext.getSubscriptionManager().unsubscribe(processingContext);
            outputMsg = createOutputMessageContext(inMsg, processingContext);
            break;
        }
        case RENEW:
        case GET_STATUS:
        case SUBSCRIPTION_END:
        default:
            throw new AxisFault("unsupported operation" + msgType.toString());

        }
        return outputMsg;
    }
View Full Code Here

TOP

Related Classes of org.apache.airavata.wsmg.util.WsEventingOperations

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.