use of org.jaffa.datatypes.DateTime in project jaffa-framework by jaffa-projects.
the class BusinessEventLogGraph method setLoggedOn.
/**
* Set the value of loggedOn
*
* @param loggedOn new value of loggedOn
*/
public void setLoggedOn(DateTime loggedOn) {
DateTime oldLoggedOn = this.loggedOn;
this.loggedOn = loggedOn;
propertyChangeSupport.firePropertyChange("loggedOn", oldLoggedOn, loggedOn);
}
use of org.jaffa.datatypes.DateTime 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;
}
use of org.jaffa.datatypes.DateTime in project jaffa-framework by jaffa-projects.
the class TransactionGraph method setLastChangedOn.
/**
* Setter for property lastChangedOn.
*
* @param lastChangedOn Value of property lastChangedOn.
*/
public void setLastChangedOn(DateTime lastChangedOn) {
DateTime oldLastChangedOn = this.lastChangedOn;
this.lastChangedOn = lastChangedOn;
propertyChangeSupport.firePropertyChange("lastChangedOn", oldLastChangedOn, lastChangedOn);
}
use of org.jaffa.datatypes.DateTime in project jaffa-framework by jaffa-projects.
the class JaffaTransactionMessageService method getLastErrorTimeByType.
/**
* Gets the timestamp that a Transaction of the specified type was most recently put into the error state
*
* @param type the type of Transaction
* @return the timestamp that a Transaction of the specified type was most recently put into the error state
* @throws FrameworkException
*/
@Override
public DateTime getLastErrorTimeByType(String type) throws FrameworkException {
UOW uow = null;
DateTime result = null;
try {
uow = new UOW();
Criteria criteria = new Criteria();
criteria.setTable(TransactionMeta.getName());
criteria.addFunction(Criteria.FUNCTION_MAX, TransactionMeta.LAST_CHANGED_ON, TransactionMeta.LAST_CHANGED_ON);
criteria.addCriteria(TransactionMeta.TYPE, type);
criteria.addCriteria(TransactionMeta.STATUS, Transaction.Status.E.toString());
for (Object queryResult : uow.query(criteria)) {
if (!(queryResult instanceof Map)) {
continue;
}
Map row = (Map) queryResult;
result = (DateTime) row.get(TransactionMeta.LAST_CHANGED_ON);
break;
}
} finally {
if (uow != null) {
uow.close();
}
}
return result;
}
Aggregations