com.tivoli.twg.snmp
Class SNMPEntity

java.lang.Object
  extended bycom.tivoli.twg.snmp.SNMPEntity

public class SNMPEntity
extends java.lang.Object

This class represents an SNMP Entity. That is an IP address.

It is required for all protocol operations. One is required to transmit a PDU, and one will be provided on the arrival of both a response, and a Trap PDU.

See Also:
SNMP, SNMPContext, SNMPPDU

Constructor Summary
SNMPEntity(com.tivoli.twg.snmp.SNMPAddressBlock[] addressBlocks)
          Construct An SNMPEntity for use with any protocol operation.
SNMPEntity(SNMP session, java.lang.String address)
          Deprecated.  
SNMPEntity(java.lang.String address)
          Construct An SNMPEntity for use with any protocol operation.
 
Method Summary
 int GetActualRetry()
          This method will return the actual retry number for this entity.
 int GetActualTimeout()
          This method will return the actual timeout value, as reported for an entitity.
 java.lang.String GetAddress()
          This method will return the string version of the address represented by this instance of the SNMPEntity class.
 java.lang.String GetAddress(int index)
          This method will return the string version of the address represented by this instance of the SNMPEntity class.
 com.tivoli.twg.snmp.SNMPAddressBlock[] getAddressList()
          Return the address blocks for this entity.
 int getAddressListLength()
          Return the number of address for this entity.
 int GetPolicyRetry()
          This method will return the number of retries to be attempted for this entity.
 int GetPolicyTimeout()
          This method will return the Policy timeout set for this entity.
 int GetPort()
          Return port number Used only for pure Java stack
 int SetPolicyRetry(int retry)
          This method will allow the setting of the retry policy for this entity.
 int SetPolicyTimeout(int time)
          This method allows the setting of the timeout policy for this entity.
 int SetPort(int Port)
          Used to set the Port number associated with this address entity to something other then the default port.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SNMPEntity

public SNMPEntity(java.lang.String address)
Construct An SNMPEntity for use with any protocol operation.

Parameters:
address - A string representing the addressing information. Example: "1.2.3.4"

SNMPEntity

public SNMPEntity(com.tivoli.twg.snmp.SNMPAddressBlock[] addressBlocks)
Construct An SNMPEntity for use with any protocol operation. This constructor preferred, since it enables the stack to retry on different addresses. So multiple addresses can represent an entity.

Parameters:
addressBlocks - block of addresses that represent this entity

SNMPEntity

public SNMPEntity(SNMP session,
                  java.lang.String address)
Deprecated.  

Construct An SNMPEntity for use with any protocol operation.

Parameters:
session - An instance of the SNMP class, ie, the protocol stack
address - A string representing the addressing information. Example: "1.2.3.4"
Method Detail

GetAddress

public final java.lang.String GetAddress()
This method will return the string version of the address represented by this instance of the SNMPEntity class. Always returns the first address in the lists.

Returns:
String, containing the addressing information of the first address in list

GetAddress

public final java.lang.String GetAddress(int index)
This method will return the string version of the address represented by this instance of the SNMPEntity class.

Parameters:
index - index to address block of interest
Returns:
String, containing the addressing information or null if out of bounds

getAddressList

public com.tivoli.twg.snmp.SNMPAddressBlock[] getAddressList()
Return the address blocks for this entity.

Returns:
this entity's address blocks

getAddressListLength

public int getAddressListLength()
Return the number of address for this entity. Useful in determining how many different addresses to try in order to complete a send.

Returns:
number of addresses

SetPort

public final int SetPort(int Port)
Used to set the Port number associated with this address entity to something other then the default port.

Parameters:
Port - number that should be used in place of the default.
Returns:
int, the status of the operation, where 1=success.

GetPort

public final int GetPort()
Return port number Used only for pure Java stack

Returns:
int port number

GetPolicyTimeout

public final int GetPolicyTimeout()
This method will return the Policy timeout set for this entity.

Returns:
int, the number of msecs currently set for timeout.

SetPolicyTimeout

public final int SetPolicyTimeout(int time)
This method allows the setting of the timeout policy for this entity.

Parameters:
time - int msecs to be used for timeouts
Returns:
int, the status of the operation, where 1 == success.

GetActualTimeout

public final int GetActualTimeout()
This method will return the actual timeout value, as reported for an entitity.

Returns:
int, the actual timeout value in msecs.

GetPolicyRetry

public final int GetPolicyRetry()
This method will return the number of retries to be attempted for this entity.

Returns:
int, the number of retries to be used for this entity.

SetPolicyRetry

public final int SetPolicyRetry(int retry)
This method will allow the setting of the retry policy for this entity.

Returns:
int, the status of the operation, where 1 == success.

GetActualRetry

public final int GetActualRetry()
This method will return the actual retry number for this entity.

Returns:
int, the actual number of retries for this entity.