@Beta
public interface SecurityService
Modifier and Type | Method and Description |
---|---|
void |
addRelationship(PrincipalRelationship relationship) |
AuthenticationInfo |
authenticate(AuthenticationToken token) |
Group |
createGroup(CreateGroupParams createGroupParams)
Creates a group on the specified user store.
|
Role |
createRole(CreateRoleParams createRoleParams)
Creates a role on the specified user store.
|
User |
createUser(CreateUserParams createUserParams)
Creates a user on the specified user store.
|
UserStore |
createUserStore(CreateUserStoreParams createUserStoreParams) |
void |
deletePrincipal(PrincipalKey principalKey)
Deletes an existing principal.
|
void |
deleteUserStore(UserStoreKey userStoreKey)
Deletes an existing userStore.
|
Principals |
findPrincipals(UserStoreKey useStore,
List<PrincipalType> types,
String query) |
UserStoreAccessControlList |
getDefaultUserStorePermissions() |
Optional<Group> |
getGroup(PrincipalKey groupKey)
Looks up a group by key and returns an
Optional with the group instance. |
PrincipalKeys |
getMemberships(PrincipalKey principalKey)
Retrieve the list of principals (groups or roles) that have the specified principal as a member.
|
Optional<? extends Principal> |
getPrincipal(PrincipalKey principalKey)
Looks up a principal by key and returns an
Optional with the principal instance. |
Principals |
getPrincipals(PrincipalKeys principalKeys)
Looks up a set of principals by key and returns a list of with the
Principals found. |
PrincipalRelationships |
getRelationships(PrincipalKey from) |
Optional<Role> |
getRole(PrincipalKey roleKey)
Looks up a role by key and returns an
Optional with the role instance. |
Optional<User> |
getUser(PrincipalKey userKey)
Looks up a user by key and returns an
Optional with the user instance. |
UserStore |
getUserStore(UserStoreKey userStore) |
UserStoreAccessControlList |
getUserStorePermissions(UserStoreKey userStore) |
UserStores |
getUserStores() |
PrincipalQueryResult |
query(PrincipalQuery query) |
void |
removeRelationship(PrincipalRelationship relationship) |
void |
removeRelationships(PrincipalKey from) |
User |
setPassword(PrincipalKey key,
String password) |
Group |
updateGroup(UpdateGroupParams updateGroupParams)
Updates an existing group.
|
Role |
updateRole(UpdateRoleParams updateRoleParams)
Updates an existing role.
|
User |
updateUser(UpdateUserParams updateUserParams)
Updates an existing user.
|
UserStore |
updateUserStore(UpdateUserStoreParams updateUserStoreParams) |
UserStores getUserStores()
UserStore getUserStore(UserStoreKey userStore)
UserStoreAccessControlList getUserStorePermissions(UserStoreKey userStore)
UserStoreAccessControlList getDefaultUserStorePermissions()
UserStore createUserStore(CreateUserStoreParams createUserStoreParams)
UserStore updateUserStore(UpdateUserStoreParams updateUserStoreParams)
Principals findPrincipals(UserStoreKey useStore, List<PrincipalType> types, String query)
AuthenticationInfo authenticate(AuthenticationToken token)
User setPassword(PrincipalKey key, String password)
User createUser(CreateUserParams createUserParams)
createUserParams
- details of the user to be createdPrincipalAlreadyExistsException
- if a user with the same key already existsUser updateUser(UpdateUserParams updateUserParams)
updateUserParams
- details of the user to be updatedPrincipalNotFoundException
- if the specified user does not existOptional<User> getUser(PrincipalKey userKey)
Optional
with the user instance.userKey
- principal key of the user to retrieveOptional
with the userPrincipalKeys getMemberships(PrincipalKey principalKey)
principalKey
- principal key to obtain memberships ofPrincipalKeys
containing the list of groups and roles that the principal is a member ofGroup createGroup(CreateGroupParams createGroupParams)
createGroupParams
- details of the group to be createdPrincipalAlreadyExistsException
- if a group with the same key already existsGroup updateGroup(UpdateGroupParams updateGroupParams)
updateGroupParams
- details of the group to be updatedPrincipalNotFoundException
- if the specified group does not existOptional<Group> getGroup(PrincipalKey groupKey)
Optional
with the group instance.groupKey
- principal key of the group to retrieveOptional
with the groupRole createRole(CreateRoleParams createRoleParams)
createRoleParams
- details of the role to be createdPrincipalAlreadyExistsException
- if a role with the same key already existsRole updateRole(UpdateRoleParams updateRoleParams)
updateRoleParams
- details of the role to be updatedPrincipalNotFoundException
- if the specified role does not existOptional<Role> getRole(PrincipalKey roleKey)
Optional
with the role instance.roleKey
- principal key of the role to retrieveOptional
with the roleOptional<? extends Principal> getPrincipal(PrincipalKey principalKey)
Optional
with the principal instance.principalKey
- key of the principal to retrieveOptional
with the principalPrincipals getPrincipals(PrincipalKeys principalKeys)
Principals
found.
If one or more principal keys cannot be found, they will be omitted from the result.principalKeys
- keys of the principals to retrievePrincipals
object containing the list of principals foundvoid deletePrincipal(PrincipalKey principalKey)
principalKey
- key of the principal to be deletedPrincipalNotFoundException
- if the specified principal does not existvoid deleteUserStore(UserStoreKey userStoreKey)
userStoreKey
- key of the userStore to be deletedUserStoreNotFoundException
- if the specified userStore does not existPrincipalQueryResult query(PrincipalQuery query)
PrincipalRelationships getRelationships(PrincipalKey from)
void addRelationship(PrincipalRelationship relationship)
void removeRelationship(PrincipalRelationship relationship)
void removeRelationships(PrincipalKey from)