Methods Summary |
---|
public boolean | allowSnmpSets()Checks whether parameters are in place for an SNMP set operation.
return _writeCommunity != null ;
|
public synchronized java.lang.Object | clone()Clones the object and its content.
SnmpParameters par = null ;
try {
par = (SnmpParameters) super.clone() ;
//par._retryPolicy = _retryPolicy ;
par._readCommunity = _readCommunity ;
par._writeCommunity = _writeCommunity ;
par._informCommunity = _informCommunity ;
} catch (CloneNotSupportedException e) {
throw new InternalError() ; // VM bug.
}
return par ;
|
public byte[] | encodeAuthentication(int snmpCmd)For SNMP Runtime internal use only.
//
// Returns the community string associated to the specified command.
//
try {
if (snmpCmd == pduSetRequestPdu)
return _writeCommunity.getBytes("8859_1");
else if (snmpCmd == pduInformRequestPdu)
return _informCommunity.getBytes("8859_1") ;
else
return _readCommunity.getBytes("8859_1") ;
}catch(UnsupportedEncodingException e) {
throw new SnmpStatusException(e.getMessage());
}
|
public synchronized 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.
if (!( obj instanceof SnmpParameters))
return false;
if (this == obj)
return true ;
SnmpParameters param = (SnmpParameters) obj ;
if (_protocolVersion == param._protocolVersion)
if (_readCommunity.equals(param._readCommunity))
return true ;
return false ;
|
public java.lang.String | getInformCommunity()Gets the community to be used when issuing inform requests.
return _informCommunity ;
|
public java.lang.String | getRdCommunity()Gets the community to be used when issuing get operations.
return _readCommunity ;
|
public java.lang.String | getWrCommunity()Gets the community to be used when issuing set operations.
return _writeCommunity ;
|
public void | setInformCommunity(java.lang.String inform)Sets the community string to use when performing inform requests.
if (inform == null)
_informCommunity = defaultRdCommunity ;
else
_informCommunity = inform ;
|
public synchronized void | setRdCommunity(java.lang.String read)Sets the community string to use when performing get operations.
if (read == null)
_readCommunity = defaultRdCommunity ;
else
_readCommunity = read ;
|
public void | setWrCommunity(java.lang.String write)Sets the community to be used when issuing set operations.
_writeCommunity = write;
|