com.ireasoning.protocol.snmp
Class SnmpTarget
java.lang.Object
|
+--com.ireasoning.protocol.Target
|
+--com.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 |
Constructor Summary |
SnmpTarget(String host,
int port)
Constructs a SnmpTarget object for SNMPv1 or SNMPv3,
using "public" as the community name |
SnmpTarget(String host,
int port,
String readCommunity,
String writeCommunity)
Constructs a SnmpTarget object for SnmpV1 and SnmpV2c. |
SnmpTarget(String host,
int port,
String readCommunity,
String writeCommunity,
int version)
Constructs a SnmpTarget object for SnmpV1 and SnmpV2c |
PUBLIC
public static final String PUBLIC
- Default "public" community name
SnmpTarget
public SnmpTarget(String host,
int port,
String readCommunity,
String writeCommunity,
int version)
- Constructs a SnmpTarget object for SnmpV1 and SnmpV2c
- Parameters:
host
- host name or ip address of agentport
- port number of agentreadCommunity
- the community name for "read" operations such as GET,
GET_NEXT, GET_BULK, WALK, etcwriteCommunity
- 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 a 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 agentport
- port number of agentreadCommunity
- the community name for "read" operations such as GET,
GET_NEXT, GET_BULK, WALK, etcwriteCommunity
- the community name for SET opertion.
SnmpTarget
public SnmpTarget(String host,
int port)
- Constructs a SnmpTarget object for SNMPv1 or SNMPv3,
using "public" as the community name
- Parameters:
host
- host name or ip address of agentport
- port number of agent
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 }
Copyright © 2002 iReasoning Inc. All Rights Reserved.