com.sun.jaw.snmp.manager
Class SnmpParameters

java.lang.Object
  |
  +--com.sun.jaw.snmp.manager.SnmpParameters

public class SnmpParameters
extends java.lang.Object
implements SnmpDefinitions, java.lang.Cloneable, java.io.Serializable

This class contains a set of resources that are used by an SnmpSession object while sending or receiving packets to and from a SnmpPeer. An SnmpPeer can be configured explicitly to use a specific SnmpParameter. Many SnmpPeer objects can share a single parameter object.

Note: Changing values for a SnmpParameter object affects all SnmpPeer objects that share the parameter object.

See Also:
SnmpSession, SnmpPeer, Serialized Form

Field Summary
static java.lang.String defaultRdCommunity
          Specify the default community string to use for get operations.
 
Constructor Summary
SnmpParameters()
          Creates a SnmpParameters object with default set up.
SnmpParameters(java.lang.String rdc, java.lang.String wrc)
          Creates a SnmpParameters object.
 
Method Summary
 boolean allowSnmpSets()
          Checks whether parameters are in place for a SNMP set operation.
 java.lang.Object clone()
          Clones the object and its content.
 boolean equals(java.lang.Object obj)
          Compares two objects.
 int getProtocolVersion()
          Returns the version of the protocol to use.
 java.lang.String getRdCommunity()
          Gets the community to be used when issuing get operations.
 java.lang.String getWrCommunity()
          Gets the community to be used when issuing set operations.
 void setProtocolVersion(int version)
          Sets the version of the protocol to be used.
 void setRdCommunity(java.lang.String read)
          Allows to specify the community string to use when performing get operations.
 void setWrCommunity(java.lang.String s)
          Sets the community to be used when issuing set operations.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultRdCommunity

public static final java.lang.String defaultRdCommunity
Specify the default community string to use for get operations. By default, the value is "public".
Constructor Detail

SnmpParameters

public SnmpParameters()
Creates a SnmpParameters object with default set up. By default, set operations are not allowed and the community string to use is "public".

SnmpParameters

public SnmpParameters(java.lang.String rdc,
                      java.lang.String wrc)
Creates a SnmpParameters object. The methods allows to specify the read/write community strings.
Parameters:
rdc - community string to use for get operations
wrc - community string to use for set operations
Method Detail

getProtocolVersion

public int getProtocolVersion()
Returns the version of the protocol to use. The returned value is:
Returns:
The version of the protocol to use.

setProtocolVersion

public void setProtocolVersion(int version)
Sets the version of the protocol to be used. The version should be identified using the definitions contained in SnmpDefinitions.
For instance if you are willing to use SNMPv2, you could call the method as follows:
 setProtocolVersion(SnmpDefinitions.snmpVersionTwo);
 
Parameters:
version - The version of the protocol to be used.

allowSnmpSets

public boolean allowSnmpSets()
Checks whether parameters are in place for a SNMP set operation.
Returns:
True if parameters are in place; false otherwise.

setRdCommunity

public void setRdCommunity(java.lang.String read)
Allows to specify the community string to use when performing get operations.
Parameters:
read - The community string.

getRdCommunity

public java.lang.String getRdCommunity()
Gets the community to be used when issuing get operations.
Returns:
The community string.

setWrCommunity

public void setWrCommunity(java.lang.String s)
Sets the community to be used when issuing set operations.
Parameters:
s - The community string.

getWrCommunity

public java.lang.String getWrCommunity()
Gets the community to be used when issuing set operations.
Returns:
The community string.

equals

public boolean equals(java.lang.Object obj)
Compares two objects. Two SnmpParameters are equal if they correspond to the same protocol version, read community and write community.
Parameters:
obj - The object to compare this with.
Returns:
True if this and the specified object are equal; false otherwise.
Overrides:
equals in class java.lang.Object

clone

public java.lang.Object clone()
Clones the object and its content.
Returns:
The Object clone.
Overrides:
clone in class java.lang.Object