Package fr.gouv.vitam.storage.offers.tape.impl.catalog

# Class TapeCatalogRepository

java.lang.Object
fr.gouv.vitam.storage.offers.tape.impl.queue.QueueRepositoryImpl
fr.gouv.vitam.storage.offers.tape.impl.catalog.TapeCatalogRepository

All Implemented Interfaces:
  `QueueRepository`

public class TapeCatalogRepository extends QueueRepositoryImpl
repository for Tapes Catalog management in mongo.

- ## Field Summary

  ### Fields inherited from class fr.gouv.vitam.storage.offers.tape.impl.queue.QueueRepositoryImpl

  `collection`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TapeCatalogRepository(com.mongodb.client.MongoCollection<org.bson.Document> collection)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Map<TapeState,Integer>`
  `countByState()`
  count tapes matching by state
  `String`
  `createTape(TapeCatalog tapeCatalog)`
  create a tape model
  `TapeCatalog`
  `findTapeById(String tapeId)`
  return tape model according to given ID
  `List<TapeCatalog>`
  `findTapes(List<QueryCriteria> criteria)`
  return tape models according to given fields
  `boolean`
  `replaceTape(TapeCatalog tapeCatalog)`
  replace a tape model
  `boolean`
  `updateTape(String tapeId, Map<String,Object> fields)`
  apply fields changes for tape tapeId

  ### Methods inherited from class fr.gouv.vitam.storage.offers.tape.impl.queue.QueueRepositoryImpl

  `add, addIfAbsent, complete, countByStateAndType, initializeOnBootstrap, markError, markReady, receive, receive, receive, receive, remove, tryCancelIfNotStarted`

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

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

- ## Constructor Details

  - ### TapeCatalogRepository

    public TapeCatalogRepository(com.mongodb.client.MongoCollection<org.bson.Document> collection)

- ## Method Details

  - ### createTape

    public String createTape(TapeCatalog tapeCatalog) throws TapeCatalogException
    create a tape model
    Parameters:
      `tapeCatalog` -
    Throws:
      `InvalidParseOperationException`
      `TapeCatalogException`

  - ### replaceTape

    public boolean replaceTape(TapeCatalog tapeCatalog) throws TapeCatalogException
    replace a tape model
    Parameters:
      `tapeCatalog` -
    Throws:
      `InvalidParseOperationException`
      `TapeCatalogException`

  - ### updateTape

    public boolean updateTape(String tapeId, Map<String,Object> fields) throws TapeCatalogException
    apply fields changes for tape tapeId
    Parameters:
      `tapeId` -
      `fields` -
    Returns:
      true if changes have been applied otherwise false
    Throws:
      `TapeCatalogException`

  - ### findTapes

    public List<TapeCatalog> findTapes(List<QueryCriteria> criteria) throws TapeCatalogException
    return tape models according to given fields
    Parameters:
      `criteria` -
    Returns:
    Throws:
      `TapeCatalogException`

  - ### countByState

    public Map<TapeState,Integer> countByState() throws TapeCatalogException
    count tapes matching by state
    Returns:
      number of tapes by state
    Throws:
      `TapeCatalogException`

  - ### findTapeById

    public TapeCatalog findTapeById(String tapeId) throws TapeCatalogException
    return tape model according to given ID
    Parameters:
      `tapeId` -
    Returns:
    Throws:
      `TapeCatalogException`