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

# Interface CommunityApi

public interface CommunityApi
Contains the Community related functionalities.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `List<Community>`
  `addCommunities(List<AddCommunityRequest> addCommunityRequests)`
  Adds multiple communities in one go.
  `Community`
  `addCommunity(AddCommunityRequest addCommunityRequest)`
  Adds a new community or subcommunity.
  `List<Community>`
  `changeCommunities(List<ChangeCommunityRequest> changeCommunityRequests)`
  Changes multiple communities.
  `Community`
  `changeCommunity(ChangeCommunityRequest changeCommunityRequest)`
  Changes the community with the information that is present in the request.
  `Community`
  `changeToRootCommunity(UUID communityId)`
  Turns the community indicated by the given `communityId` in a root community, meaning it has no longer a parent.
  `boolean`
  `exists(UUID communityId)`
  Returns true if a community with given `communityId` exists and user has view permissions, false otherwise.
  `CursorPagedResponse<Community>`
  `findCommunities(FindCommunitiesRequest findCommunitiesRequest)`
  Returns communities matching given search criteria.
  `Community`
  `getCommunity(UUID communityId)`
  Returns the community identified by given `communityId`.
  `Community`
  `makeRootCommunity(UUID communityId)`
  Deprecated.
  This method will be removed in the future.
  `void`
  `removeCommunities(List<UUID> communityIds)`
  Deprecated.
  This method will be removed in the future.
  `Job`
  `removeCommunitiesInJob(List<UUID> communityIds, boolean sendNotification)`
  Removes communities identified by the given `communityIds` asynchronously.
  `void`
  `removeCommunity(UUID communityId)`
  Deprecated.
  This method will be removed in the future.
  `Job`
  `removeCommunityInJob(UUID communityId)`
  Removes a community identified by the given `communityId` asynchronously.

- ## Method Details

  - ### addCommunity

    Community addCommunity(AddCommunityRequest addCommunityRequest)
    Adds a new community or subcommunity.
    Parameters:
      `addCommunityRequest` - the properties of the community to be added
    Returns:
      the newly added community

  - ### addCommunities

    @SecurityAuditMethod(resultFormatter=com.collibra.audit.formatter.CollectionFormatter.class) List<Community> addCommunities(List<AddCommunityRequest> addCommunityRequests)
    Adds multiple communities in one go.
    Parameters:
      `addCommunityRequests` - a list of AddCommunity requests
    Returns:
      a list of the newly created communities

  - ### changeCommunity

    Community changeCommunity(ChangeCommunityRequest changeCommunityRequest)
    Changes the community with the information that is present in the request.
    Parameters:
      `changeCommunityRequest` - changes that to be performed on the community
    Returns:
      the changed community

  - ### changeCommunities

    @SecurityAuditMethod(resultFormatter=com.collibra.audit.formatter.CollectionFormatter.class) List<Community> changeCommunities(List<ChangeCommunityRequest> changeCommunityRequests)
    Changes multiple communities.
    Parameters:
      `changeCommunityRequests` - the properties of the communities to be changed
    Returns:
      the changed communities

  - ### makeRootCommunity

    @Deprecated Community makeRootCommunity(UUID communityId)
    Deprecated.
    This method will be removed in the future. Please, use `changeToRootCommunity(UUID)`.
    Turns the community indicated by the given `communityId` in a root community, meaning it has no longer a parent.
    Parameters:
      `communityId` - the identifier of the community
    Returns:
      the adapted community.

  - ### changeToRootCommunity

    Community changeToRootCommunity(UUID communityId)
    Turns the community indicated by the given `communityId` in a root community, meaning it has no longer a parent.
    Parameters:
      `communityId` - the identifier of the community
    Returns:
      the adapted community.

  - ### getCommunity

    Community getCommunity(UUID communityId)
    Returns the community identified by given `communityId`.
    Parameters:
      `communityId` - the identifier of the community.
    Returns:
      the found community

  - ### findCommunities

    @SecurityAuditMethod(resultFormatter=com.collibra.dgc.core.api.internal.security.audit.formatter.PagedResponseFormatter.class) CursorPagedResponse<Community> findCommunities(FindCommunitiesRequest findCommunitiesRequest)
    Returns communities matching given search criteria.
    Parameters:
      `findCommunitiesRequest` - the search criteria for communities
    Returns:
      the found communities

  - ### exists

    boolean exists(UUID communityId)
    Returns true if a community with given `communityId` exists and user has view permissions, false otherwise.
    Parameters:
      `communityId` - the identifier of the community
    Returns:
      true if a community with given `communityId` exists, `false` otherwise

  - ### removeCommunity

    @Deprecated void removeCommunity(UUID communityId)
    Deprecated.
    This method will be removed in the future. Please, use `removeCommunityInJob(UUID)`.
    Removes a community identified by given `communityId`.
    Parameters:
      `communityId` - the identifier of the community to remove

  - ### removeCommunities

    @Deprecated void removeCommunities(List<UUID> communityIds)
    Deprecated.
    This method will be removed in the future. Please, use `removeCommunitiesInJob(List, boolean)`.
    Removes multiple communities.
    Parameters:
      `communityIds` - the identifiers of the communities to remove

  - ### removeCommunityInJob

    Job removeCommunityInJob(UUID communityId)
    Removes a community identified by the given `communityId` asynchronously.
    Parameters:
      `communityId` - the identifier of the community to remove
    Returns:
      the job that is removing the community async

  - ### removeCommunitiesInJob

    Job removeCommunitiesInJob(List<UUID> communityIds, boolean sendNotification)
    Removes communities identified by the given `communityIds` asynchronously.
    Parameters:
      `communityIds` - the identifiers of communities to remove
      `sendNotification` - a boolean value indicating whether a notification should be sent or not
    Returns:
      the Job removing the communities