* the reason {@inheritDoc}
*/
@Override
public void abortSession(AbstractSession session, String reason) {
if (session instanceof Subscription) {
Subscription subscription = (Subscription) session;
CascadedPublishService casService = (CascadedPublishService) subscription.getService();
PublishMessageQueue<SCMPMessage> publishMessageQueue = casService.getMessageQueue();
// unsubscribe subscription
publishMessageQueue.unsubscribe(subscription.getId());
publishMessageQueue.removeNonreferencedNodes();
CascadedClient cascClient = casService.getCascClient();
// remove timed out subscription id from client subscription list
cascClient.removeClientSubscriptionId(subscription.getId());
if (cascClient.isDestroyed() == true) {
// cascaded client got destroyed - do not continue
return;
}
long msgSeqNr = cascClient.getMsgSequenceNr().incrementAndGetMsgSequenceNr();
IRequest request = new NettyHttpRequest(null, null, null);
SCMPMessage abortMessage = new SCMPMessage();
abortMessage.setHeader(SCMPHeaderAttributeKey.MESSAGE_SEQUENCE_NR, msgSeqNr);
abortMessage.setHeader(SCMPHeaderAttributeKey.SERVICE_NAME, casService.getName());
// cascaded id will be set in following (cascadedSCAbortSubscription) method
request.setMessage(abortMessage);
if (subscription.isCascaded() == true) {
// XAB procedure for casc subscriptions
Set<String> subscriptionIds = subscription.getCscSubscriptionIds().keySet();
for (String id : subscriptionIds) {
abortMessage.setSessionId(id);
this.cascadedSCAbortSubscription(cascClient, abortMessage, new CscAbortSubscriptionCallbackForCasc(request,
subscription), AppContext.getBasicConfiguration().getSrvAbortOTIMillis());
}
subscription.getCscSubscriptionIds().clear();
} else {
// normal XAB procedure
abortMessage.setSessionId(subscription.getId());
SubscriptionLogger.logAbortSubscription((Subscription) session, reason);
this.cascadedSCAbortSubscription(cascClient, abortMessage, new CscAbortSubscriptionCallbackForCasc(request,
subscription), AppContext.getBasicConfiguration().getSrvAbortOTIMillis());
}
} else {