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

# Interface DomainApi

public interface DomainApi
A collection of all existing domains.

A domain is a logical grouping of assets and belongs to exactly one community. It has a domain type that specifies which asset types can be created in the domain. A domain has a unique name within its community. A domain is the instance of exactly one domain type.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Domain`
  `addDomain(AddDomainRequest addDomainRequest)`
  Adds a new domain into a community.
  `List<Domain>`
  `addDomains(List<AddDomainRequest> addDomainRequests)`
  Adds multiple domains.
  `Domain`
  `changeDomain(ChangeDomainRequest changeDomainRequest)`
  Changes the domain with the information that is present in the request.
  `List<Domain>`
  `changeDomains(List<ChangeDomainRequest> changeDomainRequests)`
  Changes multiple domains.
  `boolean`
  `exists(UUID domainId)`
  Returns true if an domain with given ID exists.
  `CursorPagedResponse<Domain>`
  `findDomains(FindDomainsRequest findDomainsRequest)`
  Returns domains matching the given search criteria.
  `Domain`
  `getDomain(UUID domainId)`
  Returns a domain identified by given ID.
  `void`
  `removeDomain(UUID domainId)`
  Removes a domain identified by given ID.
  `Job`
  `removeDomainInJob(UUID domainId)`
  Removes a domain identified by the given ID asynchronously.
  `void`
  `removeDomains(List<UUID> domainIds)`
  Removes multiple domains.
  `Job`
  `removeDomainsInJob(List<UUID> domainIds, boolean sendNotification)`
  Removes a domains identified by the given IDs asynchronously.

- ## Method Details

  - ### addDomain

    Domain addDomain(AddDomainRequest addDomainRequest)
    Adds a new domain into a community.
    Parameters:
      `addDomainRequest` - the properties of the domain to be added
    Returns:
      the newly added domain

  - ### addDomains

    @SecurityAuditMethod(resultFormatter=com.collibra.audit.formatter.CollectionFormatter.class) List<Domain> addDomains(List<AddDomainRequest> addDomainRequests)
    Adds multiple domains.
    Parameters:
      `addDomainRequests` - the properties of the domains to be added
    Returns:
      the added domains

  - ### changeDomain

    Domain changeDomain(ChangeDomainRequest changeDomainRequest)
    Changes the domain with the information that is present in the request.
    Parameters:
      `changeDomainRequest` - changes that to be performed on the domain
    Returns:
      the changed domain

  - ### changeDomains

    @SecurityAuditMethod(resultFormatter=com.collibra.audit.formatter.CollectionFormatter.class) List<Domain> changeDomains(List<ChangeDomainRequest> changeDomainRequests)
    Changes multiple domains.
    Parameters:
      `changeDomainRequests` - the properties of the domains to be changed
    Returns:
      the changed domains

  - ### getDomain

    Domain getDomain(UUID domainId)
    Returns a domain identified by given ID.
    Parameters:
      `domainId` - the ID of the domain
    Returns:
      the domain

  - ### findDomains

    @SecurityAuditMethod(resultFormatter=com.collibra.dgc.core.api.internal.security.audit.formatter.PagedResponseFormatter.class) CursorPagedResponse<Domain> findDomains(FindDomainsRequest findDomainsRequest)
    Returns domains matching the given search criteria.
    Parameters:
      `findDomainsRequest` - the search criteria for domains
    Returns:
      the found domains

  - ### exists

    boolean exists(UUID domainId)
    Returns true if an domain with given ID exists.
    Parameters:
      `domainId` - the ID of the domain
    Returns:
      true if an domain with given ID exists, `false` otherwise

  - ### removeDomain

    void removeDomain(UUID domainId)
    Removes a domain identified by given ID.
    Parameters:
      `domainId` - the ID of the domain to remove

  - ### removeDomains

    void removeDomains(List<UUID> domainIds)
    Removes multiple domains.
    Parameters:
      `domainIds` - the IDs of the domains to be removed

  - ### removeDomainInJob

    Job removeDomainInJob(UUID domainId)
    Removes a domain identified by the given ID asynchronously.
    Parameters:
      `domainId` - the ID of the domain that needs to remove
    Returns:
      the job that will perform the removal of the domain. Use JobRunr StorageProvider to find the current state of the job.

  - ### removeDomainsInJob

    Job removeDomainsInJob(List<UUID> domainIds, boolean sendNotification)
    Removes a domains identified by the given IDs asynchronously.
    Parameters:
      `domainIds` - the list of IDs of the domains we want removed
      `sendNotification` - boolean indicating whether we want a notification or not
    Returns:
      the Job that will be bulk removing the domains