org.opennms.netmgt.poller.pollables
Class PollableService

java.lang.Object
  extended by org.opennms.netmgt.poller.pollables.PollableElement
      extended by org.opennms.netmgt.poller.pollables.PollableService
All Implemented Interfaces:
Runnable, MonitoredService, ReadyRunnable

public class PollableService
extends PollableElement
implements ReadyRunnable, MonitoredService

Represents a PollableService

Author:
Mathew Brozowski

Constructor Summary
PollableService(PollableInterface iface, String svcName)
           
 
Method Summary
 Event createDownEvent(Date date)
           
 void createOutage(PollEvent cause)
           
 Event createResponsiveEvent(Date date)
           
 Event createUnresponsiveEvent(Date date)
           
 Event createUpEvent(Date date)
           
 void delete()
           
 PollStatus doPoll()
           
 PollStatus doRun()
           
 InetAddress getAddress()
          Returns the InetAddress associated with the service
 PollContext getContext()
           
 PollableInterface getInterface()
           
 String getIpAddr()
          Returns the ipAddr string associated with this monitored service
 NetworkInterface getNetInterface()
          Returns the Netinterface object for this service.
 PollableNetwork getNetwork()
           
 PollableNode getNode()
           
 int getNodeId()
          Returns the nodeId of the node that this service is associated with
 String getNodeLabel()
          Returns the label of the node that this service is associated with
 Schedule getSchedule()
           
 long getStatusChangeTime()
           
 String getSvcName()
          Returns the svcName associated with this monitored service
 boolean isReady()
          Returns true if the runnable is ready to start.
 PollStatus poll()
           
 void processStatusChange(Date date)
           
 void refreshConfig()
           
protected  void resolveOutage(PollEvent resolution)
           
 void run()
           
 void schedule()
           
 void sendDeleteEvent()
           
 void setPollConfig(PollableServiceConfig pollConfig)
           
 void setSchedule(Schedule schedule)
           
 String toString()
           
 void updateStatus(PollStatus newStatus)
           
protected  void visitThis(PollableVisitor v)
           
 
Methods inherited from class org.opennms.netmgt.poller.pollables.PollableElement
doExtrapolateCause, doInheritParentalCause, doPoll, extrapolateCause, getCause, getLockRoot, getParent, getScope, getStatus, hasOpenOutage, inheritParentalCause, isDeleted, isStatusChanged, isTreeLockAvailable, obtainTreeLock, poll, processCause, processComingUp, processGoingDown, processLingeringCauses, processResolution, recalculateStatus, releaseTreeLock, resetStatusChanged, resolveAllOutages, selectPollElement, setCause, setParent, visit, withTreeLock, withTreeLock, withTreeLock, withTreeLock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PollableService

public PollableService(PollableInterface iface,
                       String svcName)
Parameters:
svcName -
iface -
Method Detail

getInterface

public PollableInterface getInterface()

getNode

public PollableNode getNode()

getNetwork

public PollableNetwork getNetwork()

getContext

public PollContext getContext()
Specified by:
getContext in class PollableElement

getSvcName

public String getSvcName()
Description copied from interface: MonitoredService
Returns the svcName associated with this monitored service

Specified by:
getSvcName in interface MonitoredService
Returns:

getIpAddr

public String getIpAddr()
Description copied from interface: MonitoredService
Returns the ipAddr string associated with this monitored service

Specified by:
getIpAddr in interface MonitoredService
Returns:

getNodeId

public int getNodeId()
Description copied from interface: MonitoredService
Returns the nodeId of the node that this service is associated with

Specified by:
getNodeId in interface MonitoredService
Returns:

getNodeLabel

public String getNodeLabel()
Description copied from interface: MonitoredService
Returns the label of the node that this service is associated with

Specified by:
getNodeLabel in interface MonitoredService
Returns:
the nodelabel

visitThis

protected void visitThis(PollableVisitor v)
Overrides:
visitThis in class PollableElement

setPollConfig

public void setPollConfig(PollableServiceConfig pollConfig)
Parameters:
pollConfig -

poll

public PollStatus poll()
Specified by:
poll in class PollableElement

getNetInterface

public NetworkInterface getNetInterface()
Description copied from interface: MonitoredService
Returns the Netinterface object for this service. This netinterface object is guarenteed to be the same each time init or poll is called

Specified by:
getNetInterface in interface MonitoredService
Returns:
Throws:
UnknownHostException

getAddress

public InetAddress getAddress()
Description copied from interface: MonitoredService
Returns the InetAddress associated with the service

Specified by:
getAddress in interface MonitoredService
Returns:

doPoll

public PollStatus doPoll()
Returns:
the top changed element whose status changes needs to be processed

createDownEvent

public Event createDownEvent(Date date)
Specified by:
createDownEvent in class PollableElement
Returns:

createUpEvent

public Event createUpEvent(Date date)
Specified by:
createUpEvent in class PollableElement
Returns:

createUnresponsiveEvent

public Event createUnresponsiveEvent(Date date)

createResponsiveEvent

public Event createResponsiveEvent(Date date)

createOutage

public void createOutage(PollEvent cause)
Overrides:
createOutage in class PollableElement
Parameters:
cause - TODO

resolveOutage

protected void resolveOutage(PollEvent resolution)
Overrides:
resolveOutage in class PollableElement
Parameters:
resolution - TODO

toString

public String toString()
Overrides:
toString in class Object

processStatusChange

public void processStatusChange(Date date)
Overrides:
processStatusChange in class PollableElement

updateStatus

public void updateStatus(PollStatus newStatus)
Overrides:
updateStatus in class PollableElement

setSchedule

public void setSchedule(Schedule schedule)
Parameters:
schedule -

getSchedule

public Schedule getSchedule()

getStatusChangeTime

public long getStatusChangeTime()

isReady

public boolean isReady()
Description copied from interface: ReadyRunnable
Returns true if the runnable is ready to start.

Specified by:
isReady in interface ReadyRunnable

run

public void run()
Specified by:
run in interface Runnable

doRun

public PollStatus doRun()

delete

public void delete()
Overrides:
delete in class PollableElement

schedule

public void schedule()

sendDeleteEvent

public void sendDeleteEvent()

refreshConfig

public void refreshConfig()


Copyright © 2009. All Rights Reserved.