Search in sources :

Example 1 with HeaderParam

use of org.jaffa.soa.services.event.HeaderParam in project jaffa-framework by jaffa-projects.

the class EventMessageService method getEventMessage.

/**
 * This method will map the SOAEventQueueMessage to EventMessage.
 *
 * @param SOAEventQueueMessage
 * @return EventMessage
 */
public static EventMessage getEventMessage(SOAEventQueueMessage eventQueueMessage) {
    if (log.isDebugEnabled()) {
        log.debug("Converting SOAEventQueueMessage to EventMessage");
    }
    EventMessage eventMessage = new EventMessage();
    eventMessage.setEventId(eventQueueMessage.getEventId());
    eventMessage.setEventName(eventQueueMessage.getEventName());
    eventMessage.setDescription(eventQueueMessage.getDescription());
    eventMessage.setCategory(eventQueueMessage.getCategory());
    eventMessage.setCreatedBy(eventQueueMessage.getCreatedBy());
    eventMessage.setCreatedOn(XMLDateConverter.getCalendarFromDate(eventQueueMessage.getCreatedOn() != null ? eventQueueMessage.getCreatedOn().getUtilDate() : new DateTime().getUtilDate()));
    org.jaffa.modules.messaging.services.HeaderParam[] headerParams = eventQueueMessage.getHeaderParams();
    if (headerParams != null) {
        for (org.jaffa.modules.messaging.services.HeaderParam headerParam : headerParams) {
            HeaderParam eventHeaderParams = new HeaderParam();
            eventHeaderParams.setName(headerParam.getName());
            eventHeaderParams.setValue(headerParam.getValue());
            eventMessage.getHeaderParams().add(eventHeaderParams);
        }
    }
    if (log.isDebugEnabled()) {
        log.debug("Successfully converted SOAEventQueueMessage to EventMessage");
    }
    return eventMessage;
}
Also used : HeaderParam(org.jaffa.soa.services.event.HeaderParam) EventMessage(org.jaffa.soa.services.event.EventMessage) DateTime(org.jaffa.datatypes.DateTime)

Aggregations

DateTime (org.jaffa.datatypes.DateTime)1 EventMessage (org.jaffa.soa.services.event.EventMessage)1 HeaderParam (org.jaffa.soa.services.event.HeaderParam)1