Interface AdministrationService

All Known Implementing Classes:
HazelcastAdministrationService

public interface AdministrationService
  • Method Details

    • createUser

      UserData createUser(UserData source)
      Creates a new user. Fails if user already exists.
      Parameters:
      source - the UserData for the new user.
      Returns:
      the new UserData.
    • readUser

      UserData readUser(String subject)
      Reads a user, Fails is user does not exist.
      Parameters:
      subject - the user's subject.
      Returns:
      the UserData for the user.
    • readUsers

      Slice<UserData> readUsers(Long page)
      Read a paginated list of users. Page size is defined by Slice.PAGE_SIZE (default 30).
      Parameters:
      page - the page to read. 0 indexed.
      Returns:
      page with users.
    • readUsers

      UserData[] readUsers()
      Reads all users.
      Returns:
      an array with all users.
    • updateUser

      UserData updateUser(UserData source)
      Updates a user. Fails if user does not exist.
      Parameters:
      source - the user's new values.
      Returns:
      the new user's UserData.
    • deleteUser

      UserData deleteUser(String subject)
      Deletes a user. Fails is user does not exist, or if user has any existing claims.
      Parameters:
      subject - the user's subject.
      Returns:
      the UserData for the deleted user.
    • createOrganisation

      OrganisationData createOrganisation(OrganisationData source)
      Creates a new organisation. Fails if organisation already exists.
      Parameters:
      source - the OrganisationData for the new organisation.
      Returns:
      the created organisatian's OrganisationData.
    • readOrganisation

      OrganisationData readOrganisation(String orgId)
      Reads an organisation. Fails is organisation does not exist.
      Parameters:
      orgId - the organisation id.
      Returns:
      the organisation's OrganisationData.
    • readOrganisations

      Slice<OrganisationData> readOrganisations(Long page)
      Read a paginated list of organisations. Page size is defined by Slice.PAGE_SIZE (default 30).
      Parameters:
      page - the page to read. 0 indexed.
      Returns:
      page with organisations.
    • readOrganisations

      OrganisationData[] readOrganisations()
      Reads all organisations.
      Returns:
      an array with all organisations.
    • countOrganisations

      Long countOrganisations()
      Reads the amount of organisations.
      Returns:
      the number of organisations.
    • readOrganisation

      OrganisationData readOrganisation(TenantIdentifier identifier)
      Reads an organisation by TenantIdentifier. Fails if organisation does not exist. Will return the one of any matches, order is not guaranteed.
      Parameters:
      identifier - the matcher function.
      Returns:
      the organisation's OrganisationData.
    • updateOrganisation

      OrganisationData updateOrganisation(OrganisationData source)
      Updates an organisation. Fails if organisation does not exist.
      Parameters:
      source - the organisation's new values.
      Returns:
      the new organisation's OrganisationData.
    • deleteOrganisation

      OrganisationData deleteOrganisation(String orgId)
      Deletes an organisation. Fails is organisation does not exist.
      Parameters:
      orgId - the organisation's id.
      Returns:
      the OrganisationData for the deleted organisation.
    • createClaim

      ClaimData createClaim(OrganisationSubjectPair pair, ClaimData source)
      Creates a claim for a user and an organisation. Fails if user or organisation does not exist, or if claim already exists.
      Parameters:
      pair - the user - organisation pair.
      source - the ClaimData for the new claim.
      Returns:
      the created ClaimData.
    • readClaims

      Reads all claims for an organisation - user pair. Fails if pair doesn't have any claims.
      Parameters:
      pair - the user - organisation pair.
      Returns:
      the pair's ClaimData.
    • updateClaims

      ClaimData updateClaims(OrganisationSubjectPair pair, ClaimData source)
      Update claims for an organisation - user pair. Fails if pair doesn't have any claims.
      Parameters:
      pair - the user - organisation pair.
      source - the ClaimData to replace the old claim.
      Returns:
      the updated ClaimData.
    • deleteClaims

      ClaimData deleteClaims(OrganisationSubjectPair pair)
      Deletes all claims for an organisation - user pair. Fails if pair doesn't have any claims.
      Parameters:
      pair - the user - organisation pair.
      Returns:
      the deleted claims.
    • getOrganisationsForUser

      OrganisationData[] getOrganisationsForUser(String subject)
      Reads all organisations for a user. A user is only in an organisation if there exists a claim for that organisation - user pair.
      Parameters:
      subject - the user's subject.
      Returns:
      the organisations which the user is part of.
    • getUsersForOrganisation

      UserData[] getUsersForOrganisation(String orgId)
      Reads all users for an organisation. A user is only in an organisation if there exists a claim for that organisation - user pair.
      Parameters:
      orgId - the user's subject.
      Returns:
      the users which are part of the organisation.
    • getUserFlux

      reactor.core.publisher.ConnectableFlux<UserData> getUserFlux()
      Gets a ConnectableFlux which produces with every new user created. The Flux does not complete. By default it will also publish on update. See getUserFlux(Boolean).
      Returns:
      the ConnectableFlux.
    • getUserFlux

      reactor.core.publisher.ConnectableFlux<UserData> getUserFlux(Boolean publishOnUpdate)
      Gets a ConnectableFlux which produces with every new user created. The Flux does not complete.
      Parameters:
      publishOnUpdate - whether this flux should publish on update.
      Returns:
      the ConnectableFlux.
    • getOrganisationFlux

      reactor.core.publisher.ConnectableFlux<OrganisationData> getOrganisationFlux()
      Gets a ConnectableFlux which produces with every new organisation created/updated. The Flux does not complete. By default it will also publish on update. See getOrganisationFlux(Boolean).
      Returns:
      the ConnectableFlux.
    • getOrganisationFlux

      reactor.core.publisher.ConnectableFlux<OrganisationData> getOrganisationFlux(Boolean publishOnUpdate)
      Gets a ConnectableFlux which produces with every new organisation created/updated. The Flux does not complete.
      Parameters:
      publishOnUpdate - whether this flux should publish on update.
      Returns:
      the ConnectableFlux.
    • getUserDeletionFlux

      reactor.core.publisher.ConnectableFlux<String> getUserDeletionFlux()
      Gets a ConnectableFlux which produces with every new user deleted from the administration service. The Flux does not complete.
      Returns:
      the ConnectableFlux of subjects.
    • getOrganisationDeletionFlux

      reactor.core.publisher.ConnectableFlux<String> getOrganisationDeletionFlux()
      Gets a ConnectableFlux which produces with every new organisation deleted from the administration service. The Flux does not complete.
      Returns:
      the ConnectableFlux of organisationIds.