クラス AbstractHttpRequestExecutingMessageHandler
java.lang.ObjectSE
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.handler.AbstractMessageProducingHandler
org.springframework.integration.handler.AbstractReplyProducingMessageHandler
org.springframework.integration.http.outbound.AbstractHttpRequestExecutingMessageHandler
- 実装済みのインターフェース一覧:
org.reactivestreams.Subscriber<Message<?>>、Aware、BeanClassLoaderAware、BeanFactoryAware、BeanNameAware、DisposableBean、InitializingBean、ApplicationContextAware、Ordered、ComponentSourceAware、ExpressionCapable、Orderable、MessageProducer、HeaderPropagationAware、IntegrationPattern、NamedComponent、IntegrationManagement、TrackableComponent、MessageHandler、reactor.core.CoreSubscriber<Message<?>>
public abstract class AbstractHttpRequestExecutingMessageHandler
extends AbstractReplyProducingMessageHandler
http 送信アダプター / ゲートウェイの基本クラス。
- 導入:
- 5.0
- 作成者:
- Mark Fisher, Oleg Zhurakousky, Gary Russell, Gunnar Hillert, Artem Bilan, Wallace Wadge, Shiliang Li, Florian Sch ö ffl, Christian Tzolov, Ngoc Nhan
ネストされたクラスの概要
クラス org.springframework.integration.handler.AbstractReplyProducingMessageHandler から継承されたネストクラス / インターフェース
AbstractReplyProducingMessageHandler.RequestHandlerインターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverridesフィールド概要
フィールドクラス org.springframework.integration.handler.AbstractMessageProducingHandler から継承されたフィールド
messagingTemplateクラス 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コンストラクター概要
コンストラクター方法の概要
修飾子と型メソッド説明protected voiddoInit()protected ObjectSEevaluateTypeFromExpression(Message<?> requestMessage, @Nullable Expression expression, StringSE property) protected abstract @Nullable ObjectSEexchange(ObjectSE uri, HttpMethod httpMethod, HttpEntity<?> httpRequest, ObjectSE expectedResponseType, Message<?> requestMessage, MapSE<StringSE, ?> uriVariables) このコンポーネントが実装するパターン型を返します。protected ObjectSEgetReply(ResponseEntity<?> httpResponse) protected @Nullable ObjectSEhandleRequestMessage(Message<?> requestMessage) サブクラスはこのメソッドを実装して、リクエストメッセージを処理する必要があります。booleanprotected HttpHeadersmapHeaders(Message<?> message) voidsetCharset(StringSE charset) 文字列型のペイロードをバイトに変換するために使用する文字セット名を指定します。voidsetEncodingMode(DefaultUriBuilderFactory.EncodingMode encodingMode) 使用するエンコードモードを設定します。voidsetExpectedResponseType(ClassSE<?> expectedResponseType) REST リクエストの予想されるレスポンス型を指定します。voidsetExpectedResponseTypeExpression(Expression expectedResponseTypeExpression) voidsetExpectReply(boolean expectReply) 返信メッセージが必要かどうかを指定します。voidsetExtractPayload(boolean extractPayload) リクエスト本文の準備時に送信メッセージのペイロードを抽出するかどうかを指定します。voidsetExtractResponseBody(boolean extractResponseBody) 応答メッセージのペイロード用にResponseEntityの本文を抽出するフラグ。voidsetHeaderMapper(HeaderMapper<HttpHeaders> headerMapper) HTTP ヘッダーと MessageHeaders の間のマッピング時に使用するHeaderMapperを設定します。voidsetHttpMethod(HttpMethod httpMethod) リクエストにはHttpMethodを指定します。voidsetHttpMethodExpression(Expression httpMethodExpression) SpELExpressionを指定して、実行時にHttpMethodを決定します。voidsetTransferCookies(boolean transferCookies) レスポンスの "Set-Cookie" ヘッダーをメッセージの後続の対話で "Cookie" ヘッダーとして転送する場合は、true に設定します。voidsetTrustedSpel(boolean trustedSpel) URI 変数の評価に使用される SpEL 式のソースを信頼する場合は、true に設定します。voidsetUriVariableExpressions(MapSE<StringSE, Expression> uriVariableExpressions) URI テンプレートの変数プレースホルダーを置き換えるときに、送信メッセージに対して評価するように URI 変数式のマップを設定します。voidsetUriVariablesExpression(Expression uriVariablesExpression) 送信メッセージに対して評価するようにExpressionを設定します。式は、URI テンプレートの変数プレースホルダーを置き換えるときに、送信メッセージに対して評価するために、URI 変数式のマップに評価される必要があります。クラス org.springframework.integration.handler.AbstractReplyProducingMessageHandler から継承されたメソッド
doInvokeAdvisedRequestHandler, getBeanClassLoader, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReplyクラス org.springframework.integration.handler.AbstractMessageProducingHandler から継承されたメソッド
addNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, setupMessageProcessor, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeadersクラス org.springframework.integration.handler.AbstractMessageHandler から継承されたメソッド
handleMessage, onComplete, onError, onNext, onSubscribe, setObservationConventionクラス org.springframework.integration.handler.MessageHandlerSupport から継承されたメソッド
buildSendTimer, destroy, getComponentType, 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
フィールドの詳細
uriFactory
コンストラクターの詳細
AbstractHttpRequestExecutingMessageHandler
メソッドの詳細
setEncodingMode
使用するエンコードモードを設定します。デフォルトでは、これはDefaultUriBuilderFactory.EncodingMode.TEMPLATE_AND_VALUESに設定されています。より複雑なシナリオでは、外部から提供されたRestTemplateでUriTemplateHandlerを構成することを検討してください。- パラメーター:
encodingMode- uri エンコーディングに使用するモード- 導入:
- 5.3
setHttpMethodExpression
SpELExpressionを指定して、実行時にHttpMethodを決定します。- パラメーター:
httpMethodExpression- メソッド式。
setHttpMethod
リクエストにはHttpMethodを指定します。デフォルトの方法はPOSTです。- パラメーター:
httpMethod- メソッド。
setExtractPayload
public void setExtractPayload(boolean extractPayload) リクエスト本文の準備時に送信メッセージのペイロードを抽出するかどうかを指定します。それ以外の場合、メッセージインスタンス自体は直列化されます。デフォルト値はtrueです。- パラメーター:
extractPayload- ペイロードを抽出する必要がある場合は true。
setCharset
文字列型のペイロードをバイトに変換するために使用する文字セット名を指定します。デフォルトはUTF-8です。- パラメーター:
charset- 文字セット。
isExpectReply
public boolean isExpectReply()- 戻り値:
- 返信メッセージが期待されるかどうか。
- 関連事項:
setExpectReply
public void setExpectReply(boolean expectReply) 返信メッセージが必要かどうかを指定します。そうでない場合、このハンドラーは、成功したレスポンスの場合は単に null を返すか、失敗したレスポンスの場合は例外をスローします。デフォルトは true です。- パラメーター:
expectReply- 応答が期待される場合は true。
setExpectedResponseType
REST リクエストの予想されるレスポンス型を指定します。それ以外の場合は null となり、HTTP クライアントから空のResponseEntityが返されます。このアダプターに登録されている HttpMessageConverters を利用するには、別の型を指定します。- パラメーター:
expectedResponseType- 予想される型。setExpectedResponseTypeExpression(Expression)も参照してください
setExpectedResponseTypeExpression
- パラメーター:
expectedResponseTypeExpression- 期待されるレスポンス型の式。setExpectedResponseType(java.lang.Class<?>)も参照してください
setHeaderMapper
HTTP ヘッダーと MessageHeaders の間のマッピング時に使用するHeaderMapperを設定します。- パラメーター:
headerMapper- ヘッダーマッパー。
setUriVariableExpressions
URI テンプレートの変数プレースホルダーを置き換えるときに、送信メッセージに対して評価するように URI 変数式のマップを設定します。- パラメーター:
uriVariableExpressions- URI 変数式。
setUriVariablesExpression
送信メッセージに対して評価するようにExpressionを設定します。式は、URI テンプレートの変数プレースホルダーを置き換えるときに、送信メッセージに対して評価するために、URI 変数式のマップに評価される必要があります。- パラメーター:
uriVariablesExpression- URI 変数式。
setTransferCookies
public void setTransferCookies(boolean transferCookies) レスポンスの "Set-Cookie" ヘッダーをメッセージの後続のインタラクションで "Cookie" ヘッダーとして転送する場合は、true に設定します。デフォルトは false です。- パラメーター:
transferCookies- transferCookies を設定します。
setTrustedSpel
public void setTrustedSpel(boolean trustedSpel) URI 変数の評価に使用される SpEL 式のソースを信頼する場合は、true に設定します。デフォルトは false です。これは、SimpleEvaluationContextがそのような式の評価に使用されることを意味し、一部の SpEL 機能の使用を制限します。- パラメーター:
trustedSpel- 信頼するのは本当です。- 導入:
- 4.3.15.
setExtractResponseBody
public void setExtractResponseBody(boolean extractResponseBody) 応答メッセージのペイロード用にResponseEntityの本文を抽出するフラグ。デフォルトは true です。- パラメーター:
extractResponseBody-ResponseEntity全体またはその本文のみを含む返信メッセージを作成します。- 導入:
- 5.5
getIntegrationPatternType
インターフェースからコピーされた説明:IntegrationPatternこのコンポーネントが実装するパターン型を返します。- 次で指定:
- インターフェース
IntegrationPatternのgetIntegrationPatternType - オーバーライド:
- クラス
AbstractReplyProducingMessageHandlerのgetIntegrationPatternType - 戻り値:
- このコンポーネントが実装する
IntegrationPatternType
doInit
protected void doInit()- オーバーライド:
- クラス
AbstractReplyProducingMessageHandlerのdoInit
handleRequestMessage
クラスからコピーされた説明:AbstractReplyProducingMessageHandlerサブクラスはこのメソッドを実装して、リクエストメッセージを処理する必要があります。戻り値は、メッセージ、MessageBuilder、任意のプレーンオブジェクトです。基本クラスは、これらの開始点のいずれかからの返信メッセージの最終的な作成を処理します。戻り値が null の場合、メッセージフローはここで終了します。- 次で指定:
- クラス
AbstractReplyProducingMessageHandlerのhandleRequestMessage - パラメーター:
requestMessage- リクエストメッセージ。- 戻り値:
- メッセージを処理した結果、または
null
exchange
protected abstract @Nullable ObjectSE exchange(ObjectSE uri, HttpMethod httpMethod, HttpEntity<?> httpRequest, ObjectSE expectedResponseType, Message<?> requestMessage, MapSE<StringSE, ?> uriVariables) getReply
mapHeaders
evaluateTypeFromExpression
protected ObjectSE evaluateTypeFromExpression(Message<?> requestMessage, @Nullable Expression expression, StringSE property)