|
OpenNMS API 1.1.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.poller.IPv4NetworkInterface
org.opennms.netmgt.poller.PollableService
The PollableService class ...
Field Summary | |
private boolean |
m_deletionFlag
Deletion flag...set to indicate that the service/interface/node tuple represented by this PollableService object has been deleted and should no longer be polled. |
private long |
m_lastInterval
This was the interval to use when the node was last rescheduled. |
private long |
m_lastPoll
The last time the service was polled...whether due to a scheduled poll or node outage processing. |
private long |
m_lastScheduledPoll
The last time the service was scheduled for a poll. |
private ServiceMonitor |
m_monitor
The service monitor used to poll this service/interface pair. |
private Package |
m_package
The package for this polling interface. |
private PollableInterface |
m_pInterface
interface that this service belongs to |
private java.util.List |
m_pollableServices
List of all scheduled PollableService objects |
private boolean |
m_pollImmediate
Set to true when service is first constructed which will cause the recalculateInterval() method to return 0 resulting in an immediate poll. |
private Scheduler |
m_scheduler
The scheduler for the poller |
private Service |
m_service
The service inforamtion for this interface. |
private int |
m_status
Last known/current status. |
private boolean |
m_statusChangedFlag
Indicates if the service changed status as the result of most recent poll. |
private long |
m_statusChangeTime
When the last status change occured. |
private java.lang.String |
m_svcPropKey
The key used to lookup the service properties that are passed to the monitor. |
private boolean |
m_unresponsiveFlag
Flag which indicates if previous poll returned SnmpMonitor.SERVICE_UNRESPONSIVE. |
private static java.util.Map |
SVC_PROP_MAP
The map of service parameters. |
Fields inherited from class org.opennms.netmgt.poller.IPv4NetworkInterface |
m_address |
Fields inherited from interface org.opennms.netmgt.poller.Pollable |
STATUS_DOWN, STATUS_UNKNOWN, STATUS_UP, statusType |
Fields inherited from interface org.opennms.netmgt.poller.NetworkInterface |
TYPE_IPV4, TYPE_UNKNOWN |
Constructor Summary | |
(package private) |
PollableService(PollableInterface pInterface,
java.lang.String svcName,
Package pkg,
int status,
java.util.Date svcLostDate)
Constructs a new instance of a pollable service object that is polled using the passed monitor. |
Method Summary | |
(package private) void |
cleanupScheduledServices()
This method is called to remove a pollable service from the service updates map. |
private void |
doRun(boolean allowedToRescheduleMyself)
This used to be the implementation for the run() method. |
boolean |
equals(java.lang.Object aService)
Tests if two PollableService objects refer to the same nodeid/interface/service tuple. |
PollableInterface |
getInterface()
|
long |
getLastPollTime()
|
long |
getLastScheduleInterval()
|
Package |
getPackage()
Returns the package associated with this service. |
java.lang.String |
getPackageName()
|
long |
getScheduledRuntime()
Returns the time (in milliseconds) after which this is scheduled to run. |
java.lang.String |
getServiceName()
Returns the service name |
int |
getStatus()
Returns current status of the object |
boolean |
isDeleted()
|
boolean |
isReady()
This method is used to evaluate the status of this interface and service pair. |
void |
markAsDeleted()
|
int |
poll()
Invokes a poll of the service via the ServiceMonitor. |
(package private) long |
recalculateInterval()
This method is used to return the next interval for this interface. |
(package private) void |
reschedule(boolean reUseInterval)
This method is called to reschedule the service for polling. |
(package private) void |
reschedule(long interval)
Reschedules the service at the specified interval (in milliseconds). |
void |
resetStatusChanged()
|
void |
run()
This is the main method of the class. |
void |
run(boolean reschedule)
This an alternative entry point into the class. |
private boolean |
scheduledOutage()
Checks the package information for the pollable service and determines if any of the calendar outages associated with the package apply to the current time and the service's interface. |
private void |
sendEvent(java.lang.String uei,
java.util.Map properties)
|
void |
setStatus(int status)
|
boolean |
statusChanged()
Returns true if status of service changed as a result of the last poll. |
Methods inherited from class org.opennms.netmgt.poller.IPv4NetworkInterface |
getAddress, getAttribute, getType, setAttribute |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private PollableInterface m_pInterface
private final Service m_service
private final Package m_package
private int m_status
private boolean m_unresponsiveFlag
private boolean m_statusChangedFlag
private long m_statusChangeTime
private boolean m_deletionFlag
private final ServiceMonitor m_monitor
private final Scheduler m_scheduler
private final java.util.List m_pollableServices
private boolean m_pollImmediate
private long m_lastPoll
private long m_lastScheduledPoll
private long m_lastInterval
private final java.lang.String m_svcPropKey
private static java.util.Map SVC_PROP_MAP
Constructor Detail |
PollableService(PollableInterface pInterface, java.lang.String svcName, Package pkg, int status, java.util.Date svcLostDate)
pInterface
- The interface to pollsvcName
- The name of the service being polled.pkg
- The package with the polling informationMethod Detail |
public PollableInterface getInterface()
public java.lang.String getServiceName()
public boolean statusChanged()
statusChanged
in interface Pollable
public void resetStatusChanged()
public int getStatus()
Pollable
getStatus
in interface Pollable
public void setStatus(int status)
public void markAsDeleted()
public boolean isDeleted()
public long getLastPollTime()
public long getLastScheduleInterval()
public long getScheduledRuntime()
public java.lang.String getPackageName()
public Package getPackage()
public boolean isReady()
isReady
in interface ReadyRunnable
java.lang.RuntimeException
- Throws if the ready
time cannot be computed due to invalid downtime model.void reschedule(long interval)
void reschedule(boolean reUseInterval)
reUseInterval
- Flag which controls how the interval
at which to reschedule the interface
is determined. If true, value of
m_lastInterval is used. Otherwise
recalculateInterval() is called to
recalculate the interval.long recalculateInterval()
java.lang.RuntimeException
- Throws if the ready
time cannot be computed due to invalid downtime model.private void sendEvent(java.lang.String uei, java.util.Map properties)
public boolean equals(java.lang.Object aService)
aService
- the PollableService object to compare
void cleanupScheduledServices()
private boolean scheduledOutage()
public void run()
isReady
method to determine execution. If the instance is ready for
execution then it is started with it's own thread context
to execute the query. The last step in the method before
it exits is to reschedule the interface.
run
in interface java.lang.Runnable
public void run(boolean reschedule) throws LockUnavailableException, java.lang.InterruptedException
reschedule
- set this to true if you want the pollable service
to reschedule itself when done processing.
LockUnavailableException
- If it was unable to obtain a node
lock
ThreadInterruped
- If the thread was interrtuped while
waiting for a node lock.
java.lang.InterruptedException
private void doRun(boolean allowedToRescheduleMyself) throws LockUnavailableException, java.lang.InterruptedException
allowedToRescheduleMyself
- set this to true if you want the
pollable service to reschedule itself when done processing.
LockUnavailableException
- If it was unable to obtain a node
lock
ThreadInterruped
- If the thread was interrtuped while
waiting for a node lock.
java.lang.InterruptedException
public int poll()
Invokes a poll of the service via the ServiceMonitor.
|
OpenNMS API 1.1.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |