public class MongoDbOutboundGatewaySpec extends MessageHandlerSpec<MongoDbOutboundGatewaySpec,MongoDbOutboundGateway>
MessageHandlerSpec
extension for the MongoDb Outbound endpoint MongoDbOutboundGateway
PARSER, target
logger
DEFAULT_PHASE
OBJECT_TYPE_ATTRIBUTE
Modifier | Constructor and Description |
---|---|
protected |
MongoDbOutboundGatewaySpec(MongoDatabaseFactory mongoDbFactory,
MongoConverter mongoConverter) |
protected |
MongoDbOutboundGatewaySpec(MongoOperations mongoTemplate) |
Modifier and Type | Method and Description |
---|---|
<P> MongoDbOutboundGatewaySpec |
collectionCallback(MessageCollectionCallback<P> collectionCallback)
Reference to an instance of
MessageCollectionCallback
which specifies the database operation to execute in the request message context. |
MongoDbOutboundGatewaySpec |
collectionName(String collectionName)
Identify the name of the MongoDb collection to use.
|
MongoDbOutboundGatewaySpec |
collectionNameExpression(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<Message<P>,String> collectionNameFunction)
|
MongoDbOutboundGatewaySpec |
entityClass(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(String query)
A
String representation of a MongoDb Query (e.g., query("{'name' : 'Bob'}")). |
MongoDbOutboundGatewaySpec |
queryExpression(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<Message<P>,Query> queryFunction)
|
_this, createInstance, destroyInstance, doGet, get, getId, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stop
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
protected MongoDbOutboundGatewaySpec(MongoDatabaseFactory mongoDbFactory, MongoConverter mongoConverter)
protected MongoDbOutboundGatewaySpec(MongoOperations mongoTemplate)
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(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(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<Message<P>,Query> queryFunction)
P
- the type of the message payload.queryFunction
- the Function
to use.public MongoDbOutboundGatewaySpec entityClass(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(String collectionName)
collectionNameExpression(java.lang.String)
property.collectionName
- the String
specifying the MongoDb collection.public MongoDbOutboundGatewaySpec collectionNameExpression(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<Message<P>,String> collectionNameFunction)
P
- the type of the message payload.collectionNameFunction
- the Function
to use.public <P> MongoDbOutboundGatewaySpec collectionCallback(MessageCollectionCallback<P> collectionCallback)
MessageCollectionCallback
which specifies the database operation to execute in the request message context.
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 MessageCollectionCallback
instance