Class MongoDbOutboundGatewaySpec
java.lang.Object
org.springframework.integration.dsl.IntegrationComponentSpec<S,H>
 
org.springframework.integration.dsl.MessageHandlerSpec<MongoDbOutboundGatewaySpec,MongoDbOutboundGateway>
 
org.springframework.integration.mongodb.dsl.MongoDbOutboundGatewaySpec
- All Implemented Interfaces:
- DisposableBean,- FactoryBean<MongoDbOutboundGateway>,- InitializingBean,- Lifecycle,- Phased,- SmartLifecycle
public class MongoDbOutboundGatewaySpec
extends MessageHandlerSpec<MongoDbOutboundGatewaySpec,MongoDbOutboundGateway> 
A 
MessageHandlerSpec extension for the MongoDb Outbound endpoint MongoDbOutboundGateway.- Since:
- 5.0
- Author:
- Xavier Padro, Artem Bilan
- 
Field SummaryFields inherited from class org.springframework.integration.dsl.IntegrationComponentSpeclogger, PARSER, targetFields inherited from interface org.springframework.beans.factory.FactoryBeanOBJECT_TYPE_ATTRIBUTEFields inherited from interface org.springframework.context.SmartLifecycleDEFAULT_PHASE
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedMongoDbOutboundGatewaySpec(MongoOperations mongoTemplate) protectedMongoDbOutboundGatewaySpec(MongoDatabaseFactory mongoDbFactory, MongoConverter mongoConverter) 
- 
Method SummaryModifier and TypeMethodDescriptioncollectionCallback(MessageCollectionCallback<P> collectionCallback) Reference to an instance ofMessageCollectionCallbackwhich specifies the database operation to execute in the request message context.collectionName(String collectionName) Identify the name of the MongoDb collection to use.collectionNameExpression(String collectionNameExpression) A SpEL expression which should resolve to aStringvalue identifying the name of the MongoDb collection to use.collectionNameFunction(Function<Message<P>, String> collectionNameFunction) entityClass(Class<?> entityClass) The fully qualified name of the entity class to be passed tofind(..)orfindOne(..)method inMongoOperations.expectSingleResult(boolean expectSingleResult) This parameter indicates that only one result object will be returned from the database by using afindOnequery.AStringrepresentation of a MongoDbQuery(e.g., query("{'name' : 'Bob'}")).queryExpression(String queryExpression) A SpEL expression which should resolve to aStringquery (please refer to the 'query' property), or to an instance of MongoDbQuery(e.q., queryExpression("new BasicQuery('{''address.state'' : ''PA''}')")).queryFunction(Function<Message<P>, Query> queryFunction) Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec_this, afterPropertiesSet, destroy, doGet, get, getId, getObject, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stopMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.FactoryBeanisSingleton
- 
Constructor Details- 
MongoDbOutboundGatewaySpecprotected MongoDbOutboundGatewaySpec(MongoDatabaseFactory mongoDbFactory, MongoConverter mongoConverter) 
- 
MongoDbOutboundGatewaySpec
 
- 
- 
Method Details- 
expectSingleResultThis parameter indicates that only one result object will be returned from the database by using afindOnequery. If set tofalse(default), the complete result list is returned as the payload.- Parameters:
- expectSingleResult- the- booleanflag to indicate if a single result is returned or not.
- Returns:
- the spec
 
- 
queryAStringrepresentation of a MongoDbQuery(e.g., query("{'name' : 'Bob'}")). Please refer to MongoDb documentation for more query samples see MongoDB Docs This property is mutually exclusive with 'queryExpression' property.- Parameters:
- query- the MongoDb- Querystring representation to use.
- Returns:
- the spec
 
- 
queryExpressionA SpEL expression which should resolve to aStringquery (please refer to the 'query' property), or to an instance of MongoDbQuery(e.q., queryExpression("new BasicQuery('{''address.state'' : ''PA''}')")).- Parameters:
- queryExpression- the SpEL expression query to use.
- Returns:
- the spec
 
- 
queryFunction- Type Parameters:
- P- the type of the message payload.
- Parameters:
- queryFunction- the- Functionto use.
- Returns:
- the spec
 
- 
entityClassThe fully qualified name of the entity class to be passed tofind(..)orfindOne(..)method inMongoOperations. If this attribute is not provided the default value isDocument.- Parameters:
- entityClass- the- Classto use.
- Returns:
- the spec
 
- 
collectionNameIdentify the name of the MongoDb collection to use. This attribute is mutually exclusive withcollectionNameExpression(java.lang.String)property.- Parameters:
- collectionName- the- Stringspecifying the MongoDb collection.
- Returns:
- the spec
 
- 
collectionNameExpressionA SpEL expression which should resolve to aStringvalue identifying the name of the MongoDb collection to use. This property is mutually exclusive withcollectionName(java.lang.String)property.- Parameters:
- collectionNameExpression- the- Stringexpression to use.
- Returns:
- the spec
 
- 
collectionNameFunctionpublic <P> MongoDbOutboundGatewaySpec collectionNameFunction(Function<Message<P>, String> collectionNameFunction) - Type Parameters:
- P- the type of the message payload.
- Parameters:
- collectionNameFunction- the- Functionto use.
- Returns:
- the spec
 
- 
collectionCallbackpublic <P> MongoDbOutboundGatewaySpec collectionCallback(MessageCollectionCallback<P> collectionCallback) Reference to an instance ofMessageCollectionCallbackwhich specifies the database operation to execute in the request message context. This property is mutually exclusive withquery(java.lang.String)andqueryExpression(java.lang.String)properties.- Type Parameters:
- P- the type of the message payload.
- Parameters:
- collectionCallback- the- MessageCollectionCallbackinstance
- Returns:
- the spec
- Since:
- 5.0.11
 
 
-