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

java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<T>
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:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<H>, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle
Direct Known Subclasses:
MongoDbMessageSourceSpec, ReactiveMongoDbMessageSourceSpec

public class AbstractMongoDbMessageSourceSpec<S extends AbstractMongoDbMessageSourceSpec<S,​H>,​H extends AbstractMongoDbMessageSource<?>>
extends org.springframework.integration.dsl.MessageSourceSpec<S,​H>
A MessageSourceSpec extension for common MongoDB sources options.
Since:
5.5
  • Field Summary

    Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec

    PARSER, target

    Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean

    logger

    Fields inherited from interface org.springframework.beans.factory.FactoryBean

    OBJECT_TYPE_ATTRIBUTE

    Fields inherited from interface org.springframework.context.SmartLifecycle

    DEFAULT_PHASE
  • Constructor Summary

    Constructors 
    Constructor Description
    AbstractMongoDbMessageSourceSpec()  
  • Method Summary

    Modifier and Type Method Description
    S collectionName​(java.lang.String collectionName)
    Configure a collection name to query against.
    S collectionNameExpression​(java.lang.String collectionNameExpression)
    Configure a SpEL expression to evaluation a collection name on each receive() call.
    S collectionNameExpression​(org.springframework.expression.Expression collectionNameExpression)
    Configure a SpEL expression to evaluation a collection name on each receive() call.
    S collectionNameSupplier​(java.util.function.Supplier<java.lang.String> collectionNameSupplier)
    Configure a Supplier to obtain a collection name on each receive() call.
    S entityClass​(java.lang.Class<?> entityClass)
    Allow you to set the type of the entityClass that will be passed to the MongoDB query method.
    S expectSingleResult​(boolean expectSingleResult)
    Allow you to manage which find* method to invoke.
    S mongoConverter​(org.springframework.data.mongodb.core.convert.MongoConverter mongoConverter)
    Configure a custom MongoConverter used to assist in deserialization data read from MongoDb.
    S update​(java.lang.String update)
    Configure a MongoDB update.
    S update​(org.springframework.data.mongodb.core.query.Update update)
    Configure a MongoDB update.
    S update​(org.springframework.expression.Expression updateExpression)
    Configure a SpEL expression to evaluate a MongoDB update.
    S updateSupplier​(java.util.function.Supplier<org.springframework.data.mongodb.core.query.Update> updateSupplier)
    Configure a Supplier to produce a MongoDB update on each receive call.

    Methods inherited from class org.springframework.integration.dsl.MessageSourceSpec

    messageHeaders

    Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec

    _this, createInstance, destroyInstance, doGet, get, getId, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stop

    Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean

    afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • entityClass

      public S entityClass​(java.lang.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:
      AbstractMongoDbMessageSource.setEntityClass(Class)
    • 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:
      AbstractMongoDbMessageSource.setExpectSingleResult(boolean)
    • collectionName

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

      public S collectionNameExpression​(java.lang.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​(java.util.function.Supplier<java.lang.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​(org.springframework.expression.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:
      AbstractMongoDbMessageSource.setCollectionNameExpression(Expression)
    • mongoConverter

      public S mongoConverter​(org.springframework.data.mongodb.core.convert.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:
      AbstractMongoDbMessageSource.setMongoConverter(MongoConverter)
    • update

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

      public S update​(org.springframework.data.mongodb.core.query.Update update)
      Configure a MongoDB update.
      Parameters:
      update - the MongoDB update.
      Returns:
      the spec
    • updateSupplier

      public S updateSupplier​(java.util.function.Supplier<org.springframework.data.mongodb.core.query.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​(org.springframework.expression.Expression updateExpression)
      Configure a SpEL expression to evaluate a MongoDB update.
      Parameters:
      updateExpression - the expression to evaluate a MongoDB update.
      Returns:
      the spec