return;
default:
// code for other types of services is below
break;
}
StatefulServer server = (StatefulServer) cascSubscription.getServer();
PublishMessageQueue<SCMPMessage> publishMessageQueue = ((IPublishService) cascSubscription.getService()).getMessageQueue();
if (cascadedSCMask == null) {
// subscription abort made by cascaded SC on behalf of his last client
this.subscriptionRegistry.removeSubscription(cascSubscription.getId());
publishMessageQueue.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);
publishMessageQueue.changeSubscription(cascSubscription.getId(), cascSCMask);
cascSubscription.setMask(cascSCMask);
SubscriptionLogger.logChangeSubscribe(serviceName, cascSubscription.getId(), cascadedSCMask);
}
// set up abort message
SCMPMessage abortMessage = new SCMPMessage();
abortMessage.setHeader(SCMPHeaderAttributeKey.SC_ERROR_CODE, SCMPError.SESSION_ABORT.getErrorCode());
abortMessage.setHeader(SCMPHeaderAttributeKey.SC_ERROR_TEXT,
SCMPError.SESSION_ABORT.getErrorText("Cascaded subscription abort received."));
abortMessage.setServiceName(serviceName);
abortMessage.setSessionId(reqMessage.getSessionId());
abortMessage.setHeader(SCMPHeaderAttributeKey.OPERATION_TIMEOUT, oti);
server.abortSessionAndWaitMech(oti, abortMessage, "Cascaded subscription abort received", true);
// reply to client
reqMessage.setIsReply(true);
response.setSCMP(reqMessage);
responderCallback.responseCallback(request, response);
// delete unreferenced nodes in queue