Search in sources :

Example 6 with ObjectActionsExecutedEntryType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectActionsExecutedEntryType in project midpoint by Evolveum.

the class ActionsExecutedSummarizer method addAction.

private void addAction(Map<ActionsExecutedObjectsKey, ObjectActionsExecutedEntryType> target, ActionExecuted a) {
    ActionsExecutedObjectsKey key = new ActionsExecutedObjectsKey(a.objectType, a.changeType, a.channel);
    ObjectActionsExecutedEntryType entry = target.get(key);
    if (entry == null) {
        entry = new ObjectActionsExecutedEntryType();
        target.put(key, entry);
    }
    if (a.exception == null) {
        entry.setTotalSuccessCount(entry.getTotalSuccessCount() + 1);
        entry.setLastSuccessObjectName(a.objectName);
        entry.setLastSuccessObjectDisplayName(a.objectDisplayName);
        entry.setLastSuccessObjectOid(a.objectOid);
        entry.setLastSuccessTimestamp(a.timestamp);
    } else {
        entry.setTotalFailureCount(entry.getTotalFailureCount() + 1);
        entry.setLastFailureObjectName(a.objectName);
        entry.setLastFailureObjectDisplayName(a.objectDisplayName);
        entry.setLastFailureObjectOid(a.objectOid);
        entry.setLastFailureTimestamp(a.timestamp);
        entry.setLastFailureExceptionMessage(a.exception.getMessage());
    }
}
Also used : ObjectActionsExecutedEntryType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectActionsExecutedEntryType)

Example 7 with ObjectActionsExecutedEntryType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectActionsExecutedEntryType in project midpoint by Evolveum.

the class ActionsExecutedSummarizer method mapToBean.

private void mapToBean(Map<ActionsExecutedObjectsKey, ObjectActionsExecutedEntryType> map, List<ObjectActionsExecutedEntryType> list) {
    for (Map.Entry<ActionsExecutedObjectsKey, ObjectActionsExecutedEntryType> entry : map.entrySet()) {
        ObjectActionsExecutedEntryType e = entry.getValue().clone();
        e.setObjectType(entry.getKey().getObjectType());
        e.setOperation(ChangeType.toChangeTypeType(entry.getKey().getOperation()));
        e.setChannel(entry.getKey().getChannel());
        list.add(e);
    }
}
Also used : Map(java.util.Map) HashMap(java.util.HashMap) ObjectActionsExecutedEntryType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectActionsExecutedEntryType)

Aggregations

ObjectActionsExecutedEntryType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectActionsExecutedEntryType)7 HashMap (java.util.HashMap)3 Map (java.util.Map)3 ArrayList (java.util.ArrayList)2 ActivityActionsExecutedType (com.evolveum.midpoint.xml.ns._public.common.common_3.ActivityActionsExecutedType)1 List (java.util.List)1