private SubscriptionMessageHandler doProxySubscribeOp ( int op , MESubscription subscription , SubscriptionMessageHandler messageHandler , Hashtable subscriptionsTable , boolean sendProxy ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "doProxySubscribeOp" , new Object [ ] { new Integer ( op ) , subscription , messageHandler , new Boolean ( sendProxy ) } ) ; // If we don't want to send proxy messages, set the operation to be // no operation. if ( ! sendProxy ) { // If we aren't to send the proxy and we have an unsubscribe, then we need // to remove the subscription from the list. if ( op == MESubscription . UNSUBSCRIBE ) subscriptionsTable . remove ( subscriptionKey ( subscription . getTopicSpaceUuid ( ) , subscription . getTopic ( ) ) ) ; op = MESubscription . NOP ; } // Perform an action depending on the required operation. switch ( op ) { // For new subscriptions or modified subscriptions, send a proxy subscription // message to all active neighbours. case MESubscription . SUBSCRIBE : if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Publishing new Subscription " + subscription + "," + sendProxy ) ; // Create the Proxy Message to be sent to all the Neighbours in this // Bus if ( messageHandler == null ) { messageHandler = iProxyHandler . getMessageHandler ( ) ; // Reset the message. messageHandler . resetCreateSubscriptionMessage ( subscription , isLocalBus ) ; } else { // Add the subscription to the message messageHandler . addSubscriptionToMessage ( subscription , isLocalBus ) ; } break ; case MESubscription . UNSUBSCRIBE : if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Publishing Delete subscription " + subscription + "," + sendProxy ) ; // Create the Proxy Message to be sent to all the Neighbours in this // Bus. messageHandler = iProxyHandler . getMessageHandler ( ) ; // Reset the message. messageHandler . resetDeleteSubscriptionMessage ( subscription , isLocalBus ) ; // Remove the subscription from the table. subscriptionsTable . remove ( subscriptionKey ( subscription . getTopicSpaceUuid ( ) , subscription . getTopic ( ) ) ) ; // Send the message to the Neighbours break ; // For other operations, do nothing. default : if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Doing nothing for subscription " + subscription + "," + sendProxy ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "doProxySubscribeOp" , messageHandler ) ; return messageHandler ; }
Performs a proxy subscription operation for the given subscription .