Class MongoDbOutboundGatewaySpec
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<T>
org.springframework.integration.dsl.IntegrationComponentSpec<S,H>
org.springframework.integration.dsl.MessageHandlerSpec<MongoDbOutboundGatewaySpec,MongoDbOutboundGateway>
org.springframework.integration.mongodb.dsl.MongoDbOutboundGatewaySpec
- All Implemented Interfaces:
Aware,BeanClassLoaderAware,BeanFactoryAware,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 Summary
Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
PARSER, target -
Constructor Summary
Constructors Modifier Constructor Description protectedMongoDbOutboundGatewaySpec(MongoOperations mongoTemplate)protectedMongoDbOutboundGatewaySpec(MongoDatabaseFactory mongoDbFactory, MongoConverter mongoConverter) -
Method Summary
Modifier and Type Method Description <P> MongoDbOutboundGatewaySpeccollectionCallback(MessageCollectionCallback<P> collectionCallback)Reference to an instance ofMessageCollectionCallbackwhich specifies the database operation to execute in the request message context.MongoDbOutboundGatewaySpeccollectionName(String collectionName)Identify the name of the MongoDb collection to use.MongoDbOutboundGatewaySpeccollectionNameExpression(String collectionNameExpression)A SpEL expression which should resolve to aStringvalue identifying the name of the MongoDb collection to use.<P> MongoDbOutboundGatewaySpeccollectionNameFunction(Function<Message<P>,String> collectionNameFunction)MongoDbOutboundGatewaySpecentityClass(Class<?> entityClass)The fully qualified name of the entity class to be passed tofind(..)orfindOne(..)method inMongoOperations.MongoDbOutboundGatewaySpecexpectSingleResult(boolean expectSingleResult)This parameter indicates that only one result object will be returned from the database by using afindOnequery.MongoDbOutboundGatewaySpecquery(String query)AStringrepresentation of a MongoDbQuery(e.g., query("{'name' : 'Bob'}")).MongoDbOutboundGatewaySpecqueryExpression(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''}')")).<P> MongoDbOutboundGatewaySpecqueryFunction(Function<Message<P>,Query> queryFunction)Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, createInstance, destroyInstance, doGet, get, getId, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stopMethods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
-
Constructor Details
-
MongoDbOutboundGatewaySpec
protected MongoDbOutboundGatewaySpec(MongoDatabaseFactory mongoDbFactory, MongoConverter mongoConverter) -
MongoDbOutboundGatewaySpec
-
-
Method Details
-
expectSingleResult
This 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- thebooleanflag to indicate if a single result is returned or not.- Returns:
- the spec
-
query
AStringrepresentation 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 MongoDbQuerystring representation to use.- Returns:
- the spec
-
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''}')")).- Parameters:
queryExpression- the SpEL expression query to use.- Returns:
- the spec
-
queryFunction
- Type Parameters:
P- the type of the message payload.- Parameters:
queryFunction- theFunctionto use.- Returns:
- the spec
-
entityClass
The 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- theClassto use.- Returns:
- the spec
-
collectionName
Identify the name of the MongoDb collection to use. This attribute is mutually exclusive withcollectionNameExpression(java.lang.String)property.- Parameters:
collectionName- theStringspecifying the MongoDb collection.- Returns:
- the spec
-
collectionNameExpression
A 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- theStringexpression to use.- Returns:
- the spec
-
collectionNameFunction
public <P> MongoDbOutboundGatewaySpec collectionNameFunction(Function<Message<P>,String> collectionNameFunction)- Type Parameters:
P- the type of the message payload.- Parameters:
collectionNameFunction- theFunctionto use.- Returns:
- the spec
-
collectionCallback
public <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- theMessageCollectionCallbackinstance- Returns:
- the spec
- Since:
- 5.0.11
-