Search in sources :

Example 71 with DateTime

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);
}
Also used : DateTime(org.jaffa.datatypes.DateTime)

Example 72 with DateTime

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;
}
Also used : HeaderParam(org.jaffa.soa.services.event.HeaderParam) EventMessage(org.jaffa.soa.services.event.EventMessage) DateTime(org.jaffa.datatypes.DateTime)

Example 73 with DateTime

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);
}
Also used : DateTime(org.jaffa.datatypes.DateTime)

Example 74 with DateTime

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;
}
Also used : Criteria(org.jaffa.persistence.Criteria) TransactionFieldCriteria(org.jaffa.transaction.apis.data.TransactionFieldCriteria) AtomicCriteria(org.jaffa.persistence.AtomicCriteria) TransactionCriteria(org.jaffa.transaction.apis.data.TransactionCriteria) UOW(org.jaffa.persistence.UOW) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) DateTime(org.jaffa.datatypes.DateTime)

Aggregations

DateTime (org.jaffa.datatypes.DateTime)74 Criteria (org.jaffa.persistence.Criteria)16 UOW (org.jaffa.persistence.UOW)11 AtomicCriteria (org.jaffa.persistence.AtomicCriteria)9 PreparedStatement (java.sql.PreparedStatement)8 ValidationException (org.jaffa.datatypes.ValidationException)8 ApplicationExceptions (org.jaffa.exceptions.ApplicationExceptions)8 Iterator (java.util.Iterator)7 Map (java.util.Map)5 Date (java.util.Date)4 FrameworkException (org.jaffa.exceptions.FrameworkException)4 LinkedHashMap (java.util.LinkedHashMap)3 JMSException (javax.jms.JMSException)3 MarshallException (org.directwebremoting.extend.MarshallException)3 CheckBoxModel (org.jaffa.presentation.portlet.widgets.model.CheckBoxModel)3 DateTimeModel (org.jaffa.presentation.portlet.widgets.model.DateTimeModel)3 DropDownModel (org.jaffa.presentation.portlet.widgets.model.DropDownModel)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 Enumeration (java.util.Enumeration)2 LinkedList (java.util.LinkedList)2