Class PollableContainer
- java.lang.Object
-
- org.opennms.netmgt.poller.pollables.PollableElement
-
- org.opennms.netmgt.poller.pollables.PollableContainer
-
- Direct Known Subclasses:
PollableInterface
,PollableNetwork
,PollableNode
public abstract class PollableContainer extends PollableElement
Represents a PollableContainer- Version:
- $Id: $
- Author:
- Mathew Brozowski
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
PollableContainer.Accumulator<T>
protected static interface
PollableContainer.Iter
protected class
PollableContainer.SimpleIter<T>
-
Constructor Summary
Constructors Constructor Description PollableContainer(PollableContainer parent, Scope scope)
Constructor for PollableContainer.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addMember(PollableElement member)
addMemberprotected abstract java.lang.Object
createMemberKey(PollableElement member)
createMemberKeyvoid
delete()
deletevoid
deleteMember(PollableElement member)
deleteMemberprotected <T> T
deriveValueFromMembers(boolean withTreeLock, PollableContainer.SimpleIter<T> iter)
deriveValueFromMembersprotected <T> T
deriveValueFromMembers(PollableContainer.SimpleIter<T> iter)
deriveValueFromMembersprotected PollEvent
doExtrapolateCause()
doExtrapolateCauseprotected void
doInheritParentalCause()
doInheritParentalCauseprotected void
forEachMember(boolean withTreeLock, PollableContainer.Iter iter)
forEachMemberprotected void
forEachMember(PollableContainer.Iter iter)
forEachMemberprotected PollableElement
getMember(java.lang.Object key)
getMemberprotected int
getMemberCount()
getMemberCountprotected java.util.Collection<PollableElement>
getMembers()
getMembersPollStatus
getMemberStatus()
getMemberStatusPollStatus
poll()
pollprotected PollStatus
poll(PollableElement elem)
pollPollStatus
pollRemainingMembers(PollableElement member)
pollRemainingMembersprotected void
processCause(PollEvent cause)
processCausevoid
processMemberStatusChanges(java.util.Date date)
processMemberStatusChangesprotected void
processResolution(PollEvent resolvedCause, PollEvent resolution)
processResolutionvoid
processStatusChange(java.util.Date date)
processStatusChangevoid
recalculateStatus()
recalculateStatusvoid
removeMember(PollableElement member)
removeMembervoid
resetStatusChanged()
resetStatusChangedprotected void
resolveAllOutages(PollEvent resolvedCause, PollEvent resolution)
resolveAllOutagesPollableElement
selectPollElement()
selectPollElementvoid
visit(PollableVisitor v)
visitprotected void
visitMembers(PollableVisitor v)
visitMembersprotected void
visitThis(PollableVisitor v)
visitThis-
Methods inherited from class org.opennms.netmgt.poller.pollables.PollableElement
createDownEvent, createOutage, createUpEvent, doPoll, extrapolateCause, getCause, getContext, getLockRoot, getParent, getScope, getStatus, hasOpenOutage, inheritParentalCause, isDeleted, isStatusChanged, obtainTreeLock, obtainTreeLock, processComingUp, processGoingDown, processLingeringCauses, releaseTreeLock, resolveOutage, setCause, setParent, updateStatus, withTreeLock, withTreeLock, withTreeLock, withTreeLock
-
-
-
-
Constructor Detail
-
PollableContainer
public PollableContainer(PollableContainer parent, Scope scope)
Constructor for PollableContainer.
- Parameters:
parent
- aPollableContainer
object.scope
- aScope
object.
-
-
Method Detail
-
getMember
protected PollableElement getMember(java.lang.Object key)
getMember
- Parameters:
key
- aObject
object.- Returns:
- a
PollableElement
object.
-
getMemberCount
protected int getMemberCount()
getMemberCount
- Returns:
- a int.
-
getMembers
protected java.util.Collection<PollableElement> getMembers()
getMembers
- Returns:
- a
Collection
object.
-
createMemberKey
protected abstract java.lang.Object createMemberKey(PollableElement member)
createMemberKey
- Parameters:
member
- aPollableElement
object.- Returns:
- a
Object
object.
-
addMember
protected void addMember(PollableElement member)
addMember
- Parameters:
member
- aPollableElement
object.
-
removeMember
public void removeMember(PollableElement member)
removeMember
- Parameters:
member
- aPollableElement
object.
-
deleteMember
public void deleteMember(PollableElement member)
deleteMember
- Parameters:
member
- aPollableElement
object.
-
delete
public void delete()
delete
- Overrides:
delete
in classPollableElement
-
visit
public void visit(PollableVisitor v)
visit
- Overrides:
visit
in classPollableElement
- Parameters:
v
- aPollableVisitor
object.
-
visitThis
protected void visitThis(PollableVisitor v)
visitThis
- Overrides:
visitThis
in classPollableElement
- Parameters:
v
- aPollableVisitor
object.
-
visitMembers
protected void visitMembers(PollableVisitor v)
visitMembers
- Parameters:
v
- aPollableVisitor
object.
-
forEachMember
protected void forEachMember(PollableContainer.Iter iter)
forEachMember
- Parameters:
iter
- aPollableContainer.Iter
object.
-
deriveValueFromMembers
protected <T> T deriveValueFromMembers(PollableContainer.SimpleIter<T> iter)
deriveValueFromMembers
- Type Parameters:
T
- a T object.- Parameters:
iter
- aPollableContainer.SimpleIter
object.- Returns:
- a T object.
-
deriveValueFromMembers
protected <T> T deriveValueFromMembers(boolean withTreeLock, PollableContainer.SimpleIter<T> iter)
deriveValueFromMembers
- Type Parameters:
T
- a T object.- Parameters:
withTreeLock
- a boolean.iter
- aPollableContainer.SimpleIter
object.- Returns:
- a T object.
-
forEachMember
protected void forEachMember(boolean withTreeLock, PollableContainer.Iter iter)
forEachMember
- Parameters:
withTreeLock
- a boolean.iter
- aPollableContainer.Iter
object.
-
recalculateStatus
public void recalculateStatus()
recalculateStatus
- Overrides:
recalculateStatus
in classPollableElement
-
resetStatusChanged
public void resetStatusChanged()
resetStatusChanged
- Overrides:
resetStatusChanged
in classPollableElement
-
poll
protected PollStatus poll(PollableElement elem)
poll
- Overrides:
poll
in classPollableElement
- Returns:
- a
PollStatus
object.
-
pollRemainingMembers
public PollStatus pollRemainingMembers(PollableElement member)
pollRemainingMembers
- Parameters:
member
- aPollableElement
object.- Returns:
- a
PollStatus
object.
-
getMemberStatus
public PollStatus getMemberStatus()
getMemberStatus
- Returns:
- a
PollStatus
object.
-
poll
public PollStatus poll()
poll
- Specified by:
poll
in classPollableElement
- Returns:
- a
PollStatus
object.
-
selectPollElement
public PollableElement selectPollElement()
selectPollElement
- Overrides:
selectPollElement
in classPollableElement
- Returns:
- a
PollableElement
object.
-
processStatusChange
public void processStatusChange(java.util.Date date)
processStatusChange
- Overrides:
processStatusChange
in classPollableElement
- Parameters:
date
- aDate
object.
-
processMemberStatusChanges
public void processMemberStatusChanges(java.util.Date date)
processMemberStatusChanges
- Parameters:
date
- aDate
object.
-
processResolution
protected void processResolution(PollEvent resolvedCause, PollEvent resolution)
processResolution
- Overrides:
processResolution
in classPollableElement
- Parameters:
resolvedCause
- aPollEvent
object.resolution
- aPollEvent
object.
-
processCause
protected void processCause(PollEvent cause)
processCause
- Overrides:
processCause
in classPollableElement
- Parameters:
cause
- aPollEvent
object.
-
resolveAllOutages
protected void resolveAllOutages(PollEvent resolvedCause, PollEvent resolution)
resolveAllOutages
- Overrides:
resolveAllOutages
in classPollableElement
- Parameters:
resolvedCause
- aPollEvent
object.resolution
- aPollEvent
object.
-
doExtrapolateCause
protected PollEvent doExtrapolateCause()
doExtrapolateCause
- Overrides:
doExtrapolateCause
in classPollableElement
- Returns:
- a
PollEvent
object.
-
doInheritParentalCause
protected void doInheritParentalCause()
doInheritParentalCause
- Overrides:
doInheritParentalCause
in classPollableElement
-
-