クラス Mqttv5PahoMessageDrivenChannelAdapter
java.lang.ObjectSE
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.endpoint.MessageProducerSupport
org.springframework.integration.mqtt.inbound.AbstractMqttMessageDrivenChannelAdapter<org.eclipse.paho.mqttv5.client.IMqttAsyncClient,org.eclipse.paho.mqttv5.client.MqttConnectionOptions>
org.springframework.integration.mqtt.inbound.Mqttv5PahoMessageDrivenChannelAdapter
- 実装されたすべてのインターフェース:
org.eclipse.paho.mqttv5.client.MqttCallback
、Aware
、BeanFactoryAware
、BeanNameAware
、DisposableBean
、InitializingBean
、SmartInitializingSingleton
、ApplicationContextAware
、ApplicationEventPublisherAware
、Lifecycle
、Phased
、SmartLifecycle
、ComponentSourceAware
、ExpressionCapable
、MessageProducer
、IntegrationPattern
、ClientManager.ConnectCallback
、MqttComponent<org.eclipse.paho.mqttv5.client.MqttConnectionOptions>
、NamedComponent
、IntegrationInboundManagement
、IntegrationManagement
、ManageableLifecycle
、ManageableSmartLifecycle
、TrackableComponent
public class Mqttv5PahoMessageDrivenChannelAdapter
extends AbstractMqttMessageDrivenChannelAdapter<org.eclipse.paho.mqttv5.client.IMqttAsyncClient,org.eclipse.paho.mqttv5.client.MqttConnectionOptions>
implements org.eclipse.paho.mqttv5.client.MqttCallback, MqttComponent<org.eclipse.paho.mqttv5.client.MqttConnectionOptions>
MQTTv5 の
AbstractMqttMessageDrivenChannelAdapter
実装。MqttProperties
は、提供された HeaderMapper
を介してマップされます。一方、通常の MqttMessage
プロパティは常にヘッダーにマップされます。
内部の IMqttAsyncClient
インスタンスに再接続を処理させるには、MqttConnectionOptions.setAutomaticReconnect(boolean)
を true に設定することを推奨します。そうでない場合は、このコンポーネントを手動で再起動したときのみ、切断時の MqttConnectionFailedEvent
処理などで再接続を処理できます。
型変換の詳細については、setPayloadType(java.lang.Class<?>)
を参照してください。
- 導入:
- 5.5.5
- 作成者:
- Artem Bilan, Mikhail Polivakha, Lucas Bowler, Artem Vozhdayenko, Matthias Thoma
ネストされたクラスのサマリー
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverrides
フィールドのサマリー
クラス org.springframework.integration.mqtt.inbound.AbstractMqttMessageDrivenChannelAdapter から継承されたフィールド
topicLock
クラス org.springframework.integration.endpoint.AbstractEndpoint から継承されたフィールド
lifecycleCondition, lifecycleLock
クラス org.springframework.integration.context.IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, logger
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたフィールド
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
インターフェース org.springframework.context.SmartLifecycle から継承されたフィールド
DEFAULT_PHASE
コンストラクターの概要
コンストラクターコンストラクター説明Mqttv5PahoMessageDrivenChannelAdapter
(StringSE url, StringSE clientId, StringSE... topic) Mqttv5PahoMessageDrivenChannelAdapter
(StringSE url, StringSE clientId, org.eclipse.paho.mqttv5.common.MqttSubscription... mqttSubscriptions) MQTT URL、クライアント ID、サブスクリプションに基づいてインスタンスを作成します。Mqttv5PahoMessageDrivenChannelAdapter
(org.eclipse.paho.mqttv5.client.MqttConnectionOptions connectionOptions, StringSE clientId, StringSE... topic) Mqttv5PahoMessageDrivenChannelAdapter
(org.eclipse.paho.mqttv5.client.MqttConnectionOptions connectionOptions, StringSE clientId, org.eclipse.paho.mqttv5.common.MqttSubscription... mqttSubscriptions) MQTT 接続オプション、クライアント ID、サブスクリプションに基づいてインスタンスを作成します。Mqttv5PahoMessageDrivenChannelAdapter
(ClientManager<org.eclipse.paho.mqttv5.client.IMqttAsyncClient, org.eclipse.paho.mqttv5.client.MqttConnectionOptions> clientManager, StringSE... topic) 単一のClientManager
を使用する必要がある場合 (たとえば、MQTT 接続を再利用する場合) に、このコンストラクターを使用します。Mqttv5PahoMessageDrivenChannelAdapter
(ClientManager<org.eclipse.paho.mqttv5.client.IMqttAsyncClient, org.eclipse.paho.mqttv5.client.MqttConnectionOptions> clientManager, org.eclipse.paho.mqttv5.common.MqttSubscription... mqttSubscriptions) クライアントマネージャーとサブスクリプションに基づいてインスタンスを作成します。メソッドのサマリー
修飾子と型メソッド説明void
トピックを購読リストに追加します。void
authPacketArrived
(int reasonCode, org.eclipse.paho.mqttv5.common.packet.MqttProperties properties) void
connectComplete
(boolean isReconnect) サーバーへの接続が正常に完了したときに呼び出されます。void
connectComplete
(boolean reconnect, StringSE serverURI) void
deliveryComplete
(org.eclipse.paho.mqttv5.client.IMqttToken token) void
destroy()
void
disconnected
(org.eclipse.paho.mqttv5.client.MqttDisconnectResponse disconnectResponse) protected void
doStart()
デフォルトでは何もしません。protected void
doStop()
デフォルトでは何もしません。org.eclipse.paho.mqttv5.client.MqttConnectionOptions
接続に関する情報を返します。void
messageArrived
(StringSE topic, org.eclipse.paho.mqttv5.common.MqttMessage mqttMessage) void
mqttErrorOccurred
(org.eclipse.paho.mqttv5.common.MqttException exception) protected void
onInit()
サブクラスは、初期化ロジック用にこれを実装できます。void
removeTopic
(StringSE... topic) 購読リストからトピックを削除します。void
setConverter
(MqttMessageConverter converter) void
setHeaderMapper
(HeaderMapper<org.eclipse.paho.mqttv5.common.packet.MqttProperties> headerMapper) void
setMessageConverter
(SmartMessageConverter messageConverter) void
setPayloadType
(ClassSE<?> payloadType) MQTT メッセージからの変換後に生成するターゲットメッセージペイロードの型を設定します。void
setPersistence
(org.eclipse.paho.mqttv5.client.MqttClientPersistence persistence) void
setQos
(int... qos) 各トピックの QoS を設定します。単一の値がすべてのトピックに適用されます。それ以外の場合は、正しい数の QoS 値を指定する必要があります。クラス org.springframework.integration.mqtt.inbound.AbstractMqttMessageDrivenChannelAdapter から継承されたメソッド
addTopic, addTopics, getApplicationEventPublisher, getClientId, getClientManager, getCompletionTimeout, getComponentType, getConverter, getDisconnectCompletionTimeout, getQos, getTopic, getUrl, isManualAcks, setApplicationEventPublisher, setCompletionTimeout, setDisconnectCompletionTimeout, setManualAcks
クラス org.springframework.integration.endpoint.MessageProducerSupport から継承されたメソッド
afterSingletonsInstantiated, buildErrorMessage, getErrorChannel, getErrorMessageAttributes, getErrorMessageStrategy, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, isObserved, registerObservationRegistry, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setObservationConvention, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrack, subscribeToPublisher
クラス org.springframework.integration.endpoint.AbstractEndpoint から継承されたメソッド
doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stop
クラス org.springframework.integration.context.IntegrationObjectSupport から継承されたメソッド
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSE
インターフェース org.springframework.beans.factory.BeanNameAware から継承されたメソッド
setBeanName
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたメソッド
getManagedName, getManagedType, getOverrides, getThisAs, isLoggingEnabled, registerMetricsCaptor, setLoggingEnabled, setManagedName, setManagedType
インターフェース org.springframework.integration.mqtt.core.MqttComponent から継承されたメソッド
getBeanName
インターフェース org.springframework.integration.support.context.NamedComponent から継承されたメソッド
getBeanName, getComponentName
コンストラクターの詳細
Mqttv5PahoMessageDrivenChannelAdapter
Mqttv5PahoMessageDrivenChannelAdapter
Mqttv5PahoMessageDrivenChannelAdapter
public Mqttv5PahoMessageDrivenChannelAdapter(org.eclipse.paho.mqttv5.client.MqttConnectionOptions connectionOptions, StringSE clientId, org.eclipse.paho.mqttv5.common.MqttSubscription... mqttSubscriptions) MQTT 接続オプション、クライアント ID、サブスクリプションに基づいてインスタンスを作成します。- パラメーター:
connectionOptions
- MQTT 接続オプション。clientId
- 一意のクライアント ID。mqttSubscriptions
- MQTT サブスクリプション。- 導入:
- 6.3
Mqttv5PahoMessageDrivenChannelAdapter
Mqttv5PahoMessageDrivenChannelAdapter
public Mqttv5PahoMessageDrivenChannelAdapter(ClientManager<org.eclipse.paho.mqttv5.client.IMqttAsyncClient, org.eclipse.paho.mqttv5.client.MqttConnectionOptions> clientManager, org.eclipse.paho.mqttv5.common.MqttSubscription... mqttSubscriptions) クライアントマネージャーとサブスクリプションに基づいてインスタンスを作成します。- パラメーター:
clientManager
- クライアントマネージャー。mqttSubscriptions
- MQTT サブスクリプション。- 導入:
- 6.3
Mqttv5PahoMessageDrivenChannelAdapter
public Mqttv5PahoMessageDrivenChannelAdapter(ClientManager<org.eclipse.paho.mqttv5.client.IMqttAsyncClient, org.eclipse.paho.mqttv5.client.MqttConnectionOptions> clientManager, StringSE... topic) 単一のClientManager
を使用する必要がある場合 (たとえば、MQTT 接続を再利用する場合) に、このコンストラクターを使用します。- パラメーター:
clientManager
- クライアントマネージャー。topic
- トピック。- 導入:
- 6.0
メソッドの詳細
getConnectionInfo
public org.eclipse.paho.mqttv5.client.MqttConnectionOptions getConnectionInfo()インターフェースからコピーされた説明:MqttComponent
接続に関する情報を返します。- 次で指定:
- インターフェース
MqttComponent<org.eclipse.paho.mqttv5.client.MqttConnectionOptions>
のgetConnectionInfo
- 戻り値:
- 情報。
setPersistence
public void setPersistence(@Nullable org.eclipse.paho.mqttv5.client.MqttClientPersistence persistence) setConverter
- オーバーライド:
- クラス
AbstractMqttMessageDrivenChannelAdapter<org.eclipse.paho.mqttv5.client.IMqttAsyncClient,
のorg.eclipse.paho.mqttv5.client.MqttConnectionOptions> setConverter
setMessageConverter
setPayloadType
MQTT メッセージからの変換後に生成するターゲットメッセージペイロードの型を設定します。デフォルトはbyte[].class
です - 変換せずに MQTT メッセージペイロードを抽出するだけです。MQTT メッセージ全体をペイロードとして生成するためにMqttMessage
クラスに設定できます。- パラメーター:
payloadType
- MQTT メッセージを変換するために期待されるペイロード型。
setHeaderMapper
public void setHeaderMapper(HeaderMapper<org.eclipse.paho.mqttv5.common.packet.MqttProperties> headerMapper) onInit
protected void onInit()クラスからコピーされた説明:IntegrationObjectSupport
サブクラスは、初期化ロジック用にこれを実装できます。- オーバーライド:
- クラス
AbstractMqttMessageDrivenChannelAdapter<org.eclipse.paho.mqttv5.client.IMqttAsyncClient,
のorg.eclipse.paho.mqttv5.client.MqttConnectionOptions> onInit
doStart
protected void doStart()クラスからコピーされた説明:MessageProducerSupport
デフォルトでは何も実行されません。ライフサイクル管理された動作が必要な場合、サブクラスはこれをオーバーライドできます。'lifecycleLock' によって保護されています。- オーバーライド:
- クラス
MessageProducerSupport
のdoStart
doStop
protected void doStop()クラスからコピーされた説明:MessageProducerSupport
デフォルトでは何もしません。サブクラスは、ライフサイクル管理の動作が必要な場合、これをオーバーライドできます。- オーバーライド:
- クラス
MessageProducerSupport
のdoStop
destroy
public void destroy()- 次で指定:
- インターフェース
DisposableBean
のdestroy
- 次で指定:
- インターフェース
IntegrationManagement
のdestroy
- オーバーライド:
- クラス
AbstractMqttMessageDrivenChannelAdapter<org.eclipse.paho.mqttv5.client.IMqttAsyncClient,
のorg.eclipse.paho.mqttv5.client.MqttConnectionOptions> destroy
setQos
public void setQos(int... qos) クラスからコピーされた説明:AbstractMqttMessageDrivenChannelAdapter
各トピックの QoS を設定します。単一の値がすべてのトピックに適用されます。それ以外の場合は、正しい数の QoS 値を指定する必要があります。- オーバーライド:
- クラス
AbstractMqttMessageDrivenChannelAdapter<org.eclipse.paho.mqttv5.client.IMqttAsyncClient,
のorg.eclipse.paho.mqttv5.client.MqttConnectionOptions> setQos
- パラメーター:
qos
- QoS 値。
addTopic
クラスからコピーされた説明:AbstractMqttMessageDrivenChannelAdapter
トピックを購読リストに追加します。- オーバーライド:
- クラス
AbstractMqttMessageDrivenChannelAdapter<org.eclipse.paho.mqttv5.client.IMqttAsyncClient,
のorg.eclipse.paho.mqttv5.client.MqttConnectionOptions> addTopic
- パラメーター:
topic
- トピック。qos
- QoS。
removeTopic
クラスからコピーされた説明:AbstractMqttMessageDrivenChannelAdapter
購読リストからトピックを削除します。- オーバーライド:
- クラス
AbstractMqttMessageDrivenChannelAdapter<org.eclipse.paho.mqttv5.client.IMqttAsyncClient,
のorg.eclipse.paho.mqttv5.client.MqttConnectionOptions> removeTopic
- パラメーター:
topic
- トピック。
messageArrived
- 次で指定:
- インターフェース
org.eclipse.paho.mqttv5.client.MqttCallback
のmessageArrived
disconnected
public void disconnected(org.eclipse.paho.mqttv5.client.MqttDisconnectResponse disconnectResponse) - 次で指定:
- インターフェース
org.eclipse.paho.mqttv5.client.MqttCallback
のdisconnected
mqttErrorOccurred
public void mqttErrorOccurred(org.eclipse.paho.mqttv5.common.MqttException exception) - 次で指定:
- インターフェース
org.eclipse.paho.mqttv5.client.MqttCallback
のmqttErrorOccurred
deliveryComplete
public void deliveryComplete(org.eclipse.paho.mqttv5.client.IMqttToken token) - 次で指定:
- インターフェース
org.eclipse.paho.mqttv5.client.MqttCallback
のdeliveryComplete
connectComplete
public void connectComplete(boolean isReconnect) インターフェースからコピーされた説明:ClientManager.ConnectCallback
サーバーへの接続が正常に完了したときに呼び出されます。- 次で指定:
- インターフェース
ClientManager.ConnectCallback
のconnectComplete
- パラメーター:
isReconnect
- true の場合、接続は自動再接続の結果です。
connectComplete
- 次で指定:
- インターフェース
org.eclipse.paho.mqttv5.client.MqttCallback
のconnectComplete
authPacketArrived
public void authPacketArrived(int reasonCode, org.eclipse.paho.mqttv5.common.packet.MqttProperties properties) - 次で指定:
- インターフェース
org.eclipse.paho.mqttv5.client.MqttCallback
のauthPacketArrived