org.opennms.netmgt.collectd
Class AbstractCollectionResource

java.lang.Object
  extended by org.opennms.netmgt.collectd.AbstractCollectionResource
All Implemented Interfaces:
CollectionResource, ResourceIdentifier
Direct Known Subclasses:
JdbcCollectionResource, WmiCollectionResource

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

Version:
$Id: $
Author:
opennms

Field Summary
protected  CollectionAgent m_agent
           
 
Constructor Summary
protected AbstractCollectionResource(CollectionAgent agent)
          Constructor for AbstractCollectionResource.
 
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 getLabel()
          getLabel
 String getOwnerName()
          getOwnerName
 File getResourceDir(RrdRepository repository)
          getResourceDir
abstract  int getType()
          getType
abstract  boolean rescanNeeded()
          rescanNeeded
abstract  boolean shouldPersist(ServiceParameters params)
          shouldPersist
 void visit(CollectionSetVisitor visitor)
          visit
 
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)

Constructor for AbstractCollectionResource.

Parameters:
agent - a CollectionAgent object.
Method Detail

getOwnerName

public String getOwnerName()

getOwnerName

Specified by:
getOwnerName in interface ResourceIdentifier
Returns:
a String object.

getResourceDir

public File getResourceDir(RrdRepository repository)

getResourceDir

Specified by:
getResourceDir in interface ResourceIdentifier
Parameters:
repository - a RrdRepository object.
Returns:
a File object.

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 - a AttributeGroupType object.
Returns:
a AttributeGroup object.

visit

public void visit(CollectionSetVisitor visitor)

visit

Specified by:
visit in interface CollectionResource
Parameters:
visitor - a CollectionSetVisitor object.

getType

public abstract int getType()

getType

Specified by:
getType in interface CollectionResource
Returns:
a int.

rescanNeeded

public abstract boolean rescanNeeded()

rescanNeeded

Specified by:
rescanNeeded in interface CollectionResource
Returns:
a boolean.

shouldPersist

public abstract boolean shouldPersist(ServiceParameters params)

shouldPersist

Specified by:
shouldPersist in interface CollectionResource
Parameters:
params - a ServiceParameters object.
Returns:
a boolean.

getLabel

public String getLabel()

getLabel

Specified by:
getLabel in interface CollectionResource
Returns:
a String object.


Copyright © 2011. All Rights Reserved.