Interface DefaultSynchronizedPermissionManagement
-
- All Superinterfaces:
IPermissionManagement
public interface DefaultSynchronizedPermissionManagement extends IPermissionManagement
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default IPermissionGroupaddGroup(@NotNull IPermissionGroup permissionGroup)Adds a new permission group to the list of groups.default IPermissionGroupaddGroup(@NotNull java.lang.String role, int potency)Adds a new permission group if it does not already exists.default IPermissionUseraddUser(@NotNull IPermissionUser permissionUser)Adds a new user to the database.default IPermissionUseraddUser(@NotNull java.lang.String name, @NotNull java.lang.String password, int potency)Adds a new permission user if it does not already exists.default booleancontainsGroup(@NotNull java.lang.String group)Checks if a specific group exists.default booleancontainsUser(@NotNull java.lang.String name)Checks if at least one user with the given name is stored in the database.default booleancontainsUser(@NotNull java.util.UUID uniqueId)Checks if a user with the given uniqueId is stored in the database.default voiddeleteGroup(@NotNull IPermissionGroup permissionGroup)Deletes a group by its name out of the list of groups.default voiddeleteGroup(@NotNull java.lang.String name)Deletes a group by its name out of the list of groups.default booleandeleteUser(@NotNull IPermissionUser permissionUser)Deletes one user with the uniqueId of the given user.default booleandeleteUser(@NotNull java.lang.String name)Deletes all users in the database matching the given name.default IPermissionGroupgetDefaultPermissionGroup()Gets the default permission group.default IPermissionUsergetFirstUser(java.lang.String name)Gets the first permission user with the givenname.default @Nullable IPermissionGroupgetGroup(@NotNull java.lang.String name)Gets a specific group by its name.default @NotNull IPermissionUsergetOrCreateUser(@NotNull java.util.UUID uniqueId, @NotNull java.lang.String name)Gets a user with the given uniqueId out of the database or creates a new one if the database contains no such entry.default @Nullable IPermissionUsergetUser(@NotNull java.util.UUID uniqueId)Gets a user with the given uniqueId out of the database.default @NotNull java.util.Collection<IPermissionUser>getUsers()Gets a list of all users stored in the database.default @NotNull java.util.List<IPermissionUser>getUsers(@NotNull java.lang.String name)Gets a list of all users with the given name out of the database.default java.util.Collection<IPermissionUser>getUsersByGroup(@NotNull java.lang.String group)Gets a list of all users stored in the database with the given group.default IPermissionGroupmodifyGroup(@NotNull java.lang.String name, @NotNull java.util.function.Consumer<IPermissionGroup> modifier)Gets the permission group with the given name by usingIPermissionManagement.getGroup(String)and, if not null, puts it into the consumer, after that, the group will be updated by usingIPermissionManagement.updateGroup(IPermissionGroup).default IPermissionUsermodifyUser(@NotNull java.util.UUID uniqueId, @NotNull java.util.function.Consumer<IPermissionUser> modifier)Gets the permission user with the given uniqueId by usingIPermissionManagement.getUser(UUID)and, if not null, puts them into the consumer, after that, the user will be updated by usingIPermissionManagement.updateUser(IPermissionUser).default java.util.List<IPermissionUser>modifyUsers(@NotNull java.lang.String name, @NotNull java.util.function.Consumer<IPermissionUser> modifier)Gets every user matching the given name by usingIPermissionManagement.getUsers(String)and puts them into the consumer, after that, every user will be updated by usingIPermissionManagement.updateUser(IPermissionUser).default voidsetGroups(java.util.Collection<? extends IPermissionGroup> groups)Clears all groups in the Cloud and sets given groups.default voidsetUsers(@NotNull java.util.Collection<? extends IPermissionUser> users)Clears all users stored in the database and inserts the given list.default voidupdateGroup(@NotNull IPermissionGroup permissionGroup)Updates a permission group in the list of groups.default voidupdateUser(@NotNull IPermissionUser permissionUser)Updates an already existing user in the database.-
Methods inherited from interface de.dytanic.cloudnet.driver.permission.IPermissionManagement
addGroupAsync, addGroupAsync, addUserAsync, addUserAsync, canBeOverwritten, containsGroupAsync, containsUserAsync, containsUserAsync, deleteGroupAsync, deleteGroupAsync, deleteUserAsync, deleteUserAsync, findHighestPermission, getAllPermissions, getAllPermissions, getChildPermissionManagement, getDefaultPermissionGroupAsync, getExtendedGroups, getFirstUserAsync, getGroupAsync, getGroups, getGroups, getGroupsAsync, getGroupsAsync, getHighestPermissionGroup, getOrCreateUserAsync, getPermissionResult, getPermissionResult, getPermissionResult, getPermissionResult, getPermissionResult, getUser, getUserAsync, getUsersAsync, getUsersAsync, getUsersByGroupAsync, hasPermission, hasPermission, hasPermission, init, modifyGroupAsync, modifyUserAsync, modifyUsersAsync, reload, setGroupsAsync, setUsersAsync, testPermissible, testPermissionGroup, testPermissionUser, updateGroupAsync, updateUserAsync
-
-
-
-
Method Detail
-
getFirstUser
default IPermissionUser getFirstUser(java.lang.String name)
Description copied from interface:IPermissionManagementGets the first permission user with the givenname.- Specified by:
getFirstUserin interfaceIPermissionManagement- Parameters:
name- the name of the user to get.- Returns:
- the first permission user or
nullif no user with this name exists.
-
getDefaultPermissionGroup
default IPermissionGroup getDefaultPermissionGroup()
Description copied from interface:IPermissionManagementGets the default permission group.- Specified by:
getDefaultPermissionGroupin interfaceIPermissionManagement- Returns:
- the default permission group.
-
addUser
default IPermissionUser addUser(@NotNull @NotNull java.lang.String name, @NotNull @NotNull java.lang.String password, int potency)
Description copied from interface:IPermissionManagementAdds a new permission user if it does not already exists.- Specified by:
addUserin interfaceIPermissionManagement- Parameters:
name- the name of the new user.password- the password of the new user.potency- the potency of the new user.- Returns:
- the newly created permission user.
-
addGroup
default IPermissionGroup addGroup(@NotNull @NotNull java.lang.String role, int potency)
Description copied from interface:IPermissionManagementAdds a new permission group if it does not already exists.- Specified by:
addGroupin interfaceIPermissionManagement- Parameters:
role- the case-sensitive name of the new grouppotency- the potency of the new group- Returns:
- the newly created permission group
-
addUser
default IPermissionUser addUser(@NotNull @NotNull IPermissionUser permissionUser)
Description copied from interface:IPermissionManagementAdds a new user to the database.- Specified by:
addUserin interfaceIPermissionManagement- Parameters:
permissionUser- the user to be added- Returns:
- the new user
-
updateUser
default void updateUser(@NotNull @NotNull IPermissionUser permissionUser)Description copied from interface:IPermissionManagementUpdates an already existing user in the database.- Specified by:
updateUserin interfaceIPermissionManagement- Parameters:
permissionUser- the user to be updated
-
deleteUser
default boolean deleteUser(@NotNull @NotNull java.lang.String name)Description copied from interface:IPermissionManagementDeletes all users in the database matching the given name. This method is case-sensitive.- Specified by:
deleteUserin interfaceIPermissionManagement- Parameters:
name- the name of the users to be deleted
-
deleteUser
default boolean deleteUser(@NotNull @NotNull IPermissionUser permissionUser)Description copied from interface:IPermissionManagementDeletes one user with the uniqueId of the given user.- Specified by:
deleteUserin interfaceIPermissionManagement- Parameters:
permissionUser- the user to be deleted
-
containsUser
default boolean containsUser(@NotNull @NotNull java.util.UUID uniqueId)Description copied from interface:IPermissionManagementChecks if a user with the given uniqueId is stored in the database.- Specified by:
containsUserin interfaceIPermissionManagement- Parameters:
uniqueId- the uniqueId of the user- Returns:
trueif there is a user with that uniqueId,falseotherwise
-
containsUser
default boolean containsUser(@NotNull @NotNull java.lang.String name)Description copied from interface:IPermissionManagementChecks if at least one user with the given name is stored in the database. This method is case-sensitive.- Specified by:
containsUserin interfaceIPermissionManagement- Parameters:
name- the name of the user- Returns:
trueif there is a user with that name,falseotherwise
-
getUser
@Nullable default @Nullable IPermissionUser getUser(@NotNull @NotNull java.util.UUID uniqueId)
Description copied from interface:IPermissionManagementGets a user with the given uniqueId out of the database.- Specified by:
getUserin interfaceIPermissionManagement- Parameters:
uniqueId- the uniqueId of the user- Returns:
- the
IPermissionUserfrom the database ornullif there is no user with that uniqueId stored
-
getOrCreateUser
@NotNull default @NotNull IPermissionUser getOrCreateUser(@NotNull @NotNull java.util.UUID uniqueId, @NotNull @NotNull java.lang.String name)
Description copied from interface:IPermissionManagementGets a user with the given uniqueId out of the database or creates a new one if the database contains no such entry.- Specified by:
getOrCreateUserin interfaceIPermissionManagement- Parameters:
uniqueId- the uniqueId of the username- the name of the permission user- Returns:
- the
IPermissionUserfrom the database or a newly created one.
-
getUsers
@NotNull default @NotNull java.util.List<IPermissionUser> getUsers(@NotNull @NotNull java.lang.String name)
Description copied from interface:IPermissionManagementGets a list of all users with the given name out of the database. This can only return null when the connection to the database (or when it is executed in a Wrapper instance the connection to the cloud) times out.- Specified by:
getUsersin interfaceIPermissionManagement- Parameters:
name- the name of the users- Returns:
- a list of all
IPermissionUsers stored in the database or an empty list if there is no user with that name stored.
-
getUsers
@NotNull default @NotNull java.util.Collection<IPermissionUser> getUsers()
Description copied from interface:IPermissionManagementGets a list of all users stored in the database. This can only return null when the connection to the database (or when it is executed in a Wrapper instance the connection to the cloud) times out.This method shouldn't be used when there are many users stored in the database, because that takes a lot of memory.
- Specified by:
getUsersin interfaceIPermissionManagement- Returns:
- a list of all
IPermissionUsers stored in the database or an empty list if there is no user with that name stored.
-
setUsers
default void setUsers(@NotNull @NotNull java.util.Collection<? extends IPermissionUser> users)Description copied from interface:IPermissionManagementClears all users stored in the database and inserts the given list.- Specified by:
setUsersin interfaceIPermissionManagement- Parameters:
users- the newIPermissionUsers to be stored in the database
-
getUsersByGroup
default java.util.Collection<IPermissionUser> getUsersByGroup(@NotNull @NotNull java.lang.String group)
Description copied from interface:IPermissionManagementGets a list of all users stored in the database with the given group. This can only return null when the connection to the database (or when it is executed in a Wrapper instance the connection to the cloud) times out.This method shouldn't be used when there are many users with that group stored in the database, because that takes a lot of memory.
- Specified by:
getUsersByGroupin interfaceIPermissionManagement- Returns:
- a list of all
IPermissionUsers stored in the database or an empty list if there is no user with that name stored.
-
addGroup
default IPermissionGroup addGroup(@NotNull @NotNull IPermissionGroup permissionGroup)
Description copied from interface:IPermissionManagementAdds a new permission group to the list of groups. If a group with that name already exists, it will be deleted and created again.- Specified by:
addGroupin interfaceIPermissionManagement- Parameters:
permissionGroup- theIPermissionGroupto be added- Returns:
- the new group
-
updateGroup
default void updateGroup(@NotNull @NotNull IPermissionGroup permissionGroup)Description copied from interface:IPermissionManagementUpdates a permission group in the list of groups. If a group with that name doesn't exist, it will be created.- Specified by:
updateGroupin interfaceIPermissionManagement- Parameters:
permissionGroup- theIPermissionGroupto be updated
-
deleteGroup
default void deleteGroup(@NotNull @NotNull java.lang.String name)Description copied from interface:IPermissionManagementDeletes a group by its name out of the list of groups. If a group with that name doesn't exist, nothing happens.- Specified by:
deleteGroupin interfaceIPermissionManagement- Parameters:
name- the case-sensitive name of the group
-
deleteGroup
default void deleteGroup(@NotNull @NotNull IPermissionGroup permissionGroup)Description copied from interface:IPermissionManagementDeletes a group by its name out of the list of groups. If a group with that name doesn't exist, nothing happens.- Specified by:
deleteGroupin interfaceIPermissionManagement- Parameters:
permissionGroup- theIPermissionGroupto be deleted
-
containsGroup
default boolean containsGroup(@NotNull @NotNull java.lang.String group)Description copied from interface:IPermissionManagementChecks if a specific group exists.- Specified by:
containsGroupin interfaceIPermissionManagement- Parameters:
group- the case-sensitive name of the group- Returns:
trueif the group exists,falseotherwise
-
getGroup
@Nullable default @Nullable IPermissionGroup getGroup(@NotNull @NotNull java.lang.String name)
Description copied from interface:IPermissionManagementGets a specific group by its name.- Specified by:
getGroupin interfaceIPermissionManagement- Parameters:
name- the case-sensitive name of the group- Returns:
- the
IPermissionUserif it exists,nullotherwise
-
setGroups
default void setGroups(java.util.Collection<? extends IPermissionGroup> groups)
Description copied from interface:IPermissionManagementClears all groups in the Cloud and sets given groups.- Specified by:
setGroupsin interfaceIPermissionManagement- Parameters:
groups- the new groups
-
modifyGroup
default IPermissionGroup modifyGroup(@NotNull @NotNull java.lang.String name, @NotNull @NotNull java.util.function.Consumer<IPermissionGroup> modifier)
Description copied from interface:IPermissionManagementGets the permission group with the given name by usingIPermissionManagement.getGroup(String)and, if not null, puts it into the consumer, after that, the group will be updated by usingIPermissionManagement.updateGroup(IPermissionGroup).- Specified by:
modifyGroupin interfaceIPermissionManagement- Parameters:
name- the name of the groupmodifier- the Consumer to modify the user- Returns:
- the modified user
-
modifyUsers
default java.util.List<IPermissionUser> modifyUsers(@NotNull @NotNull java.lang.String name, @NotNull @NotNull java.util.function.Consumer<IPermissionUser> modifier)
Description copied from interface:IPermissionManagementGets every user matching the given name by usingIPermissionManagement.getUsers(String)and puts them into the consumer, after that, every user will be updated by usingIPermissionManagement.updateUser(IPermissionUser).- Specified by:
modifyUsersin interfaceIPermissionManagement- Parameters:
name- the name of the usersmodifier- the Consumer to modify the available users- Returns:
- a list of all modified users
-
modifyUser
default IPermissionUser modifyUser(@NotNull @NotNull java.util.UUID uniqueId, @NotNull @NotNull java.util.function.Consumer<IPermissionUser> modifier)
Description copied from interface:IPermissionManagementGets the permission user with the given uniqueId by usingIPermissionManagement.getUser(UUID)and, if not null, puts them into the consumer, after that, the user will be updated by usingIPermissionManagement.updateUser(IPermissionUser).- Specified by:
modifyUserin interfaceIPermissionManagement- Parameters:
uniqueId- the uniqueId of the usermodifier- the Consumer to modify the user- Returns:
- the modified user
-
-