Search in sources :

Example 6 with StructuredEvent

use of org.omg.CosNotification.StructuredEvent in project ACS by ACS-Community.

the class StructuredEventCreator method createEvent.

public StructuredEvent createEvent(IDLEntity customStruct) throws AcsJException {
    // The Java class name without package becomes the name of the "event type".
    String typeName = customStruct.getClass().getName().substring(customStruct.getClass().getName().lastIndexOf('.') + 1);
    // event to send
    StructuredEvent event = getCORBAEvent(typeName, "");
    // Store the info for Exec/I&T into the event.
    // create the any
    event.remainder_of_body = m_services.getAdvancedContainerServices().getAny();
    // get the useful data which includes the component's name, timestamp, and event count (=1 here)
    EventDescription descrip = new EventDescription(m_services.getName(), alma.acs.util.UTCUtility.utcJavaToOmg(System.currentTimeMillis()), 1);
    // store the IDL struct into the structured event
    EventDescriptionHelper.insert(event.remainder_of_body, descrip);
    // preallocate one name/value pair
    event.filterable_data = new Property[1];
    event.filterable_data[0] = new Property(alma.acscommon.DEFAULTDATANAME.value, m_anyAide.complexObjectToCorbaAny(customStruct));
    return event;
}
Also used : StructuredEvent(org.omg.CosNotification.StructuredEvent) EventDescription(alma.acsnc.EventDescription) Property(org.omg.CosNotification.Property)

Aggregations

StructuredEvent (org.omg.CosNotification.StructuredEvent)6 Property (org.omg.CosNotification.Property)5 EventDescription (alma.acsnc.EventDescription)3 AcsJException (alma.acs.exceptions.AcsJException)2 EventHeader (org.omg.CosNotification.EventHeader)2 EventType (org.omg.CosNotification.EventType)2 FixedEventHeader (org.omg.CosNotification.FixedEventHeader)2 AcsJCORBAProblemEx (alma.ACSErrTypeCommon.wrappers.AcsJCORBAProblemEx)1 AcsLogLevel (alma.acs.logging.AcsLogLevel)1 StopWatch (alma.acs.util.StopWatch)1 AcsJPublishEventFailureEx (alma.acsncErrType.wrappers.AcsJPublishEventFailureEx)1 Level (java.util.logging.Level)1 Any (org.omg.CORBA.Any)1 NO_IMPLEMENT (org.omg.CORBA.NO_IMPLEMENT)1 TIMEOUT (org.omg.CORBA.TIMEOUT)1 IDLEntity (org.omg.CORBA.portable.IDLEntity)1 InvalidEventType (org.omg.CosNotifyComm.InvalidEventType)1 TDEM_TOPICS.actuatorSpace (tdem.TDEM_TOPICS.actuatorSpace)1 TDEM_TOPICS.pttDataEvent (tdem.TDEM_TOPICS.pttDataEvent)1