クラス 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 から継承されたフィールド
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トピックを購読リストに追加します。voidauthPacketArrived(int reasonCode, org.eclipse.paho.mqttv5.common.packet.MqttProperties properties) voidconnectComplete(boolean isReconnect) サーバーへの接続が正常に完了したときに呼び出されます。voidconnectComplete(boolean reconnect, StringSE serverURI) voiddeliveryComplete(org.eclipse.paho.mqttv5.client.IMqttToken token) voiddestroy()voiddisconnected(org.eclipse.paho.mqttv5.client.MqttDisconnectResponse disconnectResponse) protected voiddoStart()デフォルトでは何もしません。protected voiddoStop()デフォルトでは何もしません。org.eclipse.paho.mqttv5.client.MqttConnectionOptions接続に関する情報を返します。voidmessageArrived(StringSE topic, org.eclipse.paho.mqttv5.common.MqttMessage mqttMessage) voidmqttErrorOccurred(org.eclipse.paho.mqttv5.common.MqttException exception) protected voidonInit()サブクラスは、初期化ロジック用にこれを実装できます。voidremoveTopic(StringSE... topics) 購読リストからトピックを削除します。voidsetConverter(MqttMessageConverter converter) voidsetHeaderMapper(HeaderMapper<org.eclipse.paho.mqttv5.common.packet.MqttProperties> headerMapper) voidsetMessageConverter(SmartMessageConverter messageConverter) voidsetPayloadType(ClassSE<?> payloadType) MQTT メッセージからの変換後に生成するターゲットメッセージペイロードの型を設定します。voidsetPersistence(org.eclipse.paho.mqttv5.client.MqttClientPersistence persistence) voidsetQos(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, getRequiredOutputChannel, 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
public Mqttv5PahoMessageDrivenChannelAdapter(StringSE url, StringSE clientId, org.eclipse.paho.mqttv5.common.MqttSubscription... mqttSubscriptions) MQTT URL、クライアント ID、サブスクリプションに基づいてインスタンスを作成します。- パラメーター:
url- 接続する MQTT URL。clientId- 一意のクライアント ID。mqttSubscriptions- MQTT サブスクリプション。- 導入:
- 6.3
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 - パラメーター:
topics- トピック。
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