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;
}
Aggregations