switch (message.getType()) {
case CALL:
handleCallMessage((CallMessage) message);
break;
case PUBLISH:
PublishMessage publishMessage = (PublishMessage) message;
handlePubSubMessage(publishMessage, publishMessage.getEvent(), publishMessage.getTopicURI(), publishMethods);
break;
case SUBSCRIBE:
SubscribeMessage subscribeMessage = (SubscribeMessage) message;
handlePubSubMessage(subscribeMessage, null, subscribeMessage.getTopicURI(), subscribeMethods);
break;