com.sun.management.snmp.manager
Class SnmpParameters

java.lang.Object
  extended by com.sun.management.snmp.manager.SnmpParams
      extended by com.sun.management.snmp.manager.SnmpParameters
All Implemented Interfaces:
SnmpDefinitions, Serializable, Cloneable

public class SnmpParameters
extends SnmpParams
implements Cloneable, Serializable

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

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

Since:
Java DMK 5.1
See Also:
SnmpSession, SnmpPeer, Serialized Form

Field Summary
 
Fields inherited from interface com.sun.management.snmp.SnmpDefinitions
authMask, authNoPriv, authPriv, authPrivMask, CtxtConsFlag, noAuthNoPriv, noGroupName, noSuchContext, noSuchView, notInView, pduGetBulkRequestPdu, pduGetNextRequestPdu, pduGetRequestPdu, pduGetResponsePdu, pduInformRequestPdu, pduReportPdu, pduSetRequestPdu, pduV1TrapPdu, pduV2TrapPdu, pduWalkRequest, privMask, reportableFlag, snmpAuthNotSupported, snmpBadSecurityLevel, snmpPrivNotSupported, snmpReqAborted, snmpReqEncodingError, snmpReqHandleTooBig, snmpReqInternalError, snmpReqPacketOverflow, snmpReqRefireAfterVbFix, snmpReqSocketIOError, snmpReqTimeout, snmpReqTooBigImpossible, snmpReqUnknownError, snmpRspAuthorizationError, snmpRspBadValue, snmpRspCommitFailed, snmpRspDecodingError, snmpRspEndOfTable, snmpRspGenErr, snmpRspInconsistentName, snmpRspInconsistentValue, snmpRspNoAccess, snmpRspNoCreation, snmpRspNoError, snmpRspNoSuchName, snmpRspNotWritable, snmpRspReadOnly, snmpRspResourceUnavailable, snmpRspTooBig, snmpRspUndoFailed, snmpRspWrongEncoding, snmpRspWrongLength, snmpRspWrongType, snmpRspWrongValue, snmpUnknownPrincipal, snmpUsmBadEngineId, snmpUsmInvalidTimeliness, snmpUsmSecurityModel, snmpV1AccessControlModel, snmpV1MsgProcessingModel, snmpV1SecurityModel, snmpV2AccessControlModel, snmpV2MsgProcessingModel, snmpV2SecurityModel, snmpV3AccessControlModel, snmpV3MsgProcessingModel, snmpVersionOne, snmpVersionThree, snmpVersionTwo, snmpWrongSnmpVersion, trapAuthenticationFailure, trapColdStart, trapEgpNeighborLoss, trapEnterpriseSpecific, trapLinkDown, trapLinkUp, trapWarmStart
 
Constructor Summary
SnmpParameters()
          Creates an SnmpParameters object with defaults set up.
SnmpParameters(String rdc, String wrc)
          Creates an SnmpParameters object.
SnmpParameters(String rdc, String wrc, String inform)
          Creates an SnmpParameters object.
 
Method Summary
 boolean allowSnmpSets()
          Checks whether parameters are in place for an SNMP set operation.
 Object clone()
          Clones the object and its content.
 byte[] encodeAuthentication(int snmpCmd)
          For Java DMK internal use only.
 boolean equals(Object obj)
          Compares two objects.
 String getInformCommunity()
          Gets the community to be used when issuing inform requests.
 String getRdCommunity()
          Gets the community to be used when issuing get operations.
 String getWrCommunity()
          Gets the community to be used when issuing set operations.
 void setInformCommunity(String inform)
          Sets the community string to use when performing inform requests.
 void setRdCommunity(String read)
          Sets the community string to use when performing get operations.
 void setWrCommunity(String write)
          Sets the community to be used when issuing set operations.
 
Methods inherited from class com.sun.management.snmp.manager.SnmpParams
getProtocolVersion, setProtocolVersion
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SnmpParameters

public SnmpParameters()
Creates an SnmpParameters object with defaults set up. By default, set operations are not allowed, the read community and the inform community strings to use is "public" and the SNMP version is V1.


SnmpParameters

public SnmpParameters(String rdc,
                      String wrc)
Creates an SnmpParameters object. This constructor allows the specification of the read/write community strings. The inform community string to use is "public".

Parameters:
rdc - community string to use for get operations.
wrc - community string to use for set operations.

SnmpParameters

public SnmpParameters(String rdc,
                      String wrc,
                      String inform)
Creates an SnmpParameters object. This constructor allows the specification of the read/write/inform community strings.

Parameters:
rdc - community string to use for get operations.
wrc - community string to use for set operations.
inform - community string to use for inform requests.
Method Detail

getRdCommunity

public String getRdCommunity()
Gets the community to be used when issuing get operations.

Returns:
The community string.

setRdCommunity

public void setRdCommunity(String read)
Sets the community string to use when performing get operations.

Parameters:
read - The community string.

getWrCommunity

public String getWrCommunity()
Gets the community to be used when issuing set operations.

Returns:
The community string.

setWrCommunity

public void setWrCommunity(String write)
Sets the community to be used when issuing set operations.

Parameters:
write - The community string.

getInformCommunity

public String getInformCommunity()
Gets the community to be used when issuing inform requests.

Returns:
The community string.

setInformCommunity

public void setInformCommunity(String inform)
Sets the community string to use when performing inform requests.

Parameters:
inform - The community string.

allowSnmpSets

public boolean allowSnmpSets()
Checks whether parameters are in place for an SNMP set operation.

Specified by:
allowSnmpSets in class SnmpParams
Returns:
true if parameters are in place, false otherwise.

equals

public boolean equals(Object obj)
Compares two objects. Two SnmpParameters are equal if they correspond to the same protocol version, read community and write community.

Overrides:
equals in class Object
Parameters:
obj - The object to compare this with.
Returns:
true if this and the specified object are equal, false otherwise.

clone

public Object clone()
Clones the object and its content.

Overrides:
clone in class Object
Returns:
The object clone.

encodeAuthentication

public byte[] encodeAuthentication(int snmpCmd)
                            throws SnmpStatusException
For Java DMK internal use only.

Throws:
SnmpStatusException

Open Source build 02
opendmk-1.0-b02 2007.10.01_19:17:46_MEST

Copyright 1998-2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.