org.opennms.netmgt.config.snmp
Class SnmpConfig

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

public class SnmpConfig
extends java.lang.Object
implements java.io.Serializable

Top-level element for the snmp-config.xml configuration file.

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

Constructor Summary
SnmpConfig()
           
 
Method Summary
 void addDefinition(Definition vDefinition)
          Method addDefinition
 void addDefinition(int index, Definition vDefinition)
          Method addDefinition
 void clearDefinition()
          Method clearDefinition
 void deleteMaxRepetitions()
          Method deleteMaxRepetitions
 void deleteMaxRequestSize()
          Method deleteMaxRequestSize
 void deleteMaxVarsPerPdu()
          Method deleteMaxVarsPerPdu
 void deletePort()
          Method deletePort
 void deleteRetry()
          Method deleteRetry
 void deleteTimeout()
          Method deleteTimeout
 java.util.Enumeration enumerateDefinition()
          Method enumerateDefinition
 java.lang.String getAuthPassphrase()
          Returns the value of field 'authPassphrase'.
 java.lang.String getAuthProtocol()
          Returns the value of field 'authProtocol'.
 java.lang.String getContextEngineId()
          Returns the value of field 'contextEngineId'.
 java.lang.String getContextName()
          Returns the value of field 'contextName'.
 Definition[] getDefinition()
          Method getDefinition
 Definition getDefinition(int index)
          Method getDefinition
 java.util.ArrayList getDefinitionCollection()
          Method getDefinitionCollection Returns a reference to 'definition'.
 int getDefinitionCount()
          Method getDefinitionCount
 java.lang.String getEngineId()
          Returns the value of field 'engineId'.
 java.lang.String getEnterpriseId()
          Returns the value of field 'enterpriseId'.
 int getMaxRepetitions()
          Returns the value of field 'maxRepetitions'.
 int getMaxRequestSize()
          Returns the value of field 'maxRequestSize'.
 int getMaxVarsPerPdu()
          Returns the value of field 'maxVarsPerPdu'.
 int getPort()
          Returns the value of field 'port'.
 java.lang.String getPrivacyPassphrase()
          Returns the value of field 'privacyPassphrase'.
 java.lang.String getPrivacyProtocol()
          Returns the value of field 'privacyProtocol'.
 java.lang.String getProxyHost()
          Returns the value of field 'proxyHost'.
 java.lang.String getReadCommunity()
          Returns the value of field 'readCommunity'.
 int getRetry()
          Returns the value of field 'retry'.
 java.lang.String getSecurityName()
          Returns the value of field 'securityName'.
 int getTimeout()
          Returns the value of field 'timeout'.
 java.lang.String getVersion()
          Returns the value of field 'version'.
 java.lang.String getWriteCommunity()
          Returns the value of field 'writeCommunity'.
 boolean hasMaxRepetitions()
          Method hasMaxRepetitions
 boolean hasMaxRequestSize()
          Method hasMaxRequestSize
 boolean hasMaxVarsPerPdu()
          Method hasMaxVarsPerPdu
 boolean hasPort()
          Method hasPort
 boolean hasRetry()
          Method hasRetry
 boolean hasTimeout()
          Method hasTimeout
 boolean isValid()
          Method isValid
 void marshal(org.xml.sax.ContentHandler handler)
          Method marshal
 void marshal(java.io.Writer out)
          Method marshal
 boolean removeDefinition(Definition vDefinition)
          Method removeDefinition
 void setAuthPassphrase(java.lang.String authPassphrase)
          Sets the value of field 'authPassphrase'.
 void setAuthProtocol(java.lang.String authProtocol)
          Sets the value of field 'authProtocol'.
 void setContextEngineId(java.lang.String contextEngineId)
          Sets the value of field 'contextEngineId'.
 void setContextName(java.lang.String contextName)
          Sets the value of field 'contextName'.
 void setDefinition(java.util.ArrayList definitionCollection)
          Method setDefinition Sets the value of 'definition' by copying the given ArrayList.
 void setDefinition(Definition[] definitionArray)
          Method setDefinition
 void setDefinition(int index, Definition vDefinition)
          Method setDefinition
 void setDefinitionCollection(java.util.ArrayList definitionCollection)
          Method setDefinitionCollection Sets the value of 'definition' by setting it to the given ArrayList.
 void setEngineId(java.lang.String engineId)
          Sets the value of field 'engineId'.
 void setEnterpriseId(java.lang.String enterpriseId)
          Sets the value of field 'enterpriseId'.
 void setMaxRepetitions(int maxRepetitions)
          Sets the value of field 'maxRepetitions'.
 void setMaxRequestSize(int maxRequestSize)
          Sets the value of field 'maxRequestSize'.
 void setMaxVarsPerPdu(int maxVarsPerPdu)
          Sets the value of field 'maxVarsPerPdu'.
 void setPort(int port)
          Sets the value of field 'port'.
 void setPrivacyPassphrase(java.lang.String privacyPassphrase)
          Sets the value of field 'privacyPassphrase'.
 void setPrivacyProtocol(java.lang.String privacyProtocol)
          Sets the value of field 'privacyProtocol'.
 void setProxyHost(java.lang.String proxyHost)
          Sets the value of field 'proxyHost'.
 void setReadCommunity(java.lang.String readCommunity)
          Sets the value of field 'readCommunity'.
 void setRetry(int retry)
          Sets the value of field 'retry'.
 void setSecurityName(java.lang.String securityName)
          Sets the value of field 'securityName'.
 void setTimeout(int timeout)
          Sets the value of field 'timeout'.
 void setVersion(java.lang.String version)
          Sets the value of field 'version'.
 void setWriteCommunity(java.lang.String writeCommunity)
          Sets the value of field 'writeCommunity'.
static java.lang.Object unmarshal(java.io.Reader reader)
          Method unmarshal
 void validate()
          Method validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SnmpConfig

public SnmpConfig()
Method Detail

addDefinition

public void addDefinition(Definition vDefinition)
                   throws java.lang.IndexOutOfBoundsException
Method addDefinition

Parameters:
vDefinition -
Throws:
java.lang.IndexOutOfBoundsException

addDefinition

public void addDefinition(int index,
                          Definition vDefinition)
                   throws java.lang.IndexOutOfBoundsException
Method addDefinition

Parameters:
index -
vDefinition -
Throws:
java.lang.IndexOutOfBoundsException

clearDefinition

public void clearDefinition()
Method clearDefinition


deleteMaxRepetitions

public void deleteMaxRepetitions()
Method deleteMaxRepetitions


deleteMaxRequestSize

public void deleteMaxRequestSize()
Method deleteMaxRequestSize


deleteMaxVarsPerPdu

public void deleteMaxVarsPerPdu()
Method deleteMaxVarsPerPdu


deletePort

public void deletePort()
Method deletePort


deleteRetry

public void deleteRetry()
Method deleteRetry


deleteTimeout

public void deleteTimeout()
Method deleteTimeout


enumerateDefinition

public java.util.Enumeration enumerateDefinition()
Method enumerateDefinition

Returns:
Enumeration

getAuthPassphrase

public java.lang.String getAuthPassphrase()
Returns the value of field 'authPassphrase'. The field 'authPassphrase' has the following description: SNMPv3

Returns:
String

getAuthProtocol

public java.lang.String getAuthProtocol()
Returns the value of field 'authProtocol'. The field 'authProtocol' has the following description: SNMPv3

Returns:
String

getContextEngineId

public java.lang.String getContextEngineId()
Returns the value of field 'contextEngineId'. The field 'contextEngineId' has the following description: SNMPv3

Returns:
String

getContextName

public java.lang.String getContextName()
Returns the value of field 'contextName'. The field 'contextName' has the following description: SNMPv3

Returns:
String

getDefinition

public Definition getDefinition(int index)
                         throws java.lang.IndexOutOfBoundsException
Method getDefinition

Parameters:
index -
Returns:
Definition
Throws:
java.lang.IndexOutOfBoundsException

getDefinition

public Definition[] getDefinition()
Method getDefinition

Returns:
Definition

getDefinitionCollection

public java.util.ArrayList getDefinitionCollection()
Method getDefinitionCollection Returns a reference to 'definition'. No type checking is performed on any modications to the Collection.

Returns:
ArrayList

getDefinitionCount

public int getDefinitionCount()
Method getDefinitionCount

Returns:
int

getEngineId

public java.lang.String getEngineId()
Returns the value of field 'engineId'. The field 'engineId' has the following description: SNMPv3

Returns:
String

getEnterpriseId

public java.lang.String getEnterpriseId()
Returns the value of field 'enterpriseId'. The field 'enterpriseId' has the following description: SNMPv3

Returns:
String

getMaxRepetitions

public int getMaxRepetitions()
Returns the value of field 'maxRepetitions'. The field 'maxRepetitions' has the following description: Number of repetitions to send per get-bulk request.

Returns:
int

getMaxRequestSize

public int getMaxRequestSize()
Returns the value of field 'maxRequestSize'. The field 'maxRequestSize' has the following description: (SNMP4J specific) Specifies the maximum number of bytes that may be encoded into an individual SNMP PDU request by Collectd. Provides a means to limit the size of outgoing PDU requests. Default is 65535, must be at least 484.

Returns:
int

getMaxVarsPerPdu

public int getMaxVarsPerPdu()
Returns the value of field 'maxVarsPerPdu'. The field 'maxVarsPerPdu' has the following description: Number of variables to send per SNMP request.

Returns:
int

getPort

public int getPort()
Returns the value of field 'port'. The field 'port' has the following description: If set, overrides UDP port 161 as the port where SNMP GET/GETNEXT/GETBULK requests are sent.

Returns:
int

getPrivacyPassphrase

public java.lang.String getPrivacyPassphrase()
Returns the value of field 'privacyPassphrase'. The field 'privacyPassphrase' has the following description: SNMPv3

Returns:
String

getPrivacyProtocol

public java.lang.String getPrivacyProtocol()
Returns the value of field 'privacyProtocol'. The field 'privacyProtocol' has the following description: SNMPv3

Returns:
String

getProxyHost

public java.lang.String getProxyHost()
Returns the value of field 'proxyHost'. The field 'proxyHost' has the following description: The proxy host to use when communiciating with this agent

Returns:
String

getReadCommunity

public java.lang.String getReadCommunity()
Returns the value of field 'readCommunity'. The field 'readCommunity' has the following description: Default read community string

Returns:
String

getRetry

public int getRetry()
Returns the value of field 'retry'. The field 'retry' has the following description: Default number of retries

Returns:
int

getSecurityName

public java.lang.String getSecurityName()
Returns the value of field 'securityName'. The field 'securityName' has the following description: SNMPv3

Returns:
String

getTimeout

public int getTimeout()
Returns the value of field 'timeout'. The field 'timeout' has the following description: Default timeout (in milliseconds)

Returns:
int

getVersion

public java.lang.String getVersion()
Returns the value of field 'version'. The field 'version' has the following description: If set, forces SNMP data collection to the specified version.

Returns:
String

getWriteCommunity

public java.lang.String getWriteCommunity()
Returns the value of field 'writeCommunity'. The field 'writeCommunity' has the following description: Default write community string

Returns:
String

hasMaxRepetitions

public boolean hasMaxRepetitions()
Method hasMaxRepetitions

Returns:
boolean

hasMaxRequestSize

public boolean hasMaxRequestSize()
Method hasMaxRequestSize

Returns:
boolean

hasMaxVarsPerPdu

public boolean hasMaxVarsPerPdu()
Method hasMaxVarsPerPdu

Returns:
boolean

hasPort

public boolean hasPort()
Method hasPort

Returns:
boolean

hasRetry

public boolean hasRetry()
Method hasRetry

Returns:
boolean

hasTimeout

public boolean hasTimeout()
Method hasTimeout

Returns:
boolean

isValid

public boolean isValid()
Method isValid

Returns:
boolean

marshal

public void marshal(java.io.Writer out)
             throws org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Method marshal

Parameters:
out -
Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

marshal

public void marshal(org.xml.sax.ContentHandler handler)
             throws java.io.IOException,
                    org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Method marshal

Parameters:
handler -
Throws:
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

removeDefinition

public boolean removeDefinition(Definition vDefinition)
Method removeDefinition

Parameters:
vDefinition -
Returns:
boolean

setAuthPassphrase

public void setAuthPassphrase(java.lang.String authPassphrase)
Sets the value of field 'authPassphrase'. The field 'authPassphrase' has the following description: SNMPv3

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

setAuthProtocol

public void setAuthProtocol(java.lang.String authProtocol)
Sets the value of field 'authProtocol'. The field 'authProtocol' has the following description: SNMPv3

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

setContextEngineId

public void setContextEngineId(java.lang.String contextEngineId)
Sets the value of field 'contextEngineId'. The field 'contextEngineId' has the following description: SNMPv3

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

setContextName

public void setContextName(java.lang.String contextName)
Sets the value of field 'contextName'. The field 'contextName' has the following description: SNMPv3

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

setDefinition

public void setDefinition(int index,
                          Definition vDefinition)
                   throws java.lang.IndexOutOfBoundsException
Method setDefinition

Parameters:
index -
vDefinition -
Throws:
java.lang.IndexOutOfBoundsException

setDefinition

public void setDefinition(Definition[] definitionArray)
Method setDefinition

Parameters:
definitionArray -

setDefinition

public void setDefinition(java.util.ArrayList definitionCollection)
Method setDefinition Sets the value of 'definition' by copying the given ArrayList.

Parameters:
definitionCollection - the Vector to copy.

setDefinitionCollection

public void setDefinitionCollection(java.util.ArrayList definitionCollection)
Method setDefinitionCollection Sets the value of 'definition' by setting it to the given ArrayList. No type checking is performed.

Parameters:
definitionCollection - the ArrayList to copy.

setEngineId

public void setEngineId(java.lang.String engineId)
Sets the value of field 'engineId'. The field 'engineId' has the following description: SNMPv3

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

setEnterpriseId

public void setEnterpriseId(java.lang.String enterpriseId)
Sets the value of field 'enterpriseId'. The field 'enterpriseId' has the following description: SNMPv3

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

setMaxRepetitions

public void setMaxRepetitions(int maxRepetitions)
Sets the value of field 'maxRepetitions'. The field 'maxRepetitions' has the following description: Number of repetitions to send per get-bulk request.

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

setMaxRequestSize

public void setMaxRequestSize(int maxRequestSize)
Sets the value of field 'maxRequestSize'. The field 'maxRequestSize' has the following description: (SNMP4J specific) Specifies the maximum number of bytes that may be encoded into an individual SNMP PDU request by Collectd. Provides a means to limit the size of outgoing PDU requests. Default is 65535, must be at least 484.

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

setMaxVarsPerPdu

public void setMaxVarsPerPdu(int maxVarsPerPdu)
Sets the value of field 'maxVarsPerPdu'. The field 'maxVarsPerPdu' has the following description: Number of variables to send per SNMP request.

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

setPort

public void setPort(int port)
Sets the value of field 'port'. The field 'port' has the following description: If set, overrides UDP port 161 as the port where SNMP GET/GETNEXT/GETBULK requests are sent.

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

setPrivacyPassphrase

public void setPrivacyPassphrase(java.lang.String privacyPassphrase)
Sets the value of field 'privacyPassphrase'. The field 'privacyPassphrase' has the following description: SNMPv3

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

setPrivacyProtocol

public void setPrivacyProtocol(java.lang.String privacyProtocol)
Sets the value of field 'privacyProtocol'. The field 'privacyProtocol' has the following description: SNMPv3

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

setProxyHost

public void setProxyHost(java.lang.String proxyHost)
Sets the value of field 'proxyHost'. The field 'proxyHost' has the following description: The proxy host to use when communiciating with this agent

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

setReadCommunity

public void setReadCommunity(java.lang.String readCommunity)
Sets the value of field 'readCommunity'. The field 'readCommunity' has the following description: Default read community string

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

setRetry

public void setRetry(int retry)
Sets the value of field 'retry'. The field 'retry' has the following description: Default number of retries

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

setSecurityName

public void setSecurityName(java.lang.String securityName)
Sets the value of field 'securityName'. The field 'securityName' has the following description: SNMPv3

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

setTimeout

public void setTimeout(int timeout)
Sets the value of field 'timeout'. The field 'timeout' has the following description: Default timeout (in milliseconds)

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

setVersion

public void setVersion(java.lang.String version)
Sets the value of field 'version'. The field 'version' has the following description: If set, forces SNMP data collection to the specified version.

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

setWriteCommunity

public void setWriteCommunity(java.lang.String writeCommunity)
Sets the value of field 'writeCommunity'. The field 'writeCommunity' has the following description: Default write community string

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

unmarshal

public static java.lang.Object unmarshal(java.io.Reader reader)
                                  throws org.exolab.castor.xml.MarshalException,
                                         org.exolab.castor.xml.ValidationException
Method unmarshal

Parameters:
reader -
Returns:
Object
Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

validate

public void validate()
              throws org.exolab.castor.xml.ValidationException
Method validate

Throws:
org.exolab.castor.xml.ValidationException


Copyright © 2007. All Rights Reserved.