Package org.gridgain.internal.rbac.roles
Class ConfigurationRoleStore
java.lang.Object
org.gridgain.internal.rbac.roles.ConfigurationRoleStore
Role store implementation based on distributed configuration
AuthorizationConfiguration.-
Constructor Summary
ConstructorsConstructorDescriptionConfigurationRoleStore(org.gridgain.internal.rbac.configuration.AuthorizationConfiguration authorizationConfiguration) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionList<org.gridgain.internal.rbac.roles.Role>get(Collection<LowerCaseString> keys) Get entries by keys.@Nullable org.gridgain.internal.rbac.roles.Roleget(LowerCaseString key) Gets entry by key.Collection<org.gridgain.internal.rbac.roles.Role>getAll()Gets all entries.Map<LowerCaseString,org.gridgain.internal.rbac.roles.Role> Gets all entries with keys.Set<org.gridgain.internal.rbac.privileges.Privilege>getPrivileges(Set<String> roleNames) Returns the union of privileges across the given roles.putIfNotExists(LowerCaseString roleName, org.gridgain.internal.rbac.roles.Role role) Puts entry if given key does not exist.removeIfExists(LowerCaseString roleName) Removes entry if given key exists.voidstart()Starts the store: populates cache and registers configuration listener.voidstop()Stops the store: unregisters configuration listener.updateIfExists(LowerCaseString roleName, Function<org.gridgain.internal.rbac.roles.Role, org.gridgain.internal.rbac.roles.Role> update) Updates entry if given key exists.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gridgain.internal.rbac.store.Store
get, get, putIfNotExists, removeIfExists, updateIfExists
-
Constructor Details
-
ConfigurationRoleStore
public ConfigurationRoleStore(org.gridgain.internal.rbac.configuration.AuthorizationConfiguration authorizationConfiguration) Constructor.- Parameters:
authorizationConfiguration- Authorization configuration.
-
-
Method Details
-
start
public void start()Starts the store: populates cache and registers configuration listener. -
stop
public void stop()Stops the store: unregisters configuration listener. -
putIfNotExists
public CompletableFuture<OperationResult> putIfNotExists(LowerCaseString roleName, org.gridgain.internal.rbac.roles.Role role) Description copied from interface:StorePuts entry if given key does not exist.- Specified by:
putIfNotExistsin interfaceStore<org.gridgain.internal.rbac.roles.Role>- Parameters:
roleName- Entry key.role- Entry value.- Returns:
- Operation result.
-
updateIfExists
public CompletableFuture<OperationResult> updateIfExists(LowerCaseString roleName, Function<org.gridgain.internal.rbac.roles.Role, org.gridgain.internal.rbac.roles.Role> update) Description copied from interface:StoreUpdates entry if given key exists.- Specified by:
updateIfExistsin interfaceStore<org.gridgain.internal.rbac.roles.Role>- Parameters:
roleName- Entry key.update- Update entry function.- Returns:
- Operation result.
-
removeIfExists
Description copied from interface:StoreRemoves entry if given key exists.- Specified by:
removeIfExistsin interfaceStore<org.gridgain.internal.rbac.roles.Role>- Parameters:
roleName- Entry key.- Returns:
- Operation result.
-
getAll
Description copied from interface:StoreGets all entries. If there is no entries at all, empty collection will be returned. -
getAllWithKeys
Description copied from interface:StoreGets all entries with keys. If there is no entries at all, empty map will be returned.- Specified by:
getAllWithKeysin interfaceStore<org.gridgain.internal.rbac.roles.Role>- Returns:
- Map from entry key to entry.
-
get
Description copied from interface:StoreGets entry by key. -
get
Description copied from interface:StoreGet entries by keys. -
getPrivileges
Description copied from interface:RoleStoreReturns the union of privileges across the given roles. Roles that do not exist are silently skipped.- Specified by:
getPrivilegesin interfaceRoleStore- Parameters:
roleNames- Role names.- Returns:
- Combined set of privileges.
-