Package fr.gouv.vitam.common.database.translators.mongodb

# Class RequestToMongodb

java.lang.Object
fr.gouv.vitam.common.database.translators.RequestToAbstract
fr.gouv.vitam.common.database.translators.mongodb.RequestToMongodb

Direct Known Subclasses:
  `DeleteToMongodb`, `InsertToMongodb`, `SelectToMongodb`, `UpdateToMongodb`

public abstract class RequestToMongodb extends RequestToAbstract
Request to MongoDb

- ## Field Summary

  ### Fields inherited from class fr.gouv.vitam.common.database.translators.RequestToAbstract

  `requestParser`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `RequestToMongodb(AbstractParser<?> requestParser)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `org.bson.conversions.Bson`
  `getInitialRoots(String field)`
  Additional filter to first request
  `org.bson.conversions.Bson`
  `getNthQueries(int nth)`
  find(query)
  `org.bson.conversions.Bson`
  `getRequest(org.bson.conversions.Bson roots, org.bson.conversions.Bson query)`
  `static RequestToMongodb`
  `getRequestToMongoDb(AbstractParser<?> requestParser)`
  Create the RequestToMongoDB adapted to the RequestParser

  ### Methods inherited from class fr.gouv.vitam.common.database.translators.RequestToAbstract

  `getFinalLimit, getFinalOffset, getHints, getLastDepth, getNbQueries, getNthQuery, getRequest, getRequestParser, getUsage, hasFullTextQuery, hintCache, hintNoTimeout, isMultiple, model`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### RequestToMongodb

    public RequestToMongodb(AbstractParser<?> requestParser)
    Parameters:
      `requestParser` - AbstractParser of unknown type

- ## Method Details

  - ### getRequestToMongoDb

    public static RequestToMongodb getRequestToMongoDb(AbstractParser<?> requestParser)
    Create the RequestToMongoDB adapted to the RequestParser
    Parameters:
      `requestParser` - AbstractParser of unknown type
    Returns:
      the associated RequestToMongoDb

  - ### getInitialRoots

    public org.bson.conversions.Bson getInitialRoots(String field) throws InvalidParseOperationException
    Additional filter to first request
    Parameters:
      `field` - Field from which the proposed values shall be found
    Returns:
      the filter associated with the initial roots
    Throws:
      `InvalidParseOperationException` - if field could not parse to JSON

  - ### getRequest

    public org.bson.conversions.Bson getRequest(org.bson.conversions.Bson roots, org.bson.conversions.Bson query)
    Parameters:
      `roots` - Bson
      `query` - Bson
    Returns:
      the final request

  - ### getNthQueries

    public org.bson.conversions.Bson getNthQueries(int nth) throws IllegalAccessException, IllegalAccessError, InvalidParseOperationException
    find(query)
    Parameters:
      `nth` - int
    Returns:
      the associated query for find (missing the source however, as initialRoots)
    Throws:
      `IllegalAccessException` - if nth exceed the size of list
      `IllegalAccessError` - if query is full text
      `InvalidParseOperationException` - if could not get command by query