Interface DefaultSynchronizedPermissionManagement

    • Method Detail

      • getFirstUser

        default IPermissionUser getFirstUser​(java.lang.String name)
        Description copied from interface: IPermissionManagement
        Gets the first permission user with the given name.
        Specified by:
        getFirstUser in interface IPermissionManagement
        Parameters:
        name - the name of the user to get.
        Returns:
        the first permission user or null if no user with this name exists.
      • addUser

        default IPermissionUser addUser​(@NotNull
                                        @NotNull java.lang.String name,
                                        @NotNull
                                        @NotNull java.lang.String password,
                                        int potency)
        Description copied from interface: IPermissionManagement
        Adds a new permission user if it does not already exists.
        Specified by:
        addUser in interface IPermissionManagement
        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: IPermissionManagement
        Adds a new permission group if it does not already exists.
        Specified by:
        addGroup in interface IPermissionManagement
        Parameters:
        role - the case-sensitive name of the new group
        potency - the potency of the new group
        Returns:
        the newly created permission group
      • deleteUser

        default boolean deleteUser​(@NotNull
                                   @NotNull java.lang.String name)
        Description copied from interface: IPermissionManagement
        Deletes all users in the database matching the given name. This method is case-sensitive.
        Specified by:
        deleteUser in interface IPermissionManagement
        Parameters:
        name - the name of the users to be deleted
      • containsUser

        default boolean containsUser​(@NotNull
                                     @NotNull java.util.UUID uniqueId)
        Description copied from interface: IPermissionManagement
        Checks if a user with the given uniqueId is stored in the database.
        Specified by:
        containsUser in interface IPermissionManagement
        Parameters:
        uniqueId - the uniqueId of the user
        Returns:
        true if there is a user with that uniqueId, false otherwise
      • containsUser

        default boolean containsUser​(@NotNull
                                     @NotNull java.lang.String name)
        Description copied from interface: IPermissionManagement
        Checks if at least one user with the given name is stored in the database. This method is case-sensitive.
        Specified by:
        containsUser in interface IPermissionManagement
        Parameters:
        name - the name of the user
        Returns:
        true if there is a user with that name, false otherwise
      • getUser

        @Nullable
        default @Nullable IPermissionUser getUser​(@NotNull
                                                  @NotNull java.util.UUID uniqueId)
        Description copied from interface: IPermissionManagement
        Gets a user with the given uniqueId out of the database.
        Specified by:
        getUser in interface IPermissionManagement
        Parameters:
        uniqueId - the uniqueId of the user
        Returns:
        the IPermissionUser from the database or null if 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: IPermissionManagement
        Gets a user with the given uniqueId out of the database or creates a new one if the database contains no such entry.
        Specified by:
        getOrCreateUser in interface IPermissionManagement
        Parameters:
        uniqueId - the uniqueId of the user
        name - the name of the permission user
        Returns:
        the IPermissionUser from 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: IPermissionManagement
        Gets 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:
        getUsers in interface IPermissionManagement
        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: IPermissionManagement
        Gets 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:
        getUsers in interface IPermissionManagement
        Returns:
        a list of all IPermissionUsers stored in the database or an empty list if there is no user with that name stored.
      • getUsersByGroup

        default java.util.Collection<IPermissionUser> getUsersByGroup​(@NotNull
                                                                      @NotNull java.lang.String group)
        Description copied from interface: IPermissionManagement
        Gets 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:
        getUsersByGroup in interface IPermissionManagement
        Returns:
        a list of all IPermissionUsers stored in the database or an empty list if there is no user with that name stored.
      • deleteGroup

        default void deleteGroup​(@NotNull
                                 @NotNull java.lang.String name)
        Description copied from interface: IPermissionManagement
        Deletes a group by its name out of the list of groups. If a group with that name doesn't exist, nothing happens.
        Specified by:
        deleteGroup in interface IPermissionManagement
        Parameters:
        name - the case-sensitive name of the group
      • containsGroup

        default boolean containsGroup​(@NotNull
                                      @NotNull java.lang.String group)
        Description copied from interface: IPermissionManagement
        Checks if a specific group exists.
        Specified by:
        containsGroup in interface IPermissionManagement
        Parameters:
        group - the case-sensitive name of the group
        Returns:
        true if the group exists, false otherwise