boolean rejectSubscriptionFlag = reply.getHeaderFlag(SCMPHeaderAttributeKey.REJECT_SESSION);
if (rejectSubscriptionFlag == false) {
if (tempSubscription.isCascaded() == true) {
// update csc subscription id list for cascaded subscription
tempSubscription.addCscSubscriptionId(this.reqMessage.getSessionId(),
new SubscriptionMask(reqMessage.getHeader(SCMPHeaderAttributeKey.MASK)));
}
// subscription has not been rejected, add server to subscription
PublishMessageQueue<SCMPMessage> publishMessageQueue = ((IPublishService) this.tempSubscription.getService())
.getMessageQueue();
ReceivePublicationTimeout crpTimeout = new ReceivePublicationTimeout(publishMessageQueue, noDataIntervalMillis);
SubscriptionMask subscriptionMask = tempSubscription.getMask();
publishMessageQueue.subscribe(tempSubscription.getId(), subscriptionMask, crpTimeout);
// finally add subscription to the registry & schedule subscription timeout internal
this.subscriptionRegistry.addSubscription(tempSubscription.getId(), tempSubscription);
SubscriptionLogger.logSubscribe(serviceName, tempSubscription.getId(), subscriptionMask.getValue());
// forward local subscription no matter what server sends
reply.setSessionId(tempSubscription.getId());
} else {
// subscription has been rejected - remove subscription id from header
reply.removeHeader(SCMPHeaderAttributeKey.SESSION_ID);