Class PollableNode
- java.lang.Object
-
- org.opennms.netmgt.poller.pollables.PollableElement
-
- org.opennms.netmgt.poller.pollables.PollableContainer
-
- org.opennms.netmgt.poller.pollables.PollableNode
-
public class PollableNode extends PollableContainer
Represents a PollableNode- Author:
- Mathew Brozowski
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opennms.netmgt.poller.pollables.PollableContainer
PollableContainer.Accumulator<T>, PollableContainer.Iter, PollableContainer.SimpleIter<T>
-
-
Constructor Summary
Constructors Constructor Description PollableNode(PollableNetwork network, int nodeId, java.lang.String nodeLabel, java.lang.String nodeLocation)
Constructor for PollableNode.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Event
createDownEvent(java.util.Date date)
createDownEventPollableInterface
createInterface(java.net.InetAddress addr)
createInterfaceprotected java.lang.Object
createMemberKey(PollableElement member)
createMemberKeyPollableService
createService(java.net.InetAddress addr, java.lang.String svcName)
createServiceEvent
createUpEvent(java.util.Date date)
createUpEventPollStatus
doPoll(PollableElement elem)
doPollPollContext
getContext()
getContextPollableInterface
getInterface(java.net.InetAddress addr)
getInterfacejava.util.List<PollableInterface>
getInterfaces()
protected PollableElement
getLockRoot()
getLockRootPollableNetwork
getNetwork()
getNetworkint
getNodeId()
getNodeIdjava.lang.String
getNodeLabel()
getNodeLabeljava.lang.String
getNodeLocation()
PollableService
getService(java.net.InetAddress addr, java.lang.String svcName)
getServiceprotected void
obtainTreeLock()
This method does not have a timeout, it blocks indefinitely until the lock is obtained.protected void
obtainTreeLock(long timeout)
This method tries to obtain the lock within the given timeout.protected void
releaseTreeLock()
releaseTreeLockvoid
setNodeLabel(java.lang.String label)
java.lang.String
toString()
toStringprotected void
visitThis(PollableVisitor v)
visitThis-
Methods inherited from class org.opennms.netmgt.poller.pollables.PollableContainer
addMember, delete, deleteMember, deriveValueFromMembers, deriveValueFromMembers, doExtrapolateCause, doInheritParentalCause, forEachMember, forEachMember, getMember, getMemberCount, getMembers, getMemberStatus, poll, poll, pollRemainingMembers, processCause, processMemberStatusChanges, processResolution, processStatusChange, recalculateStatus, removeMember, resetStatusChanged, resolveAllOutages, selectPollElement, visit, visitMembers
-
Methods inherited from class org.opennms.netmgt.poller.pollables.PollableElement
createOutage, extrapolateCause, getCause, getParent, getScope, getStatus, hasOpenOutage, inheritParentalCause, isDeleted, isStatusChanged, processComingUp, processGoingDown, processLingeringCauses, resolveOutage, setCause, setParent, updateStatus, withTreeLock, withTreeLock, withTreeLock, withTreeLock
-
-
-
-
Constructor Detail
-
PollableNode
public PollableNode(PollableNetwork network, int nodeId, java.lang.String nodeLabel, java.lang.String nodeLocation)
Constructor for PollableNode.
- Parameters:
network
- aPollableNetwork
object.nodeId
- a int.nodeLabel
- aString
object.nodeLocation
- aString
object.
-
-
Method Detail
-
getNodeId
public int getNodeId()
getNodeId
- Returns:
- a int.
-
getNodeLabel
public java.lang.String getNodeLabel()
getNodeLabel
- Returns:
- a
String
object.
-
setNodeLabel
public void setNodeLabel(java.lang.String label)
-
getNodeLocation
public java.lang.String getNodeLocation()
-
createInterface
public PollableInterface createInterface(java.net.InetAddress addr)
createInterface
- Parameters:
addr
- aInetAddress
object.- Returns:
- a
PollableInterface
object.
-
getInterface
public PollableInterface getInterface(java.net.InetAddress addr)
getInterface
- Parameters:
addr
- aInetAddress
object.- Returns:
- a
PollableInterface
object.
-
getInterfaces
public java.util.List<PollableInterface> getInterfaces()
-
getNetwork
public PollableNetwork getNetwork()
getNetwork
- Returns:
- a
PollableNetwork
object.
-
getContext
public PollContext getContext()
getContext
- Specified by:
getContext
in classPollableElement
- Returns:
- a
PollContext
object.
-
createMemberKey
protected java.lang.Object createMemberKey(PollableElement member)
createMemberKey
- Specified by:
createMemberKey
in classPollableContainer
- Parameters:
member
- aPollableElement
object.- Returns:
- a
Object
object.
-
createService
public PollableService createService(java.net.InetAddress addr, java.lang.String svcName)
createService
- Parameters:
svcName
- aString
object.addr
- aInetAddress
object.- Returns:
- a
PollableService
object.
-
getService
public PollableService getService(java.net.InetAddress addr, java.lang.String svcName)
getService
- Parameters:
svcName
- aString
object.addr
- aInetAddress
object.- Returns:
- a
PollableService
object.
-
visitThis
protected void visitThis(PollableVisitor v)
visitThis
- Overrides:
visitThis
in classPollableContainer
- Parameters:
v
- aPollableVisitor
object.
-
createDownEvent
public Event createDownEvent(java.util.Date date)
createDownEvent
- Specified by:
createDownEvent
in classPollableElement
- Parameters:
date
- aDate
object.- Returns:
- a
Event
object.
-
createUpEvent
public Event createUpEvent(java.util.Date date)
createUpEvent
- Specified by:
createUpEvent
in classPollableElement
- Parameters:
date
- aDate
object.- Returns:
- a
Event
object.
-
toString
public java.lang.String toString()
toString
- Overrides:
toString
in classjava.lang.Object
- Returns:
- a
String
object.
-
getLockRoot
protected PollableElement getLockRoot()
getLockRoot
- Overrides:
getLockRoot
in classPollableElement
- Returns:
- a
PollableElement
object.
-
obtainTreeLock
protected void obtainTreeLock()
This method does not have a timeout, it blocks indefinitely until the lock is obtained.- Overrides:
obtainTreeLock
in classPollableElement
-
obtainTreeLock
protected void obtainTreeLock(long timeout) throws LockUnavailable
This method tries to obtain the lock within the given timeout.- Overrides:
obtainTreeLock
in classPollableElement
- Parameters:
Timeout
- in milliseconds- Throws:
LockUnavailable
- If the lock cannot be acquired before the timeout or the thread is interrupted while trying to acquire the lock.
-
releaseTreeLock
protected void releaseTreeLock()
releaseTreeLock
- Overrides:
releaseTreeLock
in classPollableElement
-
doPoll
public PollStatus doPoll(PollableElement elem)
doPoll
- Overrides:
doPoll
in classPollableElement
- Returns:
- a
PollStatus
object.
-
-