kaos.policy.history
Class KAoSEventHistoryComponentImpl

java.lang.Object
  extended by kaos.policy.guard.KAoSExtensionComponentImpl
      extended by 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
           
 
Fields inherited from class kaos.policy.guard.KAoSExtensionComponentImpl
_associatedOntType, _componentName, _enabledStatus
 
Constructor Summary
KAoSEventHistoryComponentImpl(java.lang.String ontType, java.lang.String name)
           
 
Method Summary
 int countEventsOfType(BasicActionDescription eventClass)
          This method is used to find out the # occurrences of actual events of the type indicated by an event class.
 java.util.ArrayList getAllEvents()
          This method is used to get all logged events.
 void logEvent(ActionInstanceDescription event)
          This method is used to log an event.
 void removeAllEvents()
          This method is used to remove all logged events and clear the list.
 
Methods inherited from class kaos.policy.guard.KAoSExtensionComponentImpl
changeKAoSExtensionComponentEnabledStatus, getAssociatedOntologyType, getKAoSExtensionComponentEnabledStatus, getKAoSExtensionComponentName, setAssociatedOntologyType, setKAoSExtensionComponentName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface kaos.policy.guard.KAoSExtensionComponent
changeKAoSExtensionComponentEnabledStatus, getAssociatedOntologyType, getKAoSExtensionComponentEnabledStatus, getKAoSExtensionComponentName
 

Field Detail

_eventLog

protected java.util.ArrayList _eventLog
Constructor Detail

KAoSEventHistoryComponentImpl

public KAoSEventHistoryComponentImpl(java.lang.String ontType,
                                     java.lang.String name)
Method Detail

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.