org.apache.camel.component.snmp
Class SnmpEndpoint

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      extended by org.apache.camel.impl.DefaultEndpoint
          extended by org.apache.camel.impl.ScheduledPollEndpoint
              extended by org.apache.camel.impl.DefaultPollingEndpoint
                  extended by org.apache.camel.component.snmp.SnmpEndpoint
All Implemented Interfaces:
org.apache.camel.CamelContextAware, org.apache.camel.Endpoint, org.apache.camel.IsSingleton, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HasId, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

public class SnmpEndpoint
extends org.apache.camel.impl.DefaultPollingEndpoint


Field Summary
static String DEFAULT_COMMUNITY
           
static int DEFAULT_SNMP_RETRIES
           
static int DEFAULT_SNMP_TIMEOUT
           
static int DEFAULT_SNMP_VERSION
           
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
SnmpEndpoint(String uri, SnmpComponent component)
          creates a snmp endpoint
 
Method Summary
 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()
           
 String getAddress()
           
 int getDelay()
           
 OIDList getOids()
           
 String getProtocol()
           
 int getRetries()
           
 String getSnmpCommunity()
           
 int getSnmpVersion()
           
 int getTimeout()
           
 SnmpActionType getType()
           
 void initiate()
          creates and configures the endpoint
 boolean isSingleton()
           
 void setAddress(String address)
           
 void setDelay(int updateEvery)
          Sets update rate in seconds
 void setOids(OIDList oids)
           
 void setProtocol(String protocol)
           
 void setRetries(int retries)
           
 void setSnmpCommunity(String snmpCommunity)
           
 void setSnmpVersion(int snmpVersion)
           
 void setTimeout(int timeout)
           
 void setType(SnmpActionType type)
           
 String toString()
           
 
Methods inherited from class org.apache.camel.impl.ScheduledPollEndpoint
configureProperties
 
Methods inherited from class org.apache.camel.impl.DefaultEndpoint
configureConsumer, createEndpointConfiguration, createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, doStart, doStop, equals, getCamelContext, getComponent, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExchangePattern, getId, hashCode, isLenientProperties, isSynchronous, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setSynchronous
 
Methods inherited from class org.apache.camel.support.ServiceSupport
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Field Detail

DEFAULT_COMMUNITY

public static final String DEFAULT_COMMUNITY
See Also:
Constant Field Values

DEFAULT_SNMP_VERSION

public static final int DEFAULT_SNMP_VERSION
See Also:
Constant Field Values

DEFAULT_SNMP_RETRIES

public static final int DEFAULT_SNMP_RETRIES
See Also:
Constant Field Values

DEFAULT_SNMP_TIMEOUT

public static final int DEFAULT_SNMP_TIMEOUT
See Also:
Constant Field Values
Constructor Detail

SnmpEndpoint

public SnmpEndpoint(String uri,
                    SnmpComponent component)
creates a snmp endpoint

Parameters:
uri - the endpoint uri
component - the component
Method Detail

createConsumer

public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor)
                                         throws Exception
Specified by:
createConsumer in interface org.apache.camel.Endpoint
Overrides:
createConsumer in class org.apache.camel.impl.DefaultPollingEndpoint
Throws:
Exception

createProducer

public org.apache.camel.Producer createProducer()
                                         throws Exception
Throws:
Exception

isSingleton

public boolean isSingleton()

createExchange

public org.apache.camel.Exchange createExchange(org.snmp4j.PDU pdu)
creates an exchange for the given message

Parameters:
pdu - the pdu
Returns:
an exchange

createExchange

public org.apache.camel.Exchange createExchange(org.snmp4j.PDU pdu,
                                                org.snmp4j.CommandResponderEvent event)
creates an exchange for the given message

Parameters:
pdu - the pdu
event - a snmp4j CommandResponderEvent
Returns:
an exchange

initiate

public void initiate()
              throws Exception
creates and configures the endpoint

Throws:
Exception - if unable to setup connection

getDelay

public int getDelay()

setDelay

public void setDelay(int updateEvery)
Sets update rate in seconds

Parameters:
updateEvery - the update rate in seconds

getType

public SnmpActionType getType()

setType

public void setType(SnmpActionType type)

getOids

public OIDList getOids()

setOids

public void setOids(OIDList oids)

getAddress

public String getAddress()

setAddress

public void setAddress(String address)

getRetries

public int getRetries()

setRetries

public void setRetries(int retries)

getTimeout

public int getTimeout()

setTimeout

public void setTimeout(int timeout)

getSnmpVersion

public int getSnmpVersion()

setSnmpVersion

public void setSnmpVersion(int snmpVersion)

getSnmpCommunity

public String getSnmpCommunity()

setSnmpCommunity

public void setSnmpCommunity(String snmpCommunity)

getProtocol

public String getProtocol()

setProtocol

public void setProtocol(String protocol)

toString

public String toString()
Overrides:
toString in class org.apache.camel.impl.DefaultEndpoint


Apache CAMEL