org.opennms.netmgt.collectd
Class AbstractCollectionResource

java.lang.Object
  extended by org.opennms.netmgt.collectd.AbstractCollectionResource
All Implemented Interfaces:
CollectionResource, ResourceIdentifier

public abstract class AbstractCollectionResource
extends Object
implements CollectionResource

A base (partial) implementation of CollectionResource, 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 group of ag Provides support, via addAttribute, getGroup, and getGroups, for basic "groups" of attributes. Also provides a sample "visit" implementation based on those groups, although this may well be overridden by subclasses

Author:
opennms

Field Summary
protected  CollectionAgent m_agent
           
 
Constructor Summary
protected AbstractCollectionResource(CollectionAgent agent)
           
 
Method Summary
protected  void addAttribute(CollectionAttribute attr)
          Adds the given attribute into the collection for this resource
protected  AttributeGroup getGroup(AttributeGroupType groupType)
          Finds, or creates, and returns the AttributeGroup for the given group Type
 String getOwnerName()
           
 File getResourceDir(RrdRepository repository)
           
abstract  int getType()
          Returns something like an ifType; is (but not sure if it should be) -1 for non interface type collections, otherwise the SNMP type of the interface.
abstract  boolean rescanNeeded()
           
abstract  boolean shouldPersist(ServiceParameters params)
           
 void visit(CollectionSetVisitor visitor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opennms.netmgt.collectd.CollectionResource
getInstance, getResourceTypeName
 

Field Detail

m_agent

protected CollectionAgent m_agent
Constructor Detail

AbstractCollectionResource

protected AbstractCollectionResource(CollectionAgent agent)
Method Detail

getOwnerName

public String getOwnerName()
Specified by:
getOwnerName in interface ResourceIdentifier

getResourceDir

public File getResourceDir(RrdRepository repository)
Specified by:
getResourceDir in interface ResourceIdentifier

addAttribute

protected void addAttribute(CollectionAttribute attr)
Adds the given attribute into the collection for this resource

Parameters:
attr - The Attribute to add

getGroup

protected AttributeGroup getGroup(AttributeGroupType groupType)
Finds, or creates, and returns the AttributeGroup for the given group Type

Parameters:
groupType -
Returns:

visit

public void visit(CollectionSetVisitor visitor)
Specified by:
visit in interface CollectionResource

getType

public abstract int getType()
Description copied from interface: CollectionResource
Returns something like an ifType; is (but not sure if it should be) -1 for non interface type collections, otherwise the SNMP type of the interface. Relates to ifType in datacollection-config.xml

Specified by:
getType in interface CollectionResource
Returns:

rescanNeeded

public abstract boolean rescanNeeded()
Specified by:
rescanNeeded in interface CollectionResource

shouldPersist

public abstract boolean shouldPersist(ServiceParameters params)
Specified by:
shouldPersist in interface CollectionResource


Copyright © 2009. All Rights Reserved.