クラス MongoDbMessageSource
java.lang.ObjectSE
org.springframework.integration.util.AbstractExpressionEvaluator
org.springframework.integration.endpoint.AbstractMessageSource<ObjectSE>
org.springframework.integration.mongodb.inbound.AbstractMongoDbMessageSource<ObjectSE>
org.springframework.integration.mongodb.inbound.MongoDbMessageSource
- 実装されているすべてのインターフェース:
Aware
、BeanFactoryAware
、BeanNameAware
、DisposableBean
、InitializingBean
、ApplicationContextAware
、MessageSource<ObjectSE>
、IntegrationPattern
、NamedComponent
、IntegrationInboundManagement
、IntegrationManagement
Query
の実行結果であるペイロードを持つ Message
を返す MessageSource
のインスタンス。expectSingleResult が false (デフォルト) の場合、MongoDb Query
は List
SE を返す MongoOperations.find(Query, Class)
メソッドを使用して実行されます。返された List
SE は、{ AbstractMessageSource.receive()
メソッドによって返される Message
のペイロードとして使用されます。空の List
SE は null として扱われるため、{ AbstractMessageSource.receive()
メソッドによって返される Message
はなくなります。expectSingleResult が true の場合、代わりに MongoOperations.findOne(Query, Class)
が使用され、メッセージペイロードはクエリから返される単一のオブジェクトになります。
- 導入:
- 2.2
- 作成者:
- Amol Nayak, Oleg Zhurakousky, Yaron Yamin, Artem Bilan, Gary Russell
ネストされたクラスの要約
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverrides
フィールドのサマリー
クラス org.springframework.integration.mongodb.inbound.AbstractMongoDbMessageSource から継承されたフィールド
queryExpression
クラス org.springframework.integration.util.AbstractExpressionEvaluator から継承されたフィールド
EXPRESSION_PARSER, logger
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたフィールド
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
コンストラクターの概要
コンストラクターコンストラクター説明MongoDbMessageSource
(MongoOperations mongoTemplate, Expression queryExpression) 提供されたMongoOperations
および SpEL 式を使用してインスタンスを作成します。これは、Mongo の「クエリ」文字列に解決されます(https://www.mongodb.org/display/DOCS/Querying) を参照)。MongoDbMessageSource
(MongoDatabaseFactory mongoDbFactory, Expression queryExpression) 提供されたMongoDatabaseFactory
および SpEL 式を使用してインスタンスを作成します。これは、MongoDb の「クエリ」文字列に解決されます(https://www.mongodb.org/display/DOCS/Querying) を参照)。メソッドのサマリー
クラス org.springframework.integration.mongodb.inbound.AbstractMongoDbMessageSource から継承されたメソッド
evaluateCollectionNameExpression, evaluateQueryExpression, evaluateUpdateExpression, getApplicationContext, getByIdInQuery, getCollectionNameExpression, getEntityClass, getMongoConverter, getUpdateExpression, idForEntity, isExpectSingleResult, isInitialized, setApplicationContext, setCollectionNameExpression, setEntityClass, setExpectSingleResult, setInitialized, setMongoConverter, setUpdateExpression
クラス org.springframework.integration.endpoint.AbstractMessageSource から継承されたメソッド
buildMessage, destroy, getBeanName, getComponentName, getManagedName, getManagedType, getOverrides, isLoggingEnabled, receive, registerMetricsCaptor, setBeanName, setHeaderExpressions, setLoggingEnabled, setManagedName, setManagedType
クラス org.springframework.integration.util.AbstractExpressionEvaluator から継承されたメソッド
afterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, setBeanFactory, setConversionService, setSimpleEvaluationContext
クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSE
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたメソッド
getThisAs, isObserved, registerObservationRegistry
インターフェース org.springframework.integration.core.MessageSource から継承されたメソッド
getIntegrationPatternType
コンストラクターの詳細
MongoDbMessageSource
提供されたMongoDatabaseFactory
と SpEL 式を使用してインスタンスを作成します。これは、MongoDb の「クエリ」文字列に解決される必要があります (https://www.mongodb.org/display/DOCS/Querying) を参照)。"queryExpression" は、AbstractMessageSource.receive()
メソッドへの呼び出しごとに評価されます。- パラメーター:
mongoDbFactory
- mongodb ファクトリ。queryExpression
- クエリ式。
MongoDbMessageSource
提供されたMongoOperations
と SpEL 式を使用してインスタンスを作成します。このインスタンスは、Mongo の「クエリ」文字列に解決されます (https://www.mongodb.org/display/DOCS/Querying) を参照)。MongoOperations
が完全に初期化され、使用できる状態にあることを前提としています。"queryExpression" は、AbstractMessageSource.receive()
メソッドが呼び出されるたびに評価されます。- パラメーター:
mongoTemplate
- mongo テンプレート。queryExpression
- クエリ式。
メソッドの詳細
getComponentType
onInit
protected void onInit()- オーバーライド:
- クラス
AbstractMongoDbMessageSource<ObjectSE>
のonInit
doReceive
Query
を実行し、その結果をメッセージペイロードとして返します。ペイロードは、AbstractMongoDbMessageSource.getEntityClass()
で識別された型のオブジェクトの要素をList
SE とするか、AbstractMongoDbMessageSource.isExpectSingleResult()
属性の値(デフォルトは 'false' )に基づいてAbstractMongoDbMessageSource.getEntityClass()
で識別された型の単一の要素をMessage
とし、List
SE 型のペイロードを返すかのいずれかです。クエリで使用されるコレクション名は、MongoHeaders.COLLECTION_NAME
ヘッダーで指定されます。- 次で指定:
- クラス
AbstractMessageSource<ObjectSE>
のdoReceive
- 戻り値:
- 返された値。