Class AbstractMongoDbMessageSourceSpec<S extends AbstractMongoDbMessageSourceSpec<S,H>,H extends AbstractMongoDbMessageSource<?>>

java.lang.Object
org.springframework.integration.dsl.IntegrationComponentSpec<S,H>
org.springframework.integration.dsl.MessageSourceSpec<S,H>
org.springframework.integration.mongodb.dsl.AbstractMongoDbMessageSourceSpec<S,H>
Type Parameters:
S - target spec type.
H - target message source type.
All Implemented Interfaces:
DisposableBean, FactoryBean<H>, InitializingBean, Lifecycle, Phased, SmartLifecycle
Direct Known Subclasses:
MongoDbMessageSourceSpec, ReactiveMongoDbMessageSourceSpec

public class AbstractMongoDbMessageSourceSpec<S extends AbstractMongoDbMessageSourceSpec<S,H>,H extends AbstractMongoDbMessageSource<?>> extends MessageSourceSpec<S,H>
A MessageSourceSpec extension for common MongoDB sources options.
Since:
5.5
Author:
Artem Bilan
  • Constructor Details

    • AbstractMongoDbMessageSourceSpec

      public AbstractMongoDbMessageSourceSpec()
  • Method Details

    • entityClass

      public S entityClass(Class<?> entityClass)
      Allow you to set the type of the entityClass that will be passed to the MongoDB query method. Default is DBObject.
      Parameters:
      entityClass - The entity class.
      Returns:
      the spec
      See Also:
    • expectSingleResult

      public S expectSingleResult(boolean expectSingleResult)
      Allow you to manage which find* method to invoke.
      Parameters:
      expectSingleResult - true if a single result is expected.
      Returns:
      the spec
      See Also:
    • collectionName

      public S collectionName(String collectionName)
      Configure a collection name to query against.
      Parameters:
      collectionName - the name of the MongoDb collection
      Returns:
      the spec
    • collectionNameExpression

      public S collectionNameExpression(String collectionNameExpression)
      Configure a SpEL expression to evaluation a collection name on each receive() call.
      Parameters:
      collectionNameExpression - the SpEL expression for name of the MongoDb collection
      Returns:
      the spec
    • collectionNameSupplier

      public S collectionNameSupplier(Supplier<String> collectionNameSupplier)
      Configure a Supplier to obtain a collection name on each receive() call.
      Parameters:
      collectionNameSupplier - the Supplier for name of the MongoDb collection
      Returns:
      the spec
    • collectionNameExpression

      public S collectionNameExpression(Expression collectionNameExpression)
      Configure a SpEL expression to evaluation a collection name on each receive() call.
      Parameters:
      collectionNameExpression - the SpEL expression for name of the MongoDb collection
      Returns:
      the spec
      See Also:
    • mongoConverter

      public S mongoConverter(MongoConverter mongoConverter)
      Configure a custom MongoConverter used to assist in deserialization data read from MongoDb.
      Parameters:
      mongoConverter - The mongo converter.
      Returns:
      the spec
      See Also:
    • update

      public S update(String update)
      Configure a MongoDB update.
      Parameters:
      update - the MongoDB update.
      Returns:
      the spec
    • update

      public S update(Update update)
      Configure a MongoDB update.
      Parameters:
      update - the MongoDB update.
      Returns:
      the spec
    • updateSupplier

      public S updateSupplier(Supplier<Update> updateSupplier)
      Configure a Supplier to produce a MongoDB update on each receive call.
      Parameters:
      updateSupplier - the Supplier for MongoDB update.
      Returns:
      the spec
    • update

      public S update(Expression updateExpression)
      Configure a SpEL expression to evaluate a MongoDB update.
      Parameters:
      updateExpression - the expression to evaluate a MongoDB update.
      Returns:
      the spec