HOME

com.ireasoning.protocol.snmp
Class SnmpTarget

java.lang.Object
  extended bycom.ireasoning.protocol.Target
      extended bycom.ireasoning.protocol.snmp.SnmpTarget
All Implemented Interfaces:
Serializable

public class SnmpTarget
extends Target

This class represents Snmp agent, containing properties of agent, such as host name, port number, community name.

See Also:
Serialized Form

Field Summary
static String PUBLIC
          Default "public" community name
 
Fields inherited from class com.ireasoning.protocol.Target
_host, _inetAddress, _port
 
Constructor Summary
SnmpTarget(String host, int port)
          Constructs an SnmpTarget object for SNMPv1 or SNMPv3, using "public" as the community name
SnmpTarget(String host, int port, String readCommunity, String writeCommunity)
          Constructs an SnmpTarget object for SnmpV1 and SnmpV2c.
SnmpTarget(String host, int port, String readCommunity, String writeCommunity, int version)
          Constructs an SnmpTarget object for SnmpV1 and SnmpV2c
 
Method Summary
 String getReadCommunity()
          Returns the community name for SNMP "read" requests, such as GET, GET_NEXT, etc.
 int getVersion()
          Returns the current SNMP version number
 String getWriteCommunity()
          Returns the community name for snmp SET operation
 void setReadCommunity(String readCommunity)
          Sets the community name for SNMP "read" requests, such as GET, GET_NEXT, etc.
 void setVersion(int ver)
          Sets the SNMP protocol version number.
 void setWriteCommunity(String writeCommunity)
          Sets the community name for snmp SET operation
 
Methods inherited from class com.ireasoning.protocol.Target
getHost, getInetAddress, getPort, setHost, setPort, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PUBLIC

public static final String PUBLIC
Default "public" community name

See Also:
Constant Field Values
Constructor Detail

SnmpTarget

public SnmpTarget(String host,
                  int port,
                  String readCommunity,
                  String writeCommunity,
                  int version)
Constructs an SnmpTarget object for SnmpV1 and SnmpV2c

Parameters:
host - host name or ip address of agent
port - port number of agent
readCommunity - the community name for "read" operations such as GET, GET_NEXT, GET_BULK, WALK, etc
writeCommunity - the community name for SET opertion.
version - the snmp version supported by agent, one of { SnmpConst.SNMPV1, SnmpConst.SNMPV2, SnmpConst.SNMPV3 }

SnmpTarget

public SnmpTarget(String host,
                  int port,
                  String readCommunity,
                  String writeCommunity)
Constructs an SnmpTarget object for SnmpV1 and SnmpV2c. It assumes remote agent support SNMPv1, but for GET_BULK operation, version number will be automatically be SNMPv2.

Parameters:
host - host name or ip address of agent
port - port number of agent
readCommunity - the community name for "read" operations such as GET, GET_NEXT, GET_BULK, WALK, etc
writeCommunity - the community name for SET opertion.

SnmpTarget

public SnmpTarget(String host,
                  int port)
Constructs an SnmpTarget object for SNMPv1 or SNMPv3, using "public" as the community name

Parameters:
host - host name or ip address of agent
port - port number of agent
Method Detail

getReadCommunity

public String getReadCommunity()
Returns the community name for SNMP "read" requests, such as GET, GET_NEXT, etc.


setReadCommunity

public void setReadCommunity(String readCommunity)
Sets the community name for SNMP "read" requests, such as GET, GET_NEXT, etc.

Parameters:
readCommunity - the community name for "read" requests

getWriteCommunity

public String getWriteCommunity()
Returns the community name for snmp SET operation


setWriteCommunity

public void setWriteCommunity(String writeCommunity)
Sets the community name for snmp SET operation

Parameters:
writeCommunity - the community name for SET opertion

getVersion

public int getVersion()
Returns the current SNMP version number

Returns:
The current protocol version. Possible values are { SnmpConst.SNMPV1, SnmpConst.SNMPV2, SnmpConst.SNMPV3 }

setVersion

public void setVersion(int ver)
Sets the SNMP protocol version number.

Parameters:
ver - SNMP version to use. Possible values are { SnmpConst.SNMPV1, SnmpConst.SNMPV2, SnmpConst.SNMPV3 }

HOME

Copyright © 2002 iReasoning Inc. All Rights Reserved.