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;
}