public final class SampleQuerySubscriptions extends Object
EventingFactory
to
create an EventingService
object. The consumer then creates a
SubscriptionSelectionFilter
object and sets filter attributes for the
"Call" family and the "CALL_ANSWERED" event type. The
querySubscriptions method is then called to query the Eventing
Framework for matching subscriptions.
package com.mycompany; import com.avaya.collaboration.eventing.EventFilter; import com.avaya.collaboration.eventing.EventSubscription; import com.avaya.collaboration.eventing.EventSubscriptionAttributes; import com.avaya.collaboration.eventing.EventingFactory; import com.avaya.collaboration.eventing.EventingService; import com.avaya.collaboration.eventing.SubscriptionSelectionFilter; import com.avaya.collaboration.eventing.families.EventFamilyCall; import com.avaya.collaboration.eventing.families.EventFamilySystem; final EventingService eventingService = EventingFactory.createEventingService(); final SubscriptionSelectionFilter filter = EventingFactory.createSubscriptionSelectionFilter(); filter.setFamily(EventFamilyCall.FAMILY_NAME); filter.setFamily(EventFamilyCall.EVENT_CALL_ANSWERED); final SetThe second sample below is very much like the first example. The only difference is that the filter attributes for consumer name and version are set rather than the family and event type attributes. Note that the consumer name and version attributes are the "on behalf of" consumer name and version. See the package level Javadoc for thesubscriptionSet = eventingService.querySubscriptions(filter);
com.avaya.collaboration.eventing
package for details about
"on behalf of" functionality.
package com.mycompany; import com.avaya.collaboration.eventing.EventFilter; import com.avaya.collaboration.eventing.EventSubscription; import com.avaya.collaboration.eventing.EventSubscriptionAttributes; import com.avaya.collaboration.eventing.EventingFactory; import com.avaya.collaboration.eventing.EventingService; import com.avaya.collaboration.eventing.SubscriptionSelectionFilter; import com.avaya.collaboration.eventing.families.EventFamilyCall; import com.avaya.collaboration.eventing.families.EventFamilySystem; final EventingService eventingService = EventingFactory.createEventingService(); final SubscriptionSelectionFilter filter = EventingFactory.createSubscriptionSelectionFilter(); filter.setConsumerName("MyConsumer"); filter.setConsumerVersion("1.0.0.0.0"); final SetsubscriptionSet = eventingService.querySubscriptions(filter);
Copyright © 2016 Avaya. All Rights Reserved.