org.opennms.netmgt.config.datacollection
Class SnmpCollection

java.lang.Object
  extended by org.opennms.netmgt.config.datacollection.SnmpCollection
All Implemented Interfaces:
Serializable

public class SnmpCollection
extends Object
implements Serializable

a grouping of SNMP related RRD parms, MIB object groups and sysoid based system definitions.

Version:
$Revision$ $Date$
See Also:
Serialized Form

Constructor Summary
SnmpCollection()
           
 
Method Summary
 void addResourceType(int index, ResourceType vResourceType)
           
 void addResourceType(ResourceType vResourceType)
           
 void deleteMaxVarsPerPdu()
           
 Enumeration<ResourceType> enumerateResourceType()
          Method enumerateResourceType.
 Groups getGroups()
          Returns the value of field 'groups'.
 int getMaxVarsPerPdu()
          Returns the value of field 'maxVarsPerPdu'.
 String getName()
          Returns the value of field 'name'.
 ResourceType[] getResourceType()
          Method getResourceType.Returns the contents of the collection in an Array.
 ResourceType getResourceType(int index)
          Method getResourceType.
 List<ResourceType> getResourceTypeCollection()
          Method getResourceTypeCollection.Returns a reference to '_resourceTypeList'.
 int getResourceTypeCount()
          Method getResourceTypeCount.
 Rrd getRrd()
          Returns the value of field 'rrd'.
 String getSnmpStorageFlag()
          Returns the value of field 'snmpStorageFlag'.
 Systems getSystems()
          Returns the value of field 'systems'.
 boolean hasMaxVarsPerPdu()
          Method hasMaxVarsPerPdu.
 boolean isValid()
          Method isValid.
 Iterator<ResourceType> iterateResourceType()
          Method iterateResourceType.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void removeAllResourceType()
           
 boolean removeResourceType(ResourceType vResourceType)
          Method removeResourceType.
 ResourceType removeResourceTypeAt(int index)
          Method removeResourceTypeAt.
 void setGroups(Groups groups)
          Sets the value of field 'groups'.
 void setMaxVarsPerPdu(int maxVarsPerPdu)
          Sets the value of field 'maxVarsPerPdu'.
 void setName(String name)
          Sets the value of field 'name'.
 void setResourceType(int index, ResourceType vResourceType)
           
 void setResourceType(List<ResourceType> vResourceTypeList)
          Sets the value of '_resourceTypeList' by copying the given Vector.
 void setResourceType(ResourceType[] vResourceTypeArray)
           
 void setResourceTypeCollection(List<ResourceType> resourceTypeList)
          Deprecated.  
 void setRrd(Rrd rrd)
          Sets the value of field 'rrd'.
 void setSnmpStorageFlag(String snmpStorageFlag)
          Sets the value of field 'snmpStorageFlag'.
 void setSystems(Systems systems)
          Sets the value of field 'systems'.
static SnmpCollection unmarshal(Reader reader)
          Method unmarshal.
 void validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SnmpCollection

public SnmpCollection()
Method Detail

addResourceType

public void addResourceType(ResourceType vResourceType)
                     throws IndexOutOfBoundsException
Parameters:
vResourceType -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addResourceType

public void addResourceType(int index,
                            ResourceType vResourceType)
                     throws IndexOutOfBoundsException
Parameters:
index -
vResourceType -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

deleteMaxVarsPerPdu

public void deleteMaxVarsPerPdu()

enumerateResourceType

public Enumeration<ResourceType> enumerateResourceType()
Method enumerateResourceType.

Returns:
an Enumeration over all possible elements of this collection

getGroups

public Groups getGroups()
Returns the value of field 'groups'. The field 'groups' has the following description: MIB object groups

Returns:
the value of field 'Groups'.

getMaxVarsPerPdu

public int getMaxVarsPerPdu()
Returns the value of field 'maxVarsPerPdu'. The field 'maxVarsPerPdu' has the following description: Specifies the maximum number of variables that may be encoded into an individual SNMP pdu request by Collectd. Provides a means to limit the size of outgoing PDU requests. Value of 0 indicates no limit on number of PDUs which can be encoded into a single PDU.

Returns:
the value of field 'MaxVarsPerPdu'.

getName

public String getName()
Returns the value of field 'name'. The field 'name' has the following description: collector name

Returns:
the value of field 'Name'.

getResourceType

public ResourceType getResourceType(int index)
                             throws IndexOutOfBoundsException
Method getResourceType.

Parameters:
index -
Returns:
the value of the org.opennms.netmgt.config.datacollection.ResourceType at the given index
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

getResourceType

public ResourceType[] getResourceType()
Method getResourceType.Returns the contents of the collection in an Array.

Note: Just in case the collection contents are changing in another thread, we pass a 0-length Array of the correct type into the API call. This way we know that the Array returned is of exactly the correct length.

Returns:
this collection as an Array

getResourceTypeCollection

public List<ResourceType> getResourceTypeCollection()
Method getResourceTypeCollection.Returns a reference to '_resourceTypeList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getResourceTypeCount

public int getResourceTypeCount()
Method getResourceTypeCount.

Returns:
the size of this collection

getRrd

public Rrd getRrd()
Returns the value of field 'rrd'. The field 'rrd' has the following description: RRD parms

Returns:
the value of field 'Rrd'.

getSnmpStorageFlag

public String getSnmpStorageFlag()
Returns the value of field 'snmpStorageFlag'. The field 'snmpStorageFlag' has the following description: indicates if collected SNMP data is to be stored for "all" interfaces or only for the "primary" interface.

Returns:
the value of field 'SnmpStorageFlag'.

getSystems

public Systems getSystems()
Returns the value of field 'systems'. The field 'systems' has the following description: sysOid-based sytems

Returns:
the value of field 'Systems'.

hasMaxVarsPerPdu

public boolean hasMaxVarsPerPdu()
Method hasMaxVarsPerPdu.

Returns:
true if at least one MaxVarsPerPdu has been added

isValid

public boolean isValid()
Method isValid.

Returns:
true if this object is valid according to the schema

iterateResourceType

public Iterator<ResourceType> iterateResourceType()
Method iterateResourceType.

Returns:
an Iterator over all possible elements in this collection

marshal

public void marshal(Writer out)
             throws org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Parameters:
out -
Throws:
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema

marshal

public void marshal(ContentHandler handler)
             throws IOException,
                    org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Parameters:
handler -
Throws:
IOException - if an IOException occurs during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling

removeAllResourceType

public void removeAllResourceType()

removeResourceType

public boolean removeResourceType(ResourceType vResourceType)
Method removeResourceType.

Parameters:
vResourceType -
Returns:
true if the object was removed from the collection.

removeResourceTypeAt

public ResourceType removeResourceTypeAt(int index)
Method removeResourceTypeAt.

Parameters:
index -
Returns:
the element removed from the collection

setGroups

public void setGroups(Groups groups)
Sets the value of field 'groups'. The field 'groups' has the following description: MIB object groups

Parameters:
groups - the value of field 'groups'.

setMaxVarsPerPdu

public void setMaxVarsPerPdu(int maxVarsPerPdu)
Sets the value of field 'maxVarsPerPdu'. The field 'maxVarsPerPdu' has the following description: Specifies the maximum number of variables that may be encoded into an individual SNMP pdu request by Collectd. Provides a means to limit the size of outgoing PDU requests. Value of 0 indicates no limit on number of PDUs which can be encoded into a single PDU.

Parameters:
maxVarsPerPdu - the value of field 'maxVarsPerPdu'.

setName

public void setName(String name)
Sets the value of field 'name'. The field 'name' has the following description: collector name

Parameters:
name - the value of field 'name'.

setResourceType

public void setResourceType(int index,
                            ResourceType vResourceType)
                     throws IndexOutOfBoundsException
Parameters:
index -
vResourceType -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setResourceType

public void setResourceType(ResourceType[] vResourceTypeArray)
Parameters:
vResourceTypeArray -

setResourceType

public void setResourceType(List<ResourceType> vResourceTypeList)
Sets the value of '_resourceTypeList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vResourceTypeList - the Vector to copy.

setResourceTypeCollection

public void setResourceTypeCollection(List<ResourceType> resourceTypeList)
Deprecated. 

Sets the value of '_resourceTypeList' by setting it to the given Vector. No type checking is performed.

Parameters:
resourceTypeList - the Vector to set.

setRrd

public void setRrd(Rrd rrd)
Sets the value of field 'rrd'. The field 'rrd' has the following description: RRD parms

Parameters:
rrd - the value of field 'rrd'.

setSnmpStorageFlag

public void setSnmpStorageFlag(String snmpStorageFlag)
Sets the value of field 'snmpStorageFlag'. The field 'snmpStorageFlag' has the following description: indicates if collected SNMP data is to be stored for "all" interfaces or only for the "primary" interface.

Parameters:
snmpStorageFlag - the value of field 'snmpStorageFlag'.

setSystems

public void setSystems(Systems systems)
Sets the value of field 'systems'. The field 'systems' has the following description: sysOid-based sytems

Parameters:
systems - the value of field 'systems'.

unmarshal

public static SnmpCollection unmarshal(Reader reader)
                                throws org.exolab.castor.xml.MarshalException,
                                       org.exolab.castor.xml.ValidationException
Method unmarshal.

Parameters:
reader -
Returns:
the unmarshaled org.opennms.netmgt.config.datacollection.SnmpCollection
Throws:
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema

validate

public void validate()
              throws org.exolab.castor.xml.ValidationException
Throws:
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema


Copyright ? 2008. All Rights Reserved.