Class MongoItemReaderBuilder<T>

java.lang.Object
org.springframework.batch.item.data.builder.MongoItemReaderBuilder<T>
Direct Known Subclasses:
MongoPagingItemReaderBuilder

@Deprecated(since="5.1", forRemoval=true) public class MongoItemReaderBuilder<T> extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Use MongoPagingItemReaderBuilder instead. Scheduled for removal in v5.3 or later.
A builder implementation for the MongoItemReader
Since:
4.0
Author:
Glenn Renfro, Mahmoud Ben Hassine, Drummond Dawson, Parikshit Dutta
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected List<Object>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected org.springframework.data.mongodb.core.query.Query
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected Map<String,org.springframework.data.domain.Sort.Direction>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected Class<? extends T>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected org.springframework.data.mongodb.core.MongoOperations
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Validates and builds a MongoItemReader.
    collection(String collection)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Establish an optional collection that can be queried.
    currentItemCount(int currentItemCount)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Index for the current item.
    fields(String fields)
    Deprecated, for removal: This API element is subject to removal in a future version.
    JSON defining the fields to be returned from the matching documents by MongoDB.
    hint(String hint)
    Deprecated, for removal: This API element is subject to removal in a future version.
    JSON String telling MongoDB what index to use.
    Deprecated, for removal: This API element is subject to removal in a future version.
    A JSON formatted MongoDB jsonQuery.
    maxItemCount(int maxItemCount)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Configure the max number of items to be read.
    name(String name)
    Deprecated, for removal: This API element is subject to removal in a future version.
    The name used to calculate the key within the ExecutionContext.
    pageSize(int pageSize)
    Deprecated, for removal: This API element is subject to removal in a future version.
    The number of items to be read with each page.
    parameterValues(Object... parameterValues)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Values to be substituted in for each of the parameters in the query.
    parameterValues(List<Object> parameterValues)
    Deprecated, for removal: This API element is subject to removal in a future version.
    List of values to be substituted in for each of the parameters in the query.
    query(org.springframework.data.mongodb.core.query.Query query)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Provide a Spring Data Mongo Query.
    saveState(boolean saveState)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Configure if the state of the ItemStreamSupport should be persisted within the ExecutionContext for restart purposes.
    sorts(Map<String,org.springframework.data.domain.Sort.Direction> sorts)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Map of property names/Sort.Direction values to sort the input by.
    targetType(Class<? extends T> targetType)
    Deprecated, for removal: This API element is subject to removal in a future version.
    The type of object to be returned for each AbstractItemCountingItemStreamItemReader.read() call.
    template(org.springframework.data.mongodb.core.MongoOperations template)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Used to perform operations against the MongoDB instance.

    Methods inherited from class java.lang.Object

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

    • template

      protected org.springframework.data.mongodb.core.MongoOperations template
      Deprecated, for removal: This API element is subject to removal in a future version.
    • jsonQuery

      protected String jsonQuery
      Deprecated, for removal: This API element is subject to removal in a future version.
    • targetType

      protected Class<? extends T> targetType
      Deprecated, for removal: This API element is subject to removal in a future version.
    • sorts

      protected Map<String,org.springframework.data.domain.Sort.Direction> sorts
      Deprecated, for removal: This API element is subject to removal in a future version.
    • hint

      protected String hint
      Deprecated, for removal: This API element is subject to removal in a future version.
    • fields

      protected String fields
      Deprecated, for removal: This API element is subject to removal in a future version.
    • collection

      protected String collection
      Deprecated, for removal: This API element is subject to removal in a future version.
    • parameterValues

      protected List<Object> parameterValues
      Deprecated, for removal: This API element is subject to removal in a future version.
    • pageSize

      protected int pageSize
      Deprecated, for removal: This API element is subject to removal in a future version.
    • saveState

      protected boolean saveState
      Deprecated, for removal: This API element is subject to removal in a future version.
    • name

      protected String name
      Deprecated, for removal: This API element is subject to removal in a future version.
    • maxItemCount

      protected int maxItemCount
      Deprecated, for removal: This API element is subject to removal in a future version.
    • currentItemCount

      protected int currentItemCount
      Deprecated, for removal: This API element is subject to removal in a future version.
    • query

      protected org.springframework.data.mongodb.core.query.Query query
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • MongoItemReaderBuilder

      public MongoItemReaderBuilder()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • saveState

      public MongoItemReaderBuilder<T> saveState(boolean saveState)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Configure if the state of the ItemStreamSupport should be persisted within the ExecutionContext for restart purposes.
      Parameters:
      saveState - defaults to true
      Returns:
      The current instance of the builder.
    • name

      public MongoItemReaderBuilder<T> name(String name)
      Deprecated, for removal: This API element is subject to removal in a future version.
      The name used to calculate the key within the ExecutionContext. Required if saveState(boolean) is set to true.
      Parameters:
      name - name of the reader instance
      Returns:
      The current instance of the builder.
      See Also:
    • maxItemCount

      public MongoItemReaderBuilder<T> maxItemCount(int maxItemCount)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Configure the max number of items to be read.
      Parameters:
      maxItemCount - the max items to be read
      Returns:
      The current instance of the builder.
      See Also:
    • currentItemCount

      public MongoItemReaderBuilder<T> currentItemCount(int currentItemCount)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Index for the current item. Used on restarts to indicate where to start from.
      Parameters:
      currentItemCount - current index
      Returns:
      this instance for method chaining
      See Also:
    • template

      public MongoItemReaderBuilder<T> template(org.springframework.data.mongodb.core.MongoOperations template)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Used to perform operations against the MongoDB instance. Also handles the mapping of documents to objects.
      Parameters:
      template - the MongoOperations instance to use
      Returns:
      The current instance of the builder
      See Also:
    • jsonQuery

      public MongoItemReaderBuilder<T> jsonQuery(String query)
      Deprecated, for removal: This API element is subject to removal in a future version.
      A JSON formatted MongoDB jsonQuery. Parameterization of the provided jsonQuery is allowed via ?<index> placeholders where the <index> indicates the index of the parameterValue to substitute.
      Parameters:
      query - JSON formatted Mongo jsonQuery
      Returns:
      The current instance of the builder
      See Also:
    • targetType

      public MongoItemReaderBuilder<T> targetType(Class<? extends T> targetType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      The type of object to be returned for each AbstractItemCountingItemStreamItemReader.read() call.
      Parameters:
      targetType - the type of object to return
      Returns:
      The current instance of the builder
      See Also:
    • parameterValues

      public MongoItemReaderBuilder<T> parameterValues(List<Object> parameterValues)
      Deprecated, for removal: This API element is subject to removal in a future version.
      List of values to be substituted in for each of the parameters in the query.
      Parameters:
      parameterValues - values
      Returns:
      The current instance of the builder
      See Also:
    • parameterValues

      public MongoItemReaderBuilder<T> parameterValues(Object... parameterValues)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Values to be substituted in for each of the parameters in the query.
      Parameters:
      parameterValues - values
      Returns:
      The current instance of the builder
      See Also:
    • fields

      public MongoItemReaderBuilder<T> fields(String fields)
      Deprecated, for removal: This API element is subject to removal in a future version.
      JSON defining the fields to be returned from the matching documents by MongoDB.
      Parameters:
      fields - JSON string that identifies the fields to sort by.
      Returns:
      The current instance of the builder
      See Also:
    • sorts

      public MongoItemReaderBuilder<T> sorts(Map<String,org.springframework.data.domain.Sort.Direction> sorts)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Map of property names/Sort.Direction values to sort the input by.
      Parameters:
      sorts - map of properties and direction to sort each.
      Returns:
      The current instance of the builder
      See Also:
    • collection

      public MongoItemReaderBuilder<T> collection(String collection)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Establish an optional collection that can be queried.
      Parameters:
      collection - Mongo collection to be queried.
      Returns:
      The current instance of the builder
      See Also:
    • hint

      public MongoItemReaderBuilder<T> hint(String hint)
      Deprecated, for removal: This API element is subject to removal in a future version.
      JSON String telling MongoDB what index to use.
      Parameters:
      hint - string indicating what index to use.
      Returns:
      The current instance of the builder
      See Also:
    • pageSize

      public MongoItemReaderBuilder<T> pageSize(int pageSize)
      Deprecated, for removal: This API element is subject to removal in a future version.
      The number of items to be read with each page.
      Parameters:
      pageSize - the number of items
      Returns:
      this instance for method chaining
      See Also:
    • query

      public MongoItemReaderBuilder<T> query(org.springframework.data.mongodb.core.query.Query query)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Provide a Spring Data Mongo Query. This will take precedence over a JSON configured query.
      Parameters:
      query - Query to execute
      Returns:
      this instance for method chaining
      See Also:
    • build

      public MongoItemReader<T> build()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Validates and builds a MongoItemReader.
      Returns:
      a MongoItemReader