Class PollableService
- java.lang.Object
-
- org.opennms.netmgt.poller.pollables.PollableElement
-
- 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
Constructors Constructor Description PollableService(PollableInterface iface, String svcName)
Constructor for PollableService.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Event
createDownEvent(Date date)
createDownEventvoid
createOutage(PollEvent cause)
createOutageEvent
createResponsiveEvent(Date date)
createResponsiveEventEvent
createUnresponsiveEvent(Date date)
createUnresponsiveEventEvent
createUpEvent(Date date)
createUpEventvoid
delete()
deletePollStatus
doPoll()
doPollPollStatus
doRun()
doRunInetAddress
getAddress()
getAddressPollContext
getContext()
getContextPollableInterface
getInterface()
getInterfaceString
getIpAddr()
getIpAddrPollableNetwork
getNetwork()
getNetworkPollableNode
getNode()
getNodeint
getNodeId()
getNodeIdString
getNodeLabel()
getNodeLabelString
getNodeLocation()
Returns the name of the location of the node that this service is associated with.Schedule
getSchedule()
getSchedulelong
getStatusChangeTime()
getStatusChangeTimeString
getSvcName()
getSvcNameboolean
isReady()
isReadyPollStatus
poll()
pollvoid
processStatusChange(Date date)
processStatusChangevoid
refreshConfig()
refreshConfigprotected void
resolveOutage(PollEvent resolution)
resolveOutagevoid
run()
runvoid
schedule()
schedulevoid
sendDeleteEvent(boolean ignoreUnmanaged)
void
setPollConfig(PollableServiceConfig pollConfig)
setPollConfigvoid
setSchedule(Schedule schedule)
setScheduleString
toString()
toStringvoid
updateStatus(PollStatus newStatus)
updateStatusprotected void
visitThis(PollableVisitor v)
visitThis-
Methods inherited from class org.opennms.netmgt.poller.pollables.PollableElement
doExtrapolateCause, doInheritParentalCause, doPoll, extrapolateCause, getCause, getLockRoot, getParent, getScope, getStatus, hasOpenOutage, inheritParentalCause, isDeleted, isStatusChanged, obtainTreeLock, obtainTreeLock, poll, processCause, processComingUp, processGoingDown, processLingeringCauses, processResolution, recalculateStatus, releaseTreeLock, resetStatusChanged, resolveAllOutages, selectPollElement, setCause, setParent, visit, withTreeLock, withTreeLock, withTreeLock, withTreeLock
-
-
-
-
Constructor Detail
-
PollableService
public PollableService(PollableInterface iface, String svcName)
Constructor for PollableService.
- Parameters:
svcName
- aString
object.iface
- aPollableInterface
object.
-
-
Method Detail
-
getInterface
public PollableInterface getInterface()
getInterface
- Returns:
- a
PollableInterface
object.
-
getNode
public PollableNode getNode()
getNode
- Returns:
- a
PollableNode
object.
-
getNetwork
public PollableNetwork getNetwork()
getNetwork
- Returns:
- a
PollableNetwork
object.
-
getContext
public PollContext getContext()
getContext
- Specified by:
getContext
in classPollableElement
- Returns:
- a
PollContext
object.
-
getSvcName
public String getSvcName()
getSvcName
- Specified by:
getSvcName
in interfaceMonitoredService
- Returns:
- a
String
object.
-
getIpAddr
public String getIpAddr()
getIpAddr
- Specified by:
getIpAddr
in interfaceMonitoredService
- Returns:
- a
String
object.
-
getNodeId
public int getNodeId()
getNodeId
- Specified by:
getNodeId
in interfaceMonitoredService
- Returns:
- a int.
-
getNodeLabel
public String getNodeLabel()
getNodeLabel
- Specified by:
getNodeLabel
in interfaceMonitoredService
- Returns:
- a
String
object.
-
getNodeLocation
public String getNodeLocation()
Description copied from interface:MonitoredService
Returns the name of the location of the node that this service is associated with.- Specified by:
getNodeLocation
in interfaceMonitoredService
- Returns:
- the nodelocation
-
visitThis
protected void visitThis(PollableVisitor v)
visitThis
- Overrides:
visitThis
in classPollableElement
- Parameters:
v
- aPollableVisitor
object.
-
setPollConfig
public void setPollConfig(PollableServiceConfig pollConfig)
setPollConfig
- Parameters:
pollConfig
- aPollableServiceConfig
object.
-
poll
public PollStatus poll()
poll
- Specified by:
poll
in classPollableElement
- Returns:
- a
PollStatus
object.
-
getAddress
public InetAddress getAddress()
getAddress
- Specified by:
getAddress
in interfaceMonitoredService
- Returns:
- a
InetAddress
object.
-
doPoll
public PollStatus doPoll()
doPoll
- Returns:
- the top changed element whose status changes needs to be processed
-
createDownEvent
public Event createDownEvent(Date date)
createDownEvent
- Specified by:
createDownEvent
in classPollableElement
- Parameters:
date
- aDate
object.- Returns:
- a
Event
object.
-
createUpEvent
public Event createUpEvent(Date date)
createUpEvent
- Specified by:
createUpEvent
in classPollableElement
- Parameters:
date
- aDate
object.- Returns:
- a
Event
object.
-
createOutage
public void createOutage(PollEvent cause)
createOutage
- Overrides:
createOutage
in classPollableElement
- Parameters:
cause
- TODO
-
resolveOutage
protected void resolveOutage(PollEvent resolution)
resolveOutage
- Overrides:
resolveOutage
in classPollableElement
- Parameters:
resolution
- TODO
-
toString
public String toString()
toString
-
processStatusChange
public void processStatusChange(Date date)
processStatusChange
- Overrides:
processStatusChange
in classPollableElement
- Parameters:
date
- aDate
object.
-
updateStatus
public void updateStatus(PollStatus newStatus)
updateStatus
- Overrides:
updateStatus
in classPollableElement
- Parameters:
newStatus
- aPollStatus
object.
-
setSchedule
public void setSchedule(Schedule schedule)
setSchedule
- Parameters:
schedule
- aSchedule
object.
-
getStatusChangeTime
public long getStatusChangeTime()
getStatusChangeTime
- Returns:
- a long.
-
isReady
public boolean isReady()
isReady
- Specified by:
isReady
in interfaceReadyRunnable
- Returns:
- a boolean.
-
doRun
public PollStatus doRun()
doRun
- Returns:
- a
PollStatus
object.
-
delete
public void delete()
delete
- Overrides:
delete
in classPollableElement
-
schedule
public void schedule()
schedule
-
sendDeleteEvent
public void sendDeleteEvent(boolean ignoreUnmanaged)
-
refreshConfig
public void refreshConfig()
refreshConfig
-
-