kaos.policy.history
Class HistoryMonitorImpl

java.lang.Object
  extended by kaos.policy.history.HistoryMonitorImpl
All Implemented Interfaces:
java.io.Serializable, KAoSExtensionComponent, HistoryMonitor, KAoSEventHistoryComponent

public class HistoryMonitorImpl
extends java.lang.Object
implements HistoryMonitor, java.io.Serializable

This interface defines methods to access logged events

See Also:
Serialized Form

Constructor Summary
HistoryMonitorImpl(java.lang.String ontType)
           
 
Method Summary
 void changeKAoSExtensionComponentEnabledStatus(boolean state)
          change the 'enabled' status of the component
 int countEventsOfType(BasicActionDescription eventClass)
          This method is used to find out the # occurrences of actual events of the type indicated by an event class.
 void deleteAllLogs()
          Delete all the events logged so far.
 void deleteLogs(java.util.Vector logs)
           
 java.util.Vector deleteLogsforActionType(java.lang.String actionType)
          Delete all logged events that contain the given action type.
 java.util.Vector deleteLogsforActor(java.lang.String actorID)
          Delete all logged events that contain the given actor.
 java.util.Vector deleteSpecifiedLogs(java.lang.String actionType, java.lang.String actorID, java.lang.String startTime, java.lang.String endTime, java.lang.Boolean latest)
          This method calls 'getSpecifiedLogs' with its input parameters and then deletes the logs returned by that call.
 java.util.Vector getAllLogs()
          Get all the events logged so far.
 java.lang.String getAssociatedOntologyType()
          KAoSExtensionComponent implementation begins
 boolean getKAoSExtensionComponentEnabledStatus()
          get the 'enabled' status of the component
 java.lang.String getKAoSExtensionComponentName()
          Get the (unique ?) name of this KAoSExtensionComponents object.
 java.util.Vector getLogsforActionType(java.lang.String actionType)
          Get all events logged that contain the given action type.
 java.util.Vector getLogsforActor(java.lang.String actorID)
          Get all logged events that contain the given actor.
 java.util.Vector getSpecifiedLogs(java.lang.String actionType, java.lang.String actorID, java.lang.String startTime, java.lang.String endTime, java.lang.Boolean latest)
          This method returns the logged events specified by the given parameters.
 void logEvent(ActionInstanceDescription event)
          Log an event
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HistoryMonitorImpl

public HistoryMonitorImpl(java.lang.String ontType)
Method Detail

getAssociatedOntologyType

public java.lang.String getAssociatedOntologyType()
KAoSExtensionComponent implementation begins

Specified by:
getAssociatedOntologyType in interface KAoSExtensionComponent
Returns:
name of that ontology type.

getKAoSExtensionComponentName

public java.lang.String getKAoSExtensionComponentName()
Description copied from interface: KAoSExtensionComponent
Get the (unique ?) name of this KAoSExtensionComponents object.

Specified by:
getKAoSExtensionComponentName in interface KAoSExtensionComponent
Returns:
name of this component.

changeKAoSExtensionComponentEnabledStatus

public void changeKAoSExtensionComponentEnabledStatus(boolean state)
Description copied from interface: KAoSExtensionComponent
change the 'enabled' status of the component

Specified by:
changeKAoSExtensionComponentEnabledStatus in interface KAoSExtensionComponent
Parameters:
state - the boolean parameter to change the status to

getKAoSExtensionComponentEnabledStatus

public boolean getKAoSExtensionComponentEnabledStatus()
Description copied from interface: KAoSExtensionComponent
get the 'enabled' status of the component

Specified by:
getKAoSExtensionComponentEnabledStatus in interface KAoSExtensionComponent
Returns:
a boolean parameter indicating the 'enabled' status of this component.

logEvent

public void logEvent(ActionInstanceDescription event)
Log an event

Specified by:
logEvent in interface HistoryMonitor
Parameters:
event - The event to be logged.

getAllLogs

public java.util.Vector getAllLogs()
Get all the events logged so far.

Specified by:
getAllLogs in interface HistoryMonitor
Returns:
A Vector containing aid objects logged so far.

deleteAllLogs

public void deleteAllLogs()
Delete all the events logged so far.

Specified by:
deleteAllLogs in interface HistoryMonitor

deleteLogs

public void deleteLogs(java.util.Vector logs)

getLogsforActionType

public java.util.Vector getLogsforActionType(java.lang.String actionType)
Get all events logged that contain the given action type.

Specified by:
getLogsforActionType in interface HistoryMonitor
Parameters:
actionType - A String indicating the action type.
Returns:
A vector containing aid objects logged for that action.

deleteLogsforActionType

public java.util.Vector deleteLogsforActionType(java.lang.String actionType)
Delete all logged events that contain the given action type.

Specified by:
deleteLogsforActionType in interface HistoryMonitor
Parameters:
actionType - A String indicating the action type.
Returns:
Vector A Vector containing deleted logs

getLogsforActor

public java.util.Vector getLogsforActor(java.lang.String actorID)
Get all logged events that contain the given actor.

Specified by:
getLogsforActor in interface HistoryMonitor
Parameters:
actorID - A String indicating the actor id.
Returns:
A vector containing aid objects logged for that actor.

deleteLogsforActor

public java.util.Vector deleteLogsforActor(java.lang.String actorID)
Delete all logged events that contain the given actor.

Specified by:
deleteLogsforActor in interface HistoryMonitor
Parameters:
actorID - A String indicating the actor id.
Returns:
Vector A Vector containing deleted logs

getSpecifiedLogs

public java.util.Vector getSpecifiedLogs(java.lang.String actionType,
                                         java.lang.String actorID,
                                         java.lang.String startTime,
                                         java.lang.String endTime,
                                         java.lang.Boolean latest)
This method returns the logged events specified by the given parameters. The input parameters are interpreted as follows:

Specified by:
getSpecifiedLogs in interface HistoryMonitor
Parameters:
actionType - A String indicating the action type of requested logs. If it is null, 'all action types' would be assumed.
actorID - A String indicating the actor of requested logs. If null, 'all actors' would be assumed.
startTime - A long, indicating the start of time period for which logs are requested. If null, 'the begining of logs' time would be assumed.
endTime - A long, indicating the end of time period for which logs are requested. If null, 'time of the latest log' would be assumed.
latest - A boolean, indicating if only latest logs are requested. If it is set: a) start and end time parameters are ignored. b) If actionType is null, and actorID is null, the latest log for each actor is returned. c) If actorID is null and actionType is not null the latest logs for each actor for the given actionType are returned. d) If actorID is not null, the latest log for that actor is returned. If actionType also is not null, the latest log for that actor and that action is returned. If this boolean is not set, log are retrieved based on preceding parameters.

deleteSpecifiedLogs

public java.util.Vector deleteSpecifiedLogs(java.lang.String actionType,
                                            java.lang.String actorID,
                                            java.lang.String startTime,
                                            java.lang.String endTime,
                                            java.lang.Boolean latest)
This method calls 'getSpecifiedLogs' with its input parameters and then deletes the logs returned by that call. For method documentation, see the heading for 'getSpecifiedLogs'.

Specified by:
deleteSpecifiedLogs in interface HistoryMonitor
Returns:
Vector A Vector containing deleted logs

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.