クラス AbstractMqttMessageHandler<T,C>
java.lang.ObjectSE
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.mqtt.outbound.AbstractMqttMessageHandler<T,C>
- 型パラメーター:
T- MQTT クライアントの種類C- MQTT 接続オプション型 (v5 または v3)
- 実装されているすべてのインターフェース:
org.reactivestreams.Subscriber<Message<?>>、Aware、BeanFactoryAware、BeanNameAware、DisposableBean、InitializingBean、ApplicationContextAware、ApplicationEventPublisherAware、Lifecycle、Ordered、ComponentSourceAware、ExpressionCapable、Orderable、IntegrationPattern、NamedComponent、IntegrationManagement、ManageableLifecycle、TrackableComponent、MessageHandler、reactor.core.CoreSubscriber<Message<?>>
- 既知の直属サブクラス
MqttPahoMessageHandler,Mqttv5PahoMessageHandler
public abstract class AbstractMqttMessageHandler<T,C>
extends AbstractMessageHandler
implements ManageableLifecycle, ApplicationEventPublisherAware
MQTT 送信・チャネルアダプターの抽象クラス。
- 導入:
- 4.0
- 作成者:
- Gary Russell, Artem Bilan, Artem Vozhdayenko
ネストされたクラスの要約
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverridesフィールドのサマリー
フィールド修飾子と型フィールド説明static final longミリ秒単位のデフォルトの完了タイムアウト。static final longミリ秒単位のデフォルトの切断完了タイムアウト。protected final LockSEクラス org.springframework.integration.context.IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, loggerインターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたフィールド
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEインターフェース org.springframework.core.Ordered から継承されたフィールド
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCEコンストラクターの概要
コンストラクターコンストラクター説明AbstractMqttMessageHandler(@Nullable StringSE url, StringSE clientId) AbstractMqttMessageHandler(ClientManager<T, C> clientManager) 方法の概要
修飾子と型メソッド説明protected abstract voiddoStart()protected abstract voiddoStop()protected ApplicationEventPublisherintクライアントが接続されるたびに増加します。protected @Nullable ClientManager<T, C> protected longprotected MessageConverterprotected intprotected booleanprotected @Nullable StringSEprotected longprotected MessageProcessor<IntegerSE> protected MessageProcessor<BooleanSE> protected MessageProcessor<StringSE> protected @Nullable StringSEgetUrl()protected voidhandleMessageInternal(Message<?> message) protected voidprotected booleanisAsync()booleanprotected voidmessageSentEvent(Message<?> message, StringSE topic, int messageId) protected voidonInit()サブクラスは、初期化ロジック用にこれを実装できます。protected abstract voidprotected voidsendDeliveryCompleteEvent(int messageId) protected voidsendFailedDeliveryEvent(int messageId, ThrowableSE exception) voidsetApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) voidsetAsync(boolean async) メッセージを送信するときにブロックしない場合は、true に設定します。voidsetAsyncEvents(boolean asyncEvents) setAsync(boolean)が true の場合、これを true に設定すると、MqttMessageSentEventおよびMqttMessageDeliveredEventの発行が発行されます。voidsetCompletionTimeout(long completionTimeout) 非同期操作の完了タイムアウトを設定します。voidsetConverter(MessageConverter converter) 使用するメッセージコンバーターを設定します。これが指定されている場合、アダプターの QoS および保持されている設定は無視されます。voidsetDefaultQos(int defaultQos) qosExpressionが null と評価される場合、メッセージの qos を設定します。voidsetDefaultRetained(boolean defaultRetained) retainedExpressionが null と評価された場合、メッセージの保持ブール値を設定します。voidsetDefaultTopic(StringSE defaultTopic) topicExpressionが `null` と評価された場合にメッセージが公開されるトピックを設定します。voidsetDisconnectCompletionTimeout(long completionTimeout) 切断時の完了タイムアウトを設定します。voidsetQosExpression(Expression qosExpression) qos 式を設定します。デフォルトは "headers ['mqtt_qos' ]" です。voidsetQosExpressionString(StringSE qosExpression) qos 式を設定します。デフォルトは "headers ['mqtt_qos' ]" です。voidsetRetainedExpression(Expression retainedExpression) 保持された式を設定します。デフォルトは "headers ['mqtt_retained' ]" です。voidsetRetainedExpressionString(StringSE retainedExpression) 保持された式を設定します。デフォルトは "headers ['mqtt_retained' ]" です。voidsetTopicExpression(Expression topicExpression) トピック式を設定します。デフォルトは "headers ['mqtt_topic' ]" です。voidsetTopicExpressionString(StringSE topicExpression) トピック式を設定します。デフォルトは "headers ['mqtt_topic' ]" です。final voidstart()final voidstop()クラス org.springframework.integration.handler.AbstractMessageHandler から継承されたメソッド
handleMessage, onComplete, onError, onNext, onSubscribe, setObservationConventionクラス org.springframework.integration.handler.MessageHandlerSupport から継承されたメソッド
buildSendTimer, destroy, getIntegrationPatternType, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackクラス 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インターフェース reactor.core.CoreSubscriber から継承されたメソッド
currentContextインターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたメソッド
getThisAsインターフェース org.springframework.integration.support.context.NamedComponent から継承されたメソッド
getBeanName, getComponentName
フィールドの詳細
DISCONNECT_COMPLETION_TIMEOUT
public static final long DISCONNECT_COMPLETION_TIMEOUTミリ秒単位のデフォルトの切断完了タイムアウト。- 関連事項:
DEFAULT_COMPLETION_TIMEOUT
public static final long DEFAULT_COMPLETION_TIMEOUTミリ秒単位のデフォルトの完了タイムアウト。- 関連事項:
lock
コンストラクターの詳細
AbstractMqttMessageHandler
AbstractMqttMessageHandler
メソッドの詳細
setApplicationEventPublisher
- 次で指定:
- インターフェース
ApplicationEventPublisherAwareのsetApplicationEventPublisher
getApplicationEventPublisher
setDefaultTopic
topicExpressionが `null` と評価された場合にメッセージが公開されるトピックを設定します。- パラメーター:
defaultTopic- デフォルトのトピック。
getDefaultTopic
setTopicExpression
トピック式を設定します。デフォルトは "headers ['mqtt_topic' ]" です。- パラメーター:
topicExpression- 表現。- 導入:
- 5.0
setTopicExpressionString
トピック式を設定します。デフォルトは "headers ['mqtt_topic' ]" です。- パラメーター:
topicExpression- 表現。- 導入:
- 5.0
getTopicProcessor
setDefaultQos
public void setDefaultQos(int defaultQos) qosExpressionが null と評価される場合、メッセージの qos を設定します。メッセージコンバーターが提供されていない場合にのみ適用されます。- パラメーター:
defaultQos- デフォルトの QoS。- 関連事項:
getDefaultQos
protected int getDefaultQos()setQosExpression
qos 式を設定します。デフォルトは "headers ['mqtt_qos' ]" です。メッセージコンバーターが提供されていない場合にのみ適用されます。- パラメーター:
qosExpression- 表現。- 導入:
- 5.0
- 関連事項:
setQosExpressionString
qos 式を設定します。デフォルトは "headers ['mqtt_qos' ]" です。メッセージコンバーターが提供されていない場合にのみ適用されます。- パラメーター:
qosExpression- 表現。- 導入:
- 5.0
- 関連事項:
getQosProcessor
setDefaultRetained
public void setDefaultRetained(boolean defaultRetained) retainedExpressionが null と評価された場合、メッセージの保持ブール値を設定します。メッセージコンバーターが提供されていない場合にのみ適用されます。- パラメーター:
defaultRetained- デフォルトの defaultRetained。- 関連事項:
getDefaultRetained
protected boolean getDefaultRetained()setRetainedExpression
保持された式を設定します。デフォルトは "headers ['mqtt_retained' ]" です。メッセージコンバーターが提供されていない場合にのみ適用されます。- パラメーター:
retainedExpression- 表現。- 導入:
- 5.0
- 関連事項:
setRetainedExpressionString
保持された式を設定します。デフォルトは "headers ['mqtt_retained' ]" です。メッセージコンバーターが提供されていない場合にのみ適用されます。- パラメーター:
retainedExpression- 表現。- 導入:
- 5.0
- 関連事項:
getRetainedProcessor
setConverter
使用するメッセージコンバーターを設定します。これが指定されている場合、アダプターの QoS および保持されている設定は無視されます。- パラメーター:
converter- コンバーター。
getConverter
getUrl
getClientId
getClientInstance
public int getClientInstance()クライアントが接続されるたびに増加します。- 戻り値:
- インスタンス。
- 導入:
- 4.1
getComponentType
- 次で指定:
- インターフェース
NamedComponentのgetComponentType - オーバーライド:
- クラス
MessageHandlerSupportのgetComponentType
incrementClientInstance
protected void incrementClientInstance()setCompletionTimeout
getCompletionTimeout
protected long getCompletionTimeout()setDisconnectCompletionTimeout
getDisconnectCompletionTimeout
protected long getDisconnectCompletionTimeout()getClientManager
setAsync
public void setAsync(boolean async) メッセージを送信するときにブロックしない場合は、true に設定します。デフォルトは false。true の場合、メッセージ送信 / 配信イベントは、適切に構成された "ApplicationListener" またはイベント inbound-channel-adapter による受信のために公開されます。- パラメーター:
async- 非同期の場合は true。- 関連事項:
isAsync
protected boolean isAsync()setAsyncEvents
public void setAsyncEvents(boolean asyncEvents) setAsync(boolean)が true の場合、これを true に設定すると、MqttMessageSentEventおよびMqttMessageDeliveredEventの発行が発行されます。デフォルトは false。- パラメーター:
asyncEvents- asyncEvents。
onInit
protected void onInit()クラスからコピーされた説明:IntegrationObjectSupportサブクラスは、初期化ロジック用にこれを実装できます。- オーバーライド:
- クラス
IntegrationObjectSupportのonInit
start
public final void start()- 次で指定:
- インターフェース
Lifecycleのstart - 次で指定:
- インターフェース
ManageableLifecycleのstart
doStart
protected abstract void doStart()stop
public final void stop()- 次で指定:
- インターフェース
Lifecycleのstop - 次で指定:
- インターフェース
ManageableLifecycleのstop
doStop
protected abstract void doStop()isRunning
public boolean isRunning()- 次で指定:
- インターフェース
LifecycleのisRunning - 次で指定:
- インターフェース
ManageableLifecycleのisRunning
handleMessageInternal
- 次で指定:
- クラス
AbstractMessageHandlerのhandleMessageInternal
messageSentEvent
sendDeliveryCompleteEvent
protected void sendDeliveryCompleteEvent(int messageId) sendFailedDeliveryEvent
publish