Package fr.gouv.vitam.functional.administration.core.context

# Interface ContextService

All Superinterfaces:
  `AutoCloseable`, `VitamAutoCloseable`

All Known Implementing Classes:
  `ContextServiceImpl`

public interface ContextService extends VitamAutoCloseable
ContextService Interface declaring methods associated to contexts

- ## Method Summary

  Modifier and Type
  Method
  Description
  `RequestResponse<ContextModel>`
  `createContexts(List<ContextModel> contextModelList)`
  Create a list of contexts
  `RequestResponse<ContextModel>`
  `deleteContext(String contextId, boolean forceDelete)`
  Delete a context
  `DbRequestResult`
  `findContexts(com.fasterxml.jackson.databind.JsonNode queryDsl)`
  Search for contexts
  `ContextModel`
  `findOneContextById(String id)`
  Find a context by its id
  `boolean`
  `securityProfileIsUsedInContexts(String securityProfileId)`
  `void`
  `setSecurityProfileService(SecurityProfileService securityProfileService)`
  `RequestResponse<ContextModel>`
  `updateContext(String id, com.fasterxml.jackson.databind.JsonNode queryDsl)`
  Update a context

  ### Methods inherited from interface fr.gouv.vitam.common.model.VitamAutoCloseable

  `close`

- ## Method Details

  - ### createContexts

    RequestResponse<ContextModel> createContexts(List<ContextModel> contextModelList) throws VitamException
    Create a list of contexts
    Parameters:
      `contextModelList` - the context list to be created
    Returns:
      a response as a RequestResponse Object
    Throws:
      `VitamException` - thrown if operation could not be done

  - ### findContexts

    DbRequestResult findContexts(com.fasterxml.jackson.databind.JsonNode queryDsl) throws ReferentialException, InvalidParseOperationException
    Search for contexts
    Parameters:
      `queryDsl` - the query to be used for the search
    Returns:
      the list of contexts as a DbRequestResult
    Throws:
      `ReferentialException` - thrown if the query could not be executed
      `InvalidParseOperationException` - thrown if query is incorrect

  - ### updateContext

    RequestResponse<ContextModel> updateContext(String id, com.fasterxml.jackson.databind.JsonNode queryDsl) throws VitamException
    Update a context
    Parameters:
      `id` - the id of the context
      `queryDsl` - the update command as a query
    Returns:
      a response as a RequestResponse object
    Throws:
      `VitamException` - thrown if operation could not be done

  - ### findOneContextById

    ContextModel findOneContextById(String id) throws ReferentialException, InvalidParseOperationException
    Find a context by its id
    Parameters:
      `id` - the id of the context
    Returns:
      the context as a ContextModel
    Throws:
      `ReferentialException` - thrown if the context could not be found
      `InvalidParseOperationException` - thrown if the query is incorrect

  - ### deleteContext

    RequestResponse<ContextModel> deleteContext(String contextId, boolean forceDelete) throws VitamException
    Delete a context
    Parameters:
      `contextId` - the id of the context
      `forceDelete` -
    Returns:
      a response as a RequestResponse object
    Throws:
      `VitamException` - thrown if operation could not be done

  - ### securityProfileIsUsedInContexts

    boolean securityProfileIsUsedInContexts(String securityProfileId) throws InvalidCreateOperationException, ReferentialException, InvalidParseOperationException
    Throws:
      `InvalidCreateOperationException`
      `ReferentialException`
      `InvalidParseOperationException`

  - ### setSecurityProfileService

    void setSecurityProfileService(SecurityProfileService securityProfileService)