switch (abstractService.getType()) {
case CASCADED_PUBLISH_SERVICE:
case CASCADED_CACHE_GUARDIAN:
CascadedPublishService cascadedPublishService = (CascadedPublishService) abstractService;
// publish service is cascaded
CascadedSC cascadedSC = cascadedPublishService.getCascadedSC();
PublishMessageQueue<SCMPMessage> queue = ((IPublishService) cascSubscription.getService()).getMessageQueue();
if (cascadedSCMask == null) {
// subscription abort made by cascaded SC on behalf of his last client
this.subscriptionRegistry.removeSubscription(cascSubscription.getId());
queue.unsubscribe(cascSubscription.getId());
cascSubscription.getServer().removeSession(cascSubscription);
SubscriptionLogger.logUnsubscribe(serviceName, cascSubscription.getId());
} else {
// unsubscribe made by cascaded SC on behalf of a clients, others are left
SubscriptionMask cascSCMask = new SubscriptionMask(cascadedSCMask);
queue.changeSubscription(cascSubscription.getId(), cascSCMask);
cascSubscription.setMask(cascSCMask);
SubscriptionLogger.logChangeSubscribe(serviceName, cascSubscription.getId(), cascadedSCMask);
}
CscAbortSubscriptionCommandCallback callback = new CscAbortSubscriptionCommandCallback(request, response,
responderCallback, cascSubscription);
cascadedSC.cascadedSCAbortSubscription(cascadedPublishService.getCascClient(), reqMessage, callback, oti);
return;
default:
// code for other types of services is below
break;
}