@UriEndpoint(firstVersion="2.1.0",
scheme="snmp",
title="SNMP",
syntax="snmp:host:port",
consumerOnly=true,
label="monitoring")
public class SnmpEndpoint
extends org.apache.camel.impl.DefaultPollingEndpoint
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_COMMUNITY |
static int |
DEFAULT_SNMP_RETRIES |
static int |
DEFAULT_SNMP_TIMEOUT |
static int |
DEFAULT_SNMP_VERSION |
Constructor and Description |
---|
SnmpEndpoint(String uri,
SnmpComponent component)
creates a snmp endpoint
|
Modifier and Type | Method and Description |
---|---|
org.apache.camel.Consumer |
createConsumer(org.apache.camel.Processor processor) |
org.apache.camel.Exchange |
createExchange(org.snmp4j.PDU pdu)
creates an exchange for the given message
|
org.apache.camel.Exchange |
createExchange(org.snmp4j.PDU pdu,
org.snmp4j.CommandResponderEvent event)
creates an exchange for the given message
|
org.apache.camel.Producer |
createProducer() |
protected void |
doStart() |
String |
getAddress() |
String |
getAuthenticationPassphrase() |
String |
getAuthenticationProtocol() |
long |
getDelay() |
OIDList |
getOids() |
String |
getPrivacyPassphrase() |
String |
getPrivacyProtocol() |
String |
getProtocol() |
int |
getRetries() |
int |
getSecurityLevel() |
String |
getSecurityName() |
String |
getSnmpCommunity() |
String |
getSnmpContextEngineId() |
String |
getSnmpContextName() |
int |
getSnmpVersion() |
int |
getTimeout() |
SnmpActionType |
getType() |
void |
initiate()
Deprecated.
use
ServiceSupport.start() instead |
boolean |
isSingleton() |
boolean |
isTreeList() |
void |
setAddress(String address) |
void |
setAuthenticationPassphrase(String authenticationPassphrase)
The authentication passphrase.
|
void |
setAuthenticationProtocol(String authenticationProtocol)
Authentication protocol to use if security level is set to enable authentication
The possible values are: MD5, SHA1
|
void |
setDelay(long updateEvery)
Sets update rate in seconds
|
void |
setOids(OIDList oids)
Defines which values you are interested in.
|
void |
setPrivacyPassphrase(String privacyPassphrase)
The privacy passphrase.
|
void |
setPrivacyProtocol(String privacyProtocol)
The privacy protocol ID to be associated with this user.
|
void |
setProtocol(String protocol)
Here you can select which protocol to use.
|
void |
setRetries(int retries)
Defines how often a retry is made before canceling the request.
|
void |
setSecurityLevel(int securityLevel)
Sets the security level for this target.
|
void |
setSecurityName(String securityName)
Sets the security name to be used with this target.
|
void |
setSnmpCommunity(String snmpCommunity)
Sets the community octet string for the snmp request.
|
void |
setSnmpContextEngineId(String snmpContextEngineId)
Sets the context engine ID field of the scoped PDU.
|
void |
setSnmpContextName(String snmpContextName)
Sets the context name field of this scoped PDU.
|
void |
setSnmpVersion(int snmpVersion)
Sets the snmp version for the request.
|
void |
setTimeout(int timeout)
Sets the timeout value for the request in millis.
|
void |
setTreeList(boolean treeList)
Sets the flag whether the scoped PDU will be displayed as the list
if it has child elements in its tree
|
void |
setType(SnmpActionType type)
Which operation to perform such as poll, trap, etc.
|
String |
toString() |
configurePollingConsumer, configureProperties, configureScheduledPollConsumerProperties, doStop, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getInitialDelay, getPollStrategy, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getTimeUnit, initConsumerProperties, isGreedy, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setGreedy, setInitialDelay, setPollStrategy, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelay
configureConsumer, createEndpointConfiguration, createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, equals, getCamelContext, getComponent, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isBridgeErrorHandler, isLenientProperties, isPollingConsumerBlockWhenFull, isSynchronous, setBridgeErrorHandler, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
public static final 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 SnmpEndpoint(String uri, SnmpComponent component)
uri
- the endpoint uricomponent
- the componentpublic org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception
createConsumer
in interface org.apache.camel.Endpoint
createConsumer
in class org.apache.camel.impl.DefaultPollingEndpoint
Exception
public boolean isSingleton()
public org.apache.camel.Exchange createExchange(org.snmp4j.PDU pdu)
pdu
- the pdupublic org.apache.camel.Exchange createExchange(org.snmp4j.PDU pdu, org.snmp4j.CommandResponderEvent event)
pdu
- the pduevent
- a snmp4j CommandResponderEvent@Deprecated public void initiate() throws Exception
ServiceSupport.start()
insteadException
- if unable to setup connectionpublic long getDelay()
getDelay
in class org.apache.camel.impl.ScheduledPollEndpoint
public void setDelay(long updateEvery)
setDelay
in class org.apache.camel.impl.ScheduledPollEndpoint
updateEvery
- the update rate in secondspublic SnmpActionType getType()
public void setType(SnmpActionType type)
public OIDList getOids()
public void setOids(OIDList oids)
public String getAddress()
public void setAddress(String address)
public int getRetries()
public void setRetries(int retries)
public int getTimeout()
public void setTimeout(int timeout)
public int getSnmpVersion()
public void setSnmpVersion(int snmpVersion)
public String getSnmpCommunity()
public void setSnmpCommunity(String snmpCommunity)
public String getProtocol()
public void setProtocol(String protocol)
protected void doStart() throws Exception
doStart
in class org.apache.camel.impl.ScheduledPollEndpoint
Exception
public int getSecurityLevel()
public void setSecurityLevel(int securityLevel)
public String getSecurityName()
public void setSecurityName(String securityName)
public String getAuthenticationProtocol()
public void setAuthenticationProtocol(String authenticationProtocol)
public String getAuthenticationPassphrase()
public void setAuthenticationPassphrase(String authenticationPassphrase)
null
, authenticationProtocol
must also be not
null
. RFC3414 11.2 requires passphrases to have a minimum length of 8 bytes.
If the length of authenticationPassphrase
is less than 8 bytes an IllegalArgumentException
is thrown.public String getPrivacyProtocol()
public void setPrivacyProtocol(String privacyProtocol)
null
, this user only supports unencrypted messages.public String getPrivacyPassphrase()
public void setPrivacyPassphrase(String privacyPassphrase)
null
, privacyProtocol
must also be not null
.
RFC3414 11.2 requires passphrases to have a minimum length of 8 bytes. If the length of
authenticationPassphrase
is less than 8 bytes an IllegalArgumentException
is thrown.public String getSnmpContextName()
public void setSnmpContextName(String snmpContextName)
public String getSnmpContextEngineId()
public void setSnmpContextEngineId(String snmpContextEngineId)
public boolean isTreeList()
public void setTreeList(boolean treeList)
public String toString()
toString
in class org.apache.camel.impl.DefaultEndpoint
Apache Camel