Package dk.acto.fafnir.api.service
Interface AdministrationService
- All Known Implementing Classes:
HazelcastAdministrationService
public interface AdministrationService
-
Method Summary
Modifier and TypeMethodDescriptionReads the amount of organisations.createClaim(OrganisationSubjectPair pair, ClaimData source) Creates a claim for a user and an organisation.createOrganisation(OrganisationData source) Creates a new organisation.createUser(UserData source) Creates a new user.Deletes all claims for an organisation - user pair.deleteOrganisation(String orgId) Deletes an organisation.deleteUser(String subject) Deletes a user.reactor.core.publisher.ConnectableFlux<String>Gets a ConnectableFlux which produces with every new organisation deleted from the administration service.reactor.core.publisher.ConnectableFlux<OrganisationData>Gets a ConnectableFlux which produces with every new organisation created/updated.reactor.core.publisher.ConnectableFlux<OrganisationData>getOrganisationFlux(Boolean publishOnUpdate) Gets a ConnectableFlux which produces with every new organisation created/updated.getOrganisationsForUser(String subject) Reads all organisations for a user.reactor.core.publisher.ConnectableFlux<String>Gets a ConnectableFlux which produces with every new user deleted from the administration service.reactor.core.publisher.ConnectableFlux<UserData>Gets a ConnectableFlux which produces with every new user created.reactor.core.publisher.ConnectableFlux<UserData>getUserFlux(Boolean publishOnUpdate) Gets a ConnectableFlux which produces with every new user created.UserData[]getUsersForOrganisation(String orgId) Reads all users for an organisation.Reads all claims for an organisation - user pair.readOrganisation(TenantIdentifier identifier) Reads an organisation by TenantIdentifier.readOrganisation(String orgId) Reads an organisation.Reads all organisations.readOrganisations(Long page) Read a paginated list of organisations.Reads a user, Fails is user does not exist.UserData[]Reads all users.Read a paginated list of users.updateClaims(OrganisationSubjectPair pair, ClaimData source) Update claims for an organisation - user pair.updateOrganisation(OrganisationData source) Updates an organisation.updateUser(UserData source) Updates a user.
-
Method Details
-
createUser
Creates a new user. Fails if user already exists.- Parameters:
source- the UserData for the new user.- Returns:
- the new UserData.
-
readUser
Reads a user, Fails is user does not exist.- Parameters:
subject- the user's subject.- Returns:
- the UserData for the user.
-
readUsers
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
Updates a user. Fails if user does not exist.- Parameters:
source- the user's new values.- Returns:
- the new user's UserData.
-
deleteUser
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
Creates a new organisation. Fails if organisation already exists.- Parameters:
source- the OrganisationData for the new organisation.- Returns:
- the created organisatian's OrganisationData.
-
readOrganisation
Reads an organisation. Fails is organisation does not exist.- Parameters:
orgId- the organisation id.- Returns:
- the organisation's OrganisationData.
-
readOrganisations
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
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
Updates an organisation. Fails if organisation does not exist.- Parameters:
source- the organisation's new values.- Returns:
- the new organisation's OrganisationData.
-
deleteOrganisation
Deletes an organisation. Fails is organisation does not exist.- Parameters:
orgId- the organisation's id.- Returns:
- the OrganisationData for the deleted organisation.
-
createClaim
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
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
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
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
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. SeegetUserFlux(Boolean).- Returns:
- the ConnectableFlux.
-
getUserFlux
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. SeegetOrganisationFlux(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.
-