public final class SampleEventProducer extends Object
EventingFactoryis first called to create an
EventMetaDataobject. This object is filled with any desired data that is relevant to the event being published. Then, the event body is constructed and an arbitrary event version is specified. Finally an
EventProducerobject is created with an event family name and event family type. The publish method on the producer object causes the event to be delivered to any consumers that have subscribed to receive the event.
package com.mycompany; import com.avaya.collaboration.eventing.EventMetaData; import com.avaya.collaboration.eventing.EventProducer; import com.avaya.collaboration.eventing.EventingFactory; import com.avaya.collaboration.eventing.families.EventFamilyCall; final EventMetaData filterData = EventingFactory.createEventMetaData(); filterData.addValue(EventFamilyCall.FILTER_UCID, "someCallId"); filterData.getValueMap().put(EventFamilyCall.FILTER_UCID, "someUcid"); // alternative filterData.setCorrelationId("someCorrelationId"); filterData.setUser("+firstname.lastname@example.org"); final String eventBody = "this is some payload"; final String eventVersion = "220.127.116.11"; final EventProducer publisher = EventingFactory.createEventProducer(EventFamilyCall.FAMILY_NAME, EventFamilyCall.EVENT_CALL_OFFERED_FROM_CALLING_PARTY, filterData, eventBody, eventVersion); publisher.publish();
Copyright © 2014 Avaya. All Rights Reserved.