public void subscriptionRequestReceived ( SubscriptionRequest sr ) throws SubscriptionException { LOG . info ( "Subscriber -> (Hub), new subscription request received." , sr . getCallback ( ) ) ; try { verifySubscriberRequestedSubscription ( sr ) ; if ( "subscribe" . equals ( sr . getMode ( ) ) ) { LOG . info ( "Adding callback {} to the topic {}" , sr . getCallback ( ) , sr . getTopic ( ) ) ; addCallbackToTopic ( sr . getCallback ( ) , sr . getTopic ( ) ) ; } else if ( "unsubscribe" . equals ( sr . getMode ( ) ) ) { LOG . info ( "Removing callback {} from the topic {}" , sr . getCallback ( ) , sr . getTopic ( ) ) ; removeCallbackToTopic ( sr . getCallback ( ) , sr . getTopic ( ) ) ; } } catch ( Exception e ) { throw new SubscriptionException ( e ) ; } }
Input method called by a Subscriber indicating its intent into receive notification about a given topic .