kaos.policy.history
Class KAoSEventHistoryComponentImpl
java.lang.Object
kaos.policy.guard.KAoSExtensionComponentImpl
kaos.policy.history.KAoSEventHistoryComponentImpl
- All Implemented Interfaces:
- KAoSExtensionComponent, KAoSEventHistoryComponent
public class KAoSEventHistoryComponentImpl
- extends KAoSExtensionComponentImpl
- implements KAoSEventHistoryComponent
This class implements KAoSExtensionComponent interface. It adds a method
signature that takes in an event class and returns the # events matching
that event class from its set of logged events.
Field Summary |
protected java.util.ArrayList |
_eventLog
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_eventLog
protected java.util.ArrayList _eventLog
KAoSEventHistoryComponentImpl
public KAoSEventHistoryComponentImpl(java.lang.String ontType,
java.lang.String name)
logEvent
public void logEvent(ActionInstanceDescription event)
- This method is used to log an event. Please note that an event will be logged only if this
component instance is enabled to log. If it is not enabled, then the event will not be logged
even if this method is called. Check the api documentation of KAoSExtensionComponent to
enable/disable logging.
- Parameters:
event
- An ActionInstanceDescription object specifying
the event to be logged.
getAllEvents
public java.util.ArrayList getAllEvents()
- This method is used to get all logged events.
- Parameters:
none.
-
- Returns:
- An ArrayList containing all the logged events.
removeAllEvents
public void removeAllEvents()
- This method is used to remove all logged events and clear the list.
- Parameters:
none.
-
countEventsOfType
public int countEventsOfType(BasicActionDescription eventClass)
- This method is used to find out the # occurrences of
actual events of the type indicated by an event class.
- Specified by:
countEventsOfType
in interface KAoSEventHistoryComponent
- Parameters:
eventClass
- A BasicActionDescription object specifying
the type of event class.
- Returns:
- the # events in this log that are instances of the
specified event class.