public boolean filterMatches ( AbstractItem item ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "filterMatches" , item ) ; /* Cast the incoming item to a subscriptionState object. if it is not, an * exception will be thrown and the match will fail */ ConsumerDispatcherState subState = null ; if ( item instanceof DurableSubscriptionItemStream ) { try { subState = ( ( DurableSubscriptionItemStream ) item ) . getConsumerDispatcherState ( ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.store.filters.SubscriptionStateFilter.filterMatches" , "1:180:1.33.1.1" , this ) ; SibTr . exception ( tc , e ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "filterMatches" , e ) ; return false ; } /* If this filter is a subscriptionId filter, check for a match */ if ( _subscriptionId != null ) { boolean retval = ( subState . getSubscriberID ( ) . equals ( _subscriptionId ) ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "filterMatches" , Boolean . valueOf ( retval ) ) ; return retval ; } /* If this filter is a destination name filter, check for a match */ if ( _destination != null ) { boolean retval = ( subState . getTopicSpaceUuid ( ) . equals ( _destination ) ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "filterMatches" , Boolean . valueOf ( retval ) ) ; return retval ; } /* If this filter is for a specific consumer dispatcher state object, check for a match */ if ( _consumerDispatcherState != null ) { boolean retval = ( subState == _consumerDispatcherState ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "filterMatches" , Boolean . valueOf ( retval ) ) ; return retval ; } //The match succeeds if its a durable subscription and no specific matching is requested if ( ( _destination == null ) && ( _subscriptionId == null ) && ( _consumerDispatcherState == null ) ) { if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "filterMatches" , Boolean . TRUE ) ; return true ; } } /* If filter type has not been set, the match fails */ if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "filterMatches" , Boolean . FALSE ) ; return false ; }
Callback method from messagestore