public void run(IRequest request, IResponse response, IResponderCallback responderCallback) throws Exception {
SCMPMessage reqMessage = request.getMessage();
String serviceName = reqMessage.getServiceName();
// check service is present and enabled
Service abstractService = this.getService(serviceName);
if (abstractService.isEnabled() == false) {
SCMPCommandException scmpCommandException = new SCMPCommandException(SCMPError.SERVICE_DISABLED, "service="
+ abstractService.getName() + " is disabled");
scmpCommandException.setMessageType(getKey());
throw scmpCommandException;
}
// enhance ipAddressList
String ipAddressList = reqMessage.getHeader(SCMPHeaderAttributeKey.IP_ADDRESS_LIST);
ipAddressList = ipAddressList + Constants.SLASH + request.getRemoteSocketAddress().getAddress().getHostAddress();
reqMessage.setHeader(SCMPHeaderAttributeKey.IP_ADDRESS_LIST, ipAddressList);
int oti = reqMessage.getHeaderInt(SCMPHeaderAttributeKey.OPERATION_TIMEOUT);
// create temporary Subscription for cascaded SC
String sessionInfo = reqMessage.getHeader(SCMPHeaderAttributeKey.SESSION_INFO);
int noiSecs = reqMessage.getHeaderInt(SCMPHeaderAttributeKey.NO_DATA_INTERVAL);
int noiInMillis = noiSecs * Constants.SEC_TO_MILLISEC_FACTOR;
String cscSCMaskString = reqMessage.getHeader(SCMPHeaderAttributeKey.CASCADED_MASK);
String cascSubscriptionId = reqMessage.getHeader(SCMPHeaderAttributeKey.CASCADED_SUBSCRIPTION_ID);
Subscription cscSubscription = this.subscriptionRegistry.getSubscription(cascSubscriptionId);
SubscriptionMask cscMask = new SubscriptionMask(cscSCMaskString);
Subscription tmpCascSCSubscription = new Subscription(cscMask, sessionInfo, ipAddressList, noiInMillis, AppContext
.getBasicConfiguration().getSubscriptionTimeoutMillis(), true);
tmpCascSCSubscription.setService(abstractService);
switch (abstractService.getType()) {
case CASCADED_PUBLISH_SERVICE:
case CASCADED_CACHE_GUARDIAN:
// publish service is cascaded
CascadedPublishService cascadedPublishService = (CascadedPublishService) abstractService;
CascadedSC cascadedSC = cascadedPublishService.getCascadedSC();