public class SnmpPollingEndpoint extends PollingEndpoint implements SnmpEndpointType, org.snmp4j.event.ResponseListener
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_COMMUNITY |
static int |
DEFAULT_SNMP_RETRIES |
static int |
DEFAULT_SNMP_TIMEOUT |
static int |
DEFAULT_SNMP_VERSION |
definition, description, endpoint, interfaceName, service, serviceUnit| Constructor and Description |
|---|
SnmpPollingEndpoint() |
| Modifier and Type | Method and Description |
|---|---|
void |
activate() |
java.lang.String |
getAddress() |
SnmpMarshalerSupport |
getMarshaler() |
OIDList |
getOids() |
int |
getRetries() |
java.lang.String |
getSnmpCommunity() |
int |
getSnmpVersion() |
int |
getTimeout() |
void |
onResponse(org.snmp4j.event.ResponseEvent event) |
void |
poll() |
void |
process(javax.jbi.messaging.MessageExchange exchange) |
void |
setAddress(java.lang.String address)
Specifies the connection URI used to connect to a snmp capable device.
|
void |
setMarshaler(SnmpMarshalerSupport marshaler)
Specifies a marshaler class which provides the logic for converting
a snmp response into a normalized message.
|
void |
setOids(OIDList oids)
Specifies a reference to a list of OID values which will be used for
the snmp request.
|
void |
setRetries(int retries)
Specifies the connection retries.
|
void |
setSnmpCommunity(java.lang.String snmpCommunity)
Specifies the snmp community to use.
|
void |
setSnmpVersion(int snmpVersion)
Specifies the snmp protocol version to use.
|
void |
setTimeout(int timeout)
Specifies the connection time out in milliseconds.
|
void |
start() |
void |
stop() |
void |
validate() |
getDelay, getExecutor, getFirstTime, getPeriod, getScheduler, handlePollException, isConcurrentPolling, setConcurrentPolling, setDelay, setFirstTime, setPeriod, setSchedulerconfigureExchangeTarget, deactivate, getLocationURI, getRole, getTargetEndpoint, getTargetInterface, getTargetOperation, getTargetService, getTargetUri, setTargetEndpoint, setTargetInterface, setTargetOperation, setTargetService, setTargetUridone, fail, getChannel, getContext, getExchangeFactory, send, sendSyncgetDefinition, getDescription, getEndpoint, getInterfaceName, getKey, getService, getServiceUnit, isExchangeOkay, prepareExchange, setDefinition, setDescription, setEndpoint, setInterfaceName, setService, setServiceUnit, toStringpublic static final java.lang.String DEFAULT_COMMUNITY
public static final int DEFAULT_SNMP_VERSION
public static final int DEFAULT_SNMP_RETRIES
public static final int DEFAULT_SNMP_TIMEOUT
public void activate()
throws java.lang.Exception
activate in interface Endpointactivate in class ConsumerEndpointjava.lang.Exceptionpublic void start()
throws java.lang.Exception
start in interface Endpointstart in class PollingEndpointjava.lang.Exceptionpublic void stop()
throws java.lang.Exception
stop in interface Endpointstop in class PollingEndpointjava.lang.Exceptionpublic void validate()
throws javax.jbi.management.DeploymentException
validate in interface Endpointvalidate in class ConsumerEndpointjavax.jbi.management.DeploymentExceptionpublic void poll()
throws java.lang.Exception
poll in class PollingEndpointjava.lang.Exceptionpublic void process(javax.jbi.messaging.MessageExchange exchange)
throws java.lang.Exception
process in interface Endpointprocess in class AbstractEndpointjava.lang.Exceptionpublic void onResponse(org.snmp4j.event.ResponseEvent event)
onResponse in interface org.snmp4j.event.ResponseListenerpublic java.lang.String getAddress()
public void setAddress(java.lang.String address)
Specifies the connection URI used to connect to a snmp capable device.
Template:
<protocol>:<host>/<port>
Details:
| Name | Description |
| protocol | the protocol to use (udp or tcp) |
| host | the name or ip address of the snmp capable device |
| port | the port number to use |
address - a String value containing the connection detailspublic int getRetries()
public void setRetries(int retries)
Specifies the connection retries.
The default value is 2retries - a int value containing the retry countpublic int getTimeout()
public void setTimeout(int timeout)
Specifies the connection time out in milliseconds.
The default value is 1500timeout - a int value containing the time out in millispublic int getSnmpVersion()
public void setSnmpVersion(int snmpVersion)
Specifies the snmp protocol version to use.
The default value is 0 (version 1)snmpVersion - a int value containing the snmp versionpublic java.lang.String getSnmpCommunity()
public void setSnmpCommunity(java.lang.String snmpCommunity)
Specifies the snmp community to use.
The default value is "public"snmpCommunity - a String value containing the snmp communitypublic SnmpMarshalerSupport getMarshaler()
public void setMarshaler(SnmpMarshalerSupport marshaler)
Specifies a marshaler class which provides the logic for converting
a snmp response into a normalized message. This class has to implement
the SnmpMarshalerSupport interface. If you don't specify a
marshaler, the DefaultSnmpMarshaler will be used.
marshaler - a class which implements SnmpMarshalerSupportpublic OIDList getOids()
public void setOids(OIDList oids)
Specifies a reference to a list of OID values which will be used for
the snmp request. You have two possibilities how to specify the value:
a) referencing to a file containing a list of OID values separated by a line feed
or
b) defining a coma (,) separated list of OID values
Examples:
a) oids="classpath:myOids.txt"
oids="file:/home/lhein/snmp/device_a/oids.txt"
b) oids="1.3.6.1.2.1.1.3.0 , 1.3.6.1.2.1.25.3.2.1.5.1 , 1.3.6.1.2.1.25.3.5.1.1.1 , 1.3.6.1.2.1.43.5.1.1.11.1"
oids - a OIDList containing the OID values for the requestCopyright © 2005-2014 FuseSource. All Rights Reserved.