org.opennms.netmgt.config.snmp
Class Definition

java.lang.Object
  extended by org.opennms.netmgt.config.snmp.Configuration
      extended by org.opennms.netmgt.config.snmp.Definition
All Implemented Interfaces:
Serializable

public class Definition
extends Configuration
implements Serializable

Provides a mechanism for associating one or more specific IP addresses and/or IP address ranges with a set of SNMP parms which will be used in place of the default values during SNMP data collection.

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

Constructor Summary
Definition()
           
 
Method Summary
 void addIpMatch(int index, String vIpMatch)
           
 void addIpMatch(String vIpMatch)
           
 void addRange(int index, Range vRange)
           
 void addRange(Range vRange)
           
 void addSpecific(int index, String vSpecific)
           
 void addSpecific(String vSpecific)
           
 Enumeration<String> enumerateIpMatch()
          Method enumerateIpMatch.
 Enumeration<Range> enumerateRange()
          Method enumerateRange.
 Enumeration<String> enumerateSpecific()
          Method enumerateSpecific.
 boolean equals(Object obj)
          Overrides the java.lang.Object.equals method.
 String[] getIpMatch()
          Method getIpMatch.Returns the contents of the collection in an Array.
 String getIpMatch(int index)
          Method getIpMatch.
 List<String> getIpMatchCollection()
          Method getIpMatchCollection.Returns a reference to '_ipMatchList'.
 int getIpMatchCount()
          Method getIpMatchCount.
 Range[] getRange()
          Method getRange.Returns the contents of the collection in an Array.
 Range getRange(int index)
          Method getRange.
 List<Range> getRangeCollection()
          Method getRangeCollection.Returns a reference to '_rangeList'.
 int getRangeCount()
          Method getRangeCount.
 String[] getSpecific()
          Method getSpecific.Returns the contents of the collection in an Array.
 String getSpecific(int index)
          Method getSpecific.
 List<String> getSpecificCollection()
          Method getSpecificCollection.Returns a reference to '_specificList'.
 int getSpecificCount()
          Method getSpecificCount.
 int hashCode()
          Overrides the java.lang.Object.hashCode method.
 boolean isValid()
          Method isValid.
 Iterator<String> iterateIpMatch()
          Method iterateIpMatch.
 Iterator<Range> iterateRange()
          Method iterateRange.
 Iterator<String> iterateSpecific()
          Method iterateSpecific.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void removeAllIpMatch()
           
 void removeAllRange()
           
 void removeAllSpecific()
           
 boolean removeIpMatch(String vIpMatch)
          Method removeIpMatch.
 String removeIpMatchAt(int index)
          Method removeIpMatchAt.
 boolean removeRange(Range vRange)
          Method removeRange.
 Range removeRangeAt(int index)
          Method removeRangeAt.
 boolean removeSpecific(String vSpecific)
          Method removeSpecific.
 String removeSpecificAt(int index)
          Method removeSpecificAt.
 void setIpMatch(int index, String vIpMatch)
           
 void setIpMatch(List<String> vIpMatchList)
          Sets the value of '_ipMatchList' by copying the given Vector.
 void setIpMatch(String[] vIpMatchArray)
           
 void setIpMatchCollection(List<String> ipMatchList)
          Deprecated.  
 void setRange(int index, Range vRange)
           
 void setRange(List<Range> vRangeList)
          Sets the value of '_rangeList' by copying the given Vector.
 void setRange(Range[] vRangeArray)
           
 void setRangeCollection(List<Range> rangeList)
          Deprecated.  
 void setSpecific(int index, String vSpecific)
           
 void setSpecific(List<String> vSpecificList)
          Sets the value of '_specificList' by copying the given Vector.
 void setSpecific(String[] vSpecificArray)
           
 void setSpecificCollection(List<String> specificList)
          Deprecated.  
static Configuration unmarshal(Reader reader)
          Method unmarshal.
 void validate()
           
 
Methods inherited from class org.opennms.netmgt.config.snmp.Configuration
deleteMaxRepetitions, deleteMaxRequestSize, deleteMaxVarsPerPdu, deletePort, deleteRetry, deleteSecurityLevel, deleteTimeout, getAuthPassphrase, getAuthProtocol, getContextEngineId, getContextName, getEngineId, getEnterpriseId, getMaxRepetitions, getMaxRequestSize, getMaxVarsPerPdu, getPort, getPrivacyPassphrase, getPrivacyProtocol, getProxyHost, getReadCommunity, getRetry, getSecurityLevel, getSecurityName, getTimeout, getVersion, getWriteCommunity, hasMaxRepetitions, hasMaxRequestSize, hasMaxVarsPerPdu, hasPort, hasRetry, hasSecurityLevel, hasTimeout, setAuthPassphrase, setAuthProtocol, setContextEngineId, setContextName, setEngineId, setEnterpriseId, setMaxRepetitions, setMaxRequestSize, setMaxVarsPerPdu, setPort, setPrivacyPassphrase, setPrivacyProtocol, setProxyHost, setReadCommunity, setRetry, setSecurityLevel, setSecurityName, setTimeout, setVersion, setWriteCommunity
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Definition

public Definition()
Method Detail

addIpMatch

public void addIpMatch(String vIpMatch)
                throws IndexOutOfBoundsException
Parameters:
vIpMatch -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addIpMatch

public void addIpMatch(int index,
                       String vIpMatch)
                throws IndexOutOfBoundsException
Parameters:
index -
vIpMatch -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addRange

public void addRange(Range vRange)
              throws IndexOutOfBoundsException
Parameters:
vRange -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addRange

public void addRange(int index,
                     Range vRange)
              throws IndexOutOfBoundsException
Parameters:
index -
vRange -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addSpecific

public void addSpecific(String vSpecific)
                 throws IndexOutOfBoundsException
Parameters:
vSpecific -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addSpecific

public void addSpecific(int index,
                        String vSpecific)
                 throws IndexOutOfBoundsException
Parameters:
index -
vSpecific -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

enumerateIpMatch

public Enumeration<String> enumerateIpMatch()
Method enumerateIpMatch.

Returns:
an Enumeration over all possible elements of this collection

enumerateRange

public Enumeration<Range> enumerateRange()
Method enumerateRange.

Returns:
an Enumeration over all possible elements of this collection

enumerateSpecific

public Enumeration<String> enumerateSpecific()
Method enumerateSpecific.

Returns:
an Enumeration over all possible elements of this collection

equals

public boolean equals(Object obj)
Overrides the java.lang.Object.equals method.

Overrides:
equals in class Configuration
Parameters:
obj -
Returns:
true if the objects are equal.

getIpMatch

public String getIpMatch(int index)
                  throws IndexOutOfBoundsException
Method getIpMatch.

Parameters:
index -
Returns:
the value of the java.lang.String at the given index
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

getIpMatch

public String[] getIpMatch()
Method getIpMatch.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

getIpMatchCollection

public List<String> getIpMatchCollection()
Method getIpMatchCollection.Returns a reference to '_ipMatchList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getIpMatchCount

public int getIpMatchCount()
Method getIpMatchCount.

Returns:
the size of this collection

getRange

public Range getRange(int index)
               throws IndexOutOfBoundsException
Method getRange.

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

getRange

public Range[] getRange()
Method getRange.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

getRangeCollection

public List<Range> getRangeCollection()
Method getRangeCollection.Returns a reference to '_rangeList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getRangeCount

public int getRangeCount()
Method getRangeCount.

Returns:
the size of this collection

getSpecific

public String getSpecific(int index)
                   throws IndexOutOfBoundsException
Method getSpecific.

Parameters:
index -
Returns:
the value of the java.lang.String at the given index
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

getSpecific

public String[] getSpecific()
Method getSpecific.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

getSpecificCollection

public List<String> getSpecificCollection()
Method getSpecificCollection.Returns a reference to '_specificList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getSpecificCount

public int getSpecificCount()
Method getSpecificCount.

Returns:
the size of this collection

hashCode

public int hashCode()
Overrides the java.lang.Object.hashCode method.

The following steps came from Effective Java Programming Language Guide by Joshua Bloch, Chapter 3

Overrides:
hashCode in class Configuration
Returns:
a hash code value for the object.

isValid

public boolean isValid()
Method isValid.

Overrides:
isValid in class Configuration
Returns:
true if this object is valid according to the schema

iterateIpMatch

public Iterator<String> iterateIpMatch()
Method iterateIpMatch.

Returns:
an Iterator over all possible elements in this collection

iterateRange

public Iterator<Range> iterateRange()
Method iterateRange.

Returns:
an Iterator over all possible elements in this collection

iterateSpecific

public Iterator<String> iterateSpecific()
Method iterateSpecific.

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
Overrides:
marshal in class Configuration
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
Overrides:
marshal in class Configuration
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

removeAllIpMatch

public void removeAllIpMatch()

removeAllRange

public void removeAllRange()

removeAllSpecific

public void removeAllSpecific()

removeIpMatch

public boolean removeIpMatch(String vIpMatch)
Method removeIpMatch.

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

removeIpMatchAt

public String removeIpMatchAt(int index)
Method removeIpMatchAt.

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

removeRange

public boolean removeRange(Range vRange)
Method removeRange.

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

removeRangeAt

public Range removeRangeAt(int index)
Method removeRangeAt.

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

removeSpecific

public boolean removeSpecific(String vSpecific)
Method removeSpecific.

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

removeSpecificAt

public String removeSpecificAt(int index)
Method removeSpecificAt.

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

setIpMatch

public void setIpMatch(int index,
                       String vIpMatch)
                throws IndexOutOfBoundsException
Parameters:
index -
vIpMatch -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setIpMatch

public void setIpMatch(String[] vIpMatchArray)
Parameters:
vIpMatchArray -

setIpMatch

public void setIpMatch(List<String> vIpMatchList)
Sets the value of '_ipMatchList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vIpMatchList - the Vector to copy.

setIpMatchCollection

public void setIpMatchCollection(List<String> ipMatchList)
Deprecated. 

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

Parameters:
ipMatchList - the Vector to set.

setRange

public void setRange(int index,
                     Range vRange)
              throws IndexOutOfBoundsException
Parameters:
index -
vRange -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setRange

public void setRange(Range[] vRangeArray)
Parameters:
vRangeArray -

setRange

public void setRange(List<Range> vRangeList)
Sets the value of '_rangeList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vRangeList - the Vector to copy.

setRangeCollection

public void setRangeCollection(List<Range> rangeList)
Deprecated. 

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

Parameters:
rangeList - the Vector to set.

setSpecific

public void setSpecific(int index,
                        String vSpecific)
                 throws IndexOutOfBoundsException
Parameters:
index -
vSpecific -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setSpecific

public void setSpecific(String[] vSpecificArray)
Parameters:
vSpecificArray -

setSpecific

public void setSpecific(List<String> vSpecificList)
Sets the value of '_specificList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vSpecificList - the Vector to copy.

setSpecificCollection

public void setSpecificCollection(List<String> specificList)
Deprecated. 

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

Parameters:
specificList - the Vector to set.

unmarshal

public static Configuration 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.snmp.Configuration
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
Overrides:
validate in class Configuration
Throws:
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema


Copyright © 2011. All Rights Reserved.