@UriEndpoint(scheme="paho",
title="Paho",
consumerClass=PahoConsumer.class,
label="messaging,iot",
syntax="paho:topic")
public class PahoEndpoint
extends DefaultEndpoint
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending| Constructor and Description |
|---|
PahoEndpoint(String uri,
String topic,
Component component) |
| Modifier and Type | Method and Description |
|---|---|
Consumer |
createConsumer(Processor processor)
Creates a new Event
Driven Consumer which consumes messages from the endpoint using the
given processor
|
Exchange |
createExchange(org.eclipse.paho.client.mqttv3.MqttMessage mqttMessage,
String topic) |
Producer |
createProducer()
Creates a new producer which is used send messages into the endpoint
|
protected void |
doStart()
Implementations override this method to support customized start/stop.
|
protected void |
doStop()
Implementations override this method to support customized start/stop.
|
String |
getBrokerUrl() |
org.eclipse.paho.client.mqttv3.MqttClient |
getClient() |
String |
getClientId() |
PahoComponent |
getComponent()
Returns the component that created this endpoint.
|
org.eclipse.paho.client.mqttv3.MqttConnectOptions |
getConnectOptions() |
String |
getFilePersistenceDirectory() |
PahoPersistence |
getPersistence() |
int |
getQos() |
String |
getTopic() |
boolean |
isRetained() |
boolean |
isSingleton()
Whether this class supports being singleton or not.
|
protected org.eclipse.paho.client.mqttv3.MqttConnectOptions |
resolveMqttConnectOptions() |
protected org.eclipse.paho.client.mqttv3.MqttClientPersistence |
resolvePersistence() |
void |
setBrokerUrl(String brokerUrl)
The URL of the MQTT broker.
|
void |
setClient(org.eclipse.paho.client.mqttv3.MqttClient client)
To use the existing MqttClient instance as client.
|
void |
setClientId(String clientId)
MQTT client identifier.
|
void |
setConnectOptions(org.eclipse.paho.client.mqttv3.MqttConnectOptions connOpts)
Client connection options
|
void |
setFilePersistenceDirectory(String filePersistenceDirectory)
Base directory used by the file persistence provider.
|
void |
setPersistence(PahoPersistence persistence)
Client persistence to be used - memory or file.
|
void |
setQos(int qos)
Client quality of service level (0-2).
|
void |
setRetained(boolean retained)
Retain option
|
void |
setTopic(String topic)
Name of the topic
|
configureConsumer, configurePollingConsumer, configureProperties, createEndpointConfiguration, createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, equals, getCamelContext, 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, toStringdoResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendprotected void doStart()
throws Exception
ServiceSupportServiceSupport.doStop() for more details.doStart in class DefaultEndpointExceptionServiceSupport.doStop()protected void doStop()
throws Exception
ServiceSupportServiceSupport.doStop() method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext is shutting down.doStop in class DefaultEndpointExceptionServiceSupport.doStart()public Producer createProducer() throws Exception
EndpointException - can be thrownpublic Consumer createConsumer(Processor processor) throws Exception
Endpointprocessor - the given processorException - can be thrownpublic boolean isSingleton()
IsSingletonpublic PahoComponent getComponent()
DefaultEndpointgetComponent in class DefaultEndpointprotected org.eclipse.paho.client.mqttv3.MqttClientPersistence resolvePersistence()
protected org.eclipse.paho.client.mqttv3.MqttConnectOptions resolveMqttConnectOptions()
public Exchange createExchange(org.eclipse.paho.client.mqttv3.MqttMessage mqttMessage, String topic)
public String getClientId()
public void setClientId(String clientId)
public String getBrokerUrl()
public void setBrokerUrl(String brokerUrl)
public String getTopic()
public void setTopic(String topic)
public int getQos()
public void setQos(int qos)
public boolean isRetained()
public void setRetained(boolean retained)
retained - true/falsepublic PahoPersistence getPersistence()
public void setPersistence(PahoPersistence persistence)
public String getFilePersistenceDirectory()
public void setFilePersistenceDirectory(String filePersistenceDirectory)
public org.eclipse.paho.client.mqttv3.MqttClient getClient()
public void setClient(org.eclipse.paho.client.mqttv3.MqttClient client)
public org.eclipse.paho.client.mqttv3.MqttConnectOptions getConnectOptions()
public void setConnectOptions(org.eclipse.paho.client.mqttv3.MqttConnectOptions connOpts)
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.