public class MongoDbOutboundGatewaySpec extends MessageHandlerSpec<MongoDbOutboundGatewaySpec,MongoDbOutboundGateway>
MessageHandlerSpec
extension for the MongoDb Outbound endpoint MongoDbOutboundGateway
logger, PARSER, target
Modifier and Type | Method and Description |
---|---|
<P> MongoDbOutboundGatewaySpec |
collectionCallback(org.springframework.data.mongodb.core.CollectionCallback<P> collectionCallback)
Reference to an instance of
CollectionCallback which specifies the database operation to execute. |
MongoDbOutboundGatewaySpec |
collectionName(java.lang.String collectionName)
Identify the name of the MongoDb collection to use.
|
MongoDbOutboundGatewaySpec |
collectionNameExpression(java.lang.String collectionNameExpression)
A SpEL expression which should resolve to a
String value
identifying the name of the MongoDb collection to use. |
<P> MongoDbOutboundGatewaySpec |
collectionNameFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.String> collectionNameFunction)
A
Function which should resolve to a String
(e.q., collectionNameFunction(Message::getPayload) ). |
MongoDbOutboundGatewaySpec |
entityClass(java.lang.Class<?> entityClass)
The fully qualified name of the entity class to be passed
to
find(..) or findOne(..) method in MongoOperations . |
MongoDbOutboundGatewaySpec |
expectSingleResult(boolean expectSingleResult)
This parameter indicates that only one result object will be returned from the database
by using a
findOne query. |
MongoDbOutboundGatewaySpec |
query(java.lang.String query)
A
String representation of a MongoDb Query (e.g., query("{'name' : 'Bob'}")). |
MongoDbOutboundGatewaySpec |
queryExpression(java.lang.String queryExpression)
A SpEL expression which should resolve to a
String query (please refer to the 'query' property),
or to an instance of MongoDb Query
(e.q., queryExpression("new BasicQuery('{''address.state'' : ''PA''}')")). |
<P> MongoDbOutboundGatewaySpec |
queryFunction(java.util.function.Function<org.springframework.messaging.Message<P>,org.springframework.data.mongodb.core.query.Query> queryFunction)
A
Function which should resolve to a Query instance. |
_this, afterPropertiesSet, destroy, doGet, get, getId, getObject, getObjectType, id, isSingleton
public MongoDbOutboundGatewaySpec expectSingleResult(boolean expectSingleResult)
findOne
query.
If set to false
(default), the complete result list is returned as the payload.expectSingleResult
- the boolean
flag to indicate if a single result is returned or not.public MongoDbOutboundGatewaySpec query(java.lang.String query)
String
representation of a MongoDb Query
(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.query
- the MongoDb Query
string representation to use.public MongoDbOutboundGatewaySpec queryExpression(java.lang.String queryExpression)
String
query (please refer to the 'query' property),
or to an instance of MongoDb Query
(e.q., queryExpression("new BasicQuery('{''address.state'' : ''PA''}')")).queryExpression
- the SpEL expression query to use.public <P> MongoDbOutboundGatewaySpec queryFunction(java.util.function.Function<org.springframework.messaging.Message<P>,org.springframework.data.mongodb.core.query.Query> queryFunction)
Function
which should resolve to a Query
instance.P
- the type of the message payload.queryFunction
- the Function
to use.public MongoDbOutboundGatewaySpec entityClass(java.lang.Class<?> entityClass)
find(..)
or findOne(..)
method in MongoOperations
.
If this attribute is not provided the default value is Document
.entityClass
- the Class
to use.public MongoDbOutboundGatewaySpec collectionName(java.lang.String collectionName)
collectionNameExpression(java.lang.String)
property.collectionName
- the String
specifying the MongoDb collection.public MongoDbOutboundGatewaySpec collectionNameExpression(java.lang.String collectionNameExpression)
String
value
identifying the name of the MongoDb collection to use.
This property is mutually exclusive with collectionName(java.lang.String)
property.collectionNameExpression
- the String
expression to use.public <P> MongoDbOutboundGatewaySpec collectionNameFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.String> collectionNameFunction)
Function
which should resolve to a String
(e.q., collectionNameFunction(Message::getPayload)
).P
- the type of the message payload.collectionNameFunction
- the Function
to use.public <P> MongoDbOutboundGatewaySpec collectionCallback(org.springframework.data.mongodb.core.CollectionCallback<P> collectionCallback)
CollectionCallback
which specifies the database operation to execute.
This property is mutually exclusive with query(java.lang.String)
and queryExpression(java.lang.String)
properties.P
- the type of the message payload.collectionCallback
- the CollectionCallback
instance