network.detectors
Class CPUTimerEventDetector

java.lang.Object
  extended bynetwork.detectors.EventDetector
      extended bynetwork.detectors.CPUTimerEventDetector
All Implemented Interfaces:
java.lang.Runnable, java.io.Serializable

public class CPUTimerEventDetector
extends EventDetector
implements java.io.Serializable, java.lang.Runnable

The CPUTimerEvent Detector is a special detector. It is not triggered, as are other detectors, but rather runs in a loop, each cycle of which generates a CPUTimerEvent, then sleeps for a specified timeout. This detector does not depend on any other detectors.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class network.detectors.EventDetector
agentURN, cred, dbModule, eventIDGenerator, eventTable, host, localTriggeringEvents, remoteTriggeringEvents, reportTable
 
Constructor Summary
CPUTimerEventDetector(ConfigObject configObj)
           
CPUTimerEventDetector(long timeoutPeriod, ConfigObject configObj)
          Creates a new CPUTimerEventDetector with timeout specified by timeoutPeriod (milliseconds).
CPUTimerEventDetector(java.lang.String timeoutPeriodString)
          Creates a new CPUTimerEventDetector by parsing a string to obtain the timeout for each CPUTimerEvent generation.
 
Method Summary
 java.util.Vector generateEvent(Event triggeredEvent)
          Returns a null vector of events (because the main function is generating all the events on a timer basis).
 java.lang.String getGeneratingEventClassName()
          Returns the fully-qualified classname of the event that this detector may generate.
static java.lang.String[] getParamList()
          Returns array of strings containing all the parameters that can be used as input to modify this detector.
 void modifyDetector(java.lang.Object[] object)
          Allows modification of detector configuration by passing a Long object of milliseconds for the new time out.
 void run()
          Generates a CPUTimerEvent every localTimeOut milliseconds.
 void setTimeoutPeriod(long time)
          Sets the time between CPUTimerEvent generations.
 void stopDetector()
           
static java.lang.Object[] translateParameters(java.lang.String[] inputarray)
          This function takes an array of strings from GUI which contains input and converts them to array of objects and returns.
 
Methods inherited from class network.detectors.EventDetector
getAlarmLevel, getAlertLevel, getLocalTriggeringEventClassNames, getRemoteTriggeringEventClassNames, getSynchronizer, InitializeFields, populatePatterns, printRunningThreads, setAgentURN, setAlarmLevel, setAlertLevel, setDB, setEventIDGenerator, setEventTable, setLocalTriggeringEvents, setRemoteTriggeringEvents, setReportTable, switchOffPrintRunningThreads
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CPUTimerEventDetector

public CPUTimerEventDetector(ConfigObject configObj)

CPUTimerEventDetector

public CPUTimerEventDetector(long timeoutPeriod,
                             ConfigObject configObj)
Creates a new CPUTimerEventDetector with timeout specified by timeoutPeriod (milliseconds).

Parameters:
timeoutPeriod - the number of milliseconds between each CPUTimerEvent generation.

CPUTimerEventDetector

public CPUTimerEventDetector(java.lang.String timeoutPeriodString)
Creates a new CPUTimerEventDetector by parsing a string to obtain the timeout for each CPUTimerEvent generation.

Parameters:
timeoutPeriodString - string containing the number of milliseconds between each CPUTimerEvent generation.
Method Detail

stopDetector

public void stopDetector()
Overrides:
stopDetector in class EventDetector
Returns:

getParamList

public static java.lang.String[] getParamList()
Returns array of strings containing all the parameters that can be used as input to modify this detector. Each entry in the array corresponds to one parameter with structure " : ".

Returns:
parameterList, an array of Strings indicating parameters and their types

translateParameters

public static java.lang.Object[] translateParameters(java.lang.String[] inputarray)
                                              throws java.lang.Exception
This function takes an array of strings from GUI which contains input and converts them to array of objects and returns.

Parameters:
inputarray - an array of strings that contains user inputs.
Returns:
objArray an array of objects converted from the array of strings got from user.
Throws:
java.lang.Exception

modifyDetector

public void modifyDetector(java.lang.Object[] object)
                    throws java.lang.Exception
Allows modification of detector configuration by passing a Long object of milliseconds for the new time out.

Overrides:
modifyDetector in class EventDetector
Parameters:
object - an array of Objects with a Long object as the only parameter
Returns:
Throws:
java.lang.Exception

setTimeoutPeriod

public void setTimeoutPeriod(long time)
Sets the time between CPUTimerEvent generations.

Parameters:
time - a time in milliseconds.
Returns:

getGeneratingEventClassName

public java.lang.String getGeneratingEventClassName()
Returns the fully-qualified classname of the event that this detector may generate.

Specified by:
getGeneratingEventClassName in class EventDetector
Returns:
the fully-qualified classname of the event that this detector may generate.

generateEvent

public java.util.Vector generateEvent(Event triggeredEvent)
Returns a null vector of events (because the main function is generating all the events on a timer basis). Thus, this function is just a noop.

Specified by:
generateEvent in class EventDetector
Parameters:
triggeredEvent - event that triggered this detector.
Returns:

run

public void run()
Generates a CPUTimerEvent every localTimeOut milliseconds.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class EventDetector
Returns: