Package com.collibra.dgc.core.api.component.mapping

# Interface MappingApi

public interface MappingApi
Contains all api operations for handling mappings.

A mapping is a representation of a link between business object from external system and corresponding resource in the Data Governance Center. A single mapping refers to at most one resource which can either be a community, a domain, or an asset.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Mapping`
  `addMapping(AddMappingRequest request)`
  Adds a new mapping.
  `List<Mapping>`
  `addMappings(List<AddMappingRequest> requests)`
  Adds multiple mappings.
  `Mapping`
  `changeMapping(ChangeMappingRequest request)`
  Changes the mapping identified by its `id` with the information that is present in the request.
  `Mapping`
  `changeMappingByExternalEntity(ChangeMappingByExternalEntityRequest request)`
  Changes the mapping identified by its external `id`s with the information that is present in the request.
  `Mapping`
  `changeMappingByMappedResource(ChangeMappingByMappedResourceRequest request)`
  Changes the mapping identified by its external system `id` and mapped resource `id` with the information that is present in the request.
  `List<Mapping>`
  `changeMappings(List<ChangeMappingRequest> requests)`
  Changes multiple mappings identified by their `id`s.
  `List<Mapping>`
  `changeMappingsByExternalEntities(List<ChangeMappingByExternalEntityRequest> requests)`
  Changes the mappings identified by their external `id`s with the information that is present in the request.
  `List<Mapping>`
  `changeMappingsByMappedResources(List<ChangeMappingByMappedResourceRequest> requests)`
  Changes the mappings identified by their external system `id`s and mapped resource `id`s with the information that is present in the request.
  `List<Mapping>`
  `findAssetMappingsByResourceIds(List<String> mappedResourceIds)`
  Finds asset mappings matching the given mapped resource ids.
  `PagedResponse<Mapping>`
  `findMappings(FindMappingsRequest request)`
  Returns mappings matching the given search criteria.
  `Mapping`
  `getMapping(UUID mappingId)`
  Returns a mapping identified by given `id`.
  `Mapping`
  `getMappingByExternalEntity(GetMappingByExternalEntityRequest request)`
  Returns a mapping identified by its external `id`s.
  `Mapping`
  `getMappingByMappedResource(GetMappingByMappedResourceRequest request)`
  Returns a mapping identified by its external system `id` and mapped resource `id`.
  `void`
  `removeMapping(UUID mappingId)`
  Removes the mapping identified by its `id`.
  `void`
  `removeMappingByExternalEntity(String externalSystemId, String externalEntityId)`
  Removes the mapping identified by its external `id`s.
  `void`
  `removeMappingByMappedResource(String externalSystemId, String mappedResourceId)`
  Removes the mapping identified by its external system `id` and mapped resource `id`.
  `Job`
  `removeMappingsByExternalSystemInJob(String externalSystemId, boolean sendNotification)`
  Removes all the mappings identified by given external system `id`.
  `Job`
  `removeMappingsInJob(List<UUID> mappingIds, boolean sendNotification)`
  Removes multiple mappings in job.

- ## Method Details

  - ### addMapping

    Mapping addMapping(AddMappingRequest request)
    Adds a new mapping.
    Parameters:
      `request` - the properties of the mapping to be added
    Returns:
      the newly added mapping

  - ### addMappings

    List<Mapping> addMappings(List<AddMappingRequest> requests)
    Adds multiple mappings.
    Parameters:
      `requests` - the properties of the mappings to be added
    Returns:
      the added mappings

  - ### changeMapping

    Mapping changeMapping(ChangeMappingRequest request)
    Changes the mapping identified by its `id` with the information that is present in the request. Only properties that are specified in this request and have not `null` values are updated. All other properties are ignored.
    Parameters:
      `request` - the properties of the mapping to be changed
    Returns:
      the changed mapping

  - ### changeMappings

    @SecurityAuditMethod(resultFormatter=com.collibra.audit.formatter.CollectionFormatter.class) List<Mapping> changeMappings(List<ChangeMappingRequest> requests)
    Changes multiple mappings identified by their `id`s. Only properties that are specified in this request and have not `null` values are updated. All other properties are ignored.
    Parameters:
      `requests` - the properties of the mappings to be changed
    Returns:
      the changed mappings

  - ### changeMappingByExternalEntity

    Mapping changeMappingByExternalEntity(ChangeMappingByExternalEntityRequest request)
    Changes the mapping identified by its external `id`s with the information that is present in the request. Only properties that are specified in this request and have not `null` values are updated. All other properties are ignored.
    Parameters:
      `request` - the properties of the mapping to be changed
    Returns:
      the changed mapping

  - ### changeMappingsByExternalEntities

    @SecurityAuditMethod(resultFormatter=com.collibra.audit.formatter.CollectionFormatter.class) List<Mapping> changeMappingsByExternalEntities(List<ChangeMappingByExternalEntityRequest> requests)
    Changes the mappings identified by their external `id`s with the information that is present in the request. Only properties that are specified in this request and have not `null` values are updated. All other properties are ignored.
    Parameters:
      `requests` - the properties of the mappings to be changed
    Returns:
      the changed mappings

  - ### changeMappingByMappedResource

    Mapping changeMappingByMappedResource(ChangeMappingByMappedResourceRequest request)
    Changes the mapping identified by its external system `id` and mapped resource `id` with the information that is present in the request. Only properties that are specified in this request and have not `null` values are updated. All other properties are ignored.
    Parameters:
      `request` - the properties of the mapping to be changed
    Returns:
      the changed mapping

  - ### changeMappingsByMappedResources

    @SecurityAuditMethod(resultFormatter=com.collibra.audit.formatter.CollectionFormatter.class) List<Mapping> changeMappingsByMappedResources(List<ChangeMappingByMappedResourceRequest> requests)
    Changes the mappings identified by their external system `id`s and mapped resource `id`s with the information that is present in the request. Only properties that are specified in this request and have not `null` values are updated. All other properties are ignored.
    Parameters:
      `requests` - the properties of the mappings to be changed
    Returns:
      the changed mappings

  - ### findMappings

    @SecurityAuditMethod(resultFormatter=com.collibra.dgc.core.api.internal.security.audit.formatter.PagedResponseFormatter.class) PagedResponse<Mapping> findMappings(FindMappingsRequest request)
    Returns mappings matching the given search criteria. Only parameters that are specified in this request and have not `null` values are used for filtering. All other parameters are ignored. The returned mappings satisfy all constraints that are specified in this search criteria. By default a result containing 1000 mappings is returned.
    Parameters:
      `request` - the search criteria
    Returns:
      the found mappings

  - ### getMapping

    Mapping getMapping(UUID mappingId)
    Returns a mapping identified by given `id`.
    Parameters:
      `mappingId` - the `id` of the mapping
    Returns:
      the mapping

  - ### getMappingByExternalEntity

    Mapping getMappingByExternalEntity(GetMappingByExternalEntityRequest request)
    Returns a mapping identified by its external `id`s.
    Parameters:
      `request` - the criteria for searching the mapping identified by its external `id`s
    Returns:
      the mapping

  - ### getMappingByMappedResource

    Mapping getMappingByMappedResource(GetMappingByMappedResourceRequest request)
    Returns a mapping identified by its external system `id` and mapped resource `id`.
    Parameters:
      `request` - the criteria for searching the mapping identified by its external system `id` and mapped resource `id`
    Returns:
      the mapping

  - ### removeMapping

    void removeMapping(UUID mappingId)
    Removes the mapping identified by its `id`.

    If the mapping does not exist, an exception is NOT thrown.

    Parameters:
      `mappingId` - the `id` of the mapping

  - ### removeMappingByExternalEntity

    void removeMappingByExternalEntity(String externalSystemId, String externalEntityId)
    Removes the mapping identified by its external `id`s.

    If the mapping does not exist, an exception is NOT thrown.

    Parameters:
      `externalSystemId` - the external system `id` of the mapping to be removed
      `externalEntityId` - the external entity `id` of the mapping to be removed

  - ### removeMappingByMappedResource

    void removeMappingByMappedResource(String externalSystemId, String mappedResourceId)
    Removes the mapping identified by its external system `id` and mapped resource `id`.

    If the mapping does not exist, an exception is NOT thrown.

    Parameters:
      `externalSystemId` - the external system `id` of the mapping to be removed
      `mappedResourceId` - the mapped resource `id` of the mapping to be changed

  - ### removeMappingsInJob

    Job removeMappingsInJob(List<UUID> mappingIds, boolean sendNotification)
    Removes multiple mappings in job.

    If any mapping does not exist, an exception is NOT thrown.

    Parameters:
      `mappingIds` - the `id`s of the mappings to be removed, i.e. ["6f685f90-1036-4d30-983a-a9bbcdd7b8f6", "6f685f90-1036-4d30-983a-a9bbcdd7b123"]
      `sendNotification` - boolean indicating whether we want a notification or not
    Returns:
      the job executing removal of the mappings

  - ### removeMappingsByExternalSystemInJob

    Job removeMappingsByExternalSystemInJob(String externalSystemId, boolean sendNotification)
    Removes all the mappings identified by given external system `id`.
    Parameters:
      `externalSystemId` - the external system `id` of the mappings that will be removed
      `sendNotification` - boolean indicating whether we want a notification or not
    Returns:
      the job executing removal of the mappings

  - ### findAssetMappingsByResourceIds

    List<Mapping> findAssetMappingsByResourceIds(List<String> mappedResourceIds)
    Finds asset mappings matching the given mapped resource ids.
    Parameters:
      `mappedResourceIds` - the mapped resource ids
    Returns:
      the found mappings