public abstract class AbstractCollectionResource extends Object implements CollectionResource
CollectionResource
objects, implementing common features (to reduce repeated code).
Typically used by the non-SNMP collectors (SNMP has it's own set of classes for this). Provides a basic set of attributes.
Provides support, via addAttribute(CollectionAttribute)
and getGroup(AttributeGroupType)
for basic
"groups" of attributes. Also provides a sample "visit" implementation based on those groups, although this may well
be overridden by subclasses.Modifier and Type | Field and Description |
---|---|
protected CollectionAgent |
m_agent |
RESOURCE_TYPE_IF, RESOURCE_TYPE_LATENCY, RESOURCE_TYPE_NODE
Modifier | Constructor and Description |
---|---|
protected |
AbstractCollectionResource(CollectionAgent agent)
Constructor for AbstractCollectionResource.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(CollectionAttribute attr)
Adds the given attribute into the collection for this resource
|
AttributeGroup |
getGroup(AttributeGroupType groupType)
Finds, or creates, and returns the AttributeGroup for the given group Type
|
String |
getInterfaceLabel()
getInterfaceLabel
|
String |
getOwnerName()
getOwnerName
|
ResourcePath |
getParent()
Returns the name of the parent resource.
|
ResourcePath |
getPath()
Retrieves path for the resource, relative to the root of the
associated
RrdRepository . |
TimeKeeper |
getTimeKeeper()
Returns a not-null
TimeKeeper instance when this resource requires to use a special timestamp when updating RRDs/JRBs. |
boolean |
rescanNeeded()
rescanNeeded
|
boolean |
shouldPersist(ServiceParameters params)
Resources should be persisted by default.
|
void |
visit(CollectionSetVisitor visitor)
Provide a way to visit all the values in the CollectionSet, for any appropriate purposes (persisting, thresholding, or others)
The expectation is that calling this method will ultimately call visitResource, visitGroup and visitAttribute (as appropriate)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInstance, getResourceTypeName, getUnmodifiedInstance
protected final CollectionAgent m_agent
protected AbstractCollectionResource(CollectionAgent agent)
Constructor for AbstractCollectionResource.
agent
- a CollectionAgent
object.public final String getOwnerName()
getOwnerName
getOwnerName
in interface ResourceIdentifier
String
object.public ResourcePath getPath()
RrdRepository
.getPath
in interface ResourceIdentifier
ResourcePath
object.public final void addAttribute(CollectionAttribute attr)
attr
- The Attribute to addpublic final AttributeGroup getGroup(AttributeGroupType groupType)
groupType
- a AttributeGroupType
object.AttributeGroup
object.public void visit(CollectionSetVisitor visitor)
visit
in interface CollectionVisitable
visitor
- a CollectionSetVisitor
object.public final ResourcePath getParent()
CollectionResource
getParent
in interface CollectionResource
String
object.public final boolean rescanNeeded()
rescanNeeded
rescanNeeded
in interface CollectionResource
public boolean shouldPersist(ServiceParameters params)
shouldPersist
in interface Persistable
params
- a ServiceParameters
object.public String getInterfaceLabel()
getInterfaceLabel
getInterfaceLabel
in interface CollectionResource
String
object.public TimeKeeper getTimeKeeper()
CollectionResource
TimeKeeper
instance when this resource requires to use a special timestamp when updating RRDs/JRBs.
If the resource doesn't need a special TimeKeeper
it should return null.getTimeKeeper
in interface CollectionResource
DefaultTimeKeeper
should be used.Copyright © 2021. All rights reserved.