Class GroupPermissionProvider

java.lang.Object
de.murmelmeister.murmelapi.group.permission.GroupPermissionProvider
All Implemented Interfaces:
GroupPermission

public final class GroupPermissionProvider extends Object implements GroupPermission
  • Field Details

  • Constructor Details

    • GroupPermissionProvider

      public GroupPermissionProvider()
  • Method Details

    • createTable

      private void createTable(String tableName)
    • existsPermission

      public boolean existsPermission(int groupId, String permission)
      Description copied from interface: GroupPermission
      Checks if a permission exists.
      Specified by:
      existsPermission in interface GroupPermission
      Parameters:
      groupId - The id of the group.
      permission - The permission.
      Returns:
      True if the permission exists, otherwise false.
    • addPermission

      public void addPermission(int groupId, int creatorId, String permission, long time)
      Description copied from interface: GroupPermission
      Adds a permission to a group.
      Specified by:
      addPermission in interface GroupPermission
      Parameters:
      groupId - The id of the group.
      creatorId - The id of the creator.
      permission - The permission.
      time - The time the permission was added.
    • removePermission

      public void removePermission(int groupId, String permission)
      Description copied from interface: GroupPermission
      Removes a permission from a group.
      Specified by:
      removePermission in interface GroupPermission
      Parameters:
      groupId - The id of the group.
      permission - The permission.
    • clearPermission

      public void clearPermission(int groupId)
      Description copied from interface: GroupPermission
      Clears all permissions of a group.
      Specified by:
      clearPermission in interface GroupPermission
      Parameters:
      groupId - The id of the group.
    • getPermissions

      public List<String> getPermissions(int groupId)
      Description copied from interface: GroupPermission
      Obtains all permissions of a group.
      Specified by:
      getPermissions in interface GroupPermission
      Parameters:
      groupId - The id of the group.
      Returns:
      A list of all permissions of the group.
    • getAllPermissions

      public List<String> getAllPermissions(GroupParent groupParent, int groupId)
      Description copied from interface: GroupPermission
      Obtains all permissions of a group.
      Specified by:
      getAllPermissions in interface GroupPermission
      Parameters:
      groupParent - The group parent.
      groupId - The id of the group.
      Returns:
      A list of all permissions of the group.
    • getCreatorId

      public int getCreatorId(int groupId, String permission)
      Description copied from interface: GroupPermission
      Obtains the creator id of a permission.
      Specified by:
      getCreatorId in interface GroupPermission
      Parameters:
      groupId - The id of the group.
      permission - The permission.
      Returns:
      The creator id of the permission.
    • getCreatedTime

      public long getCreatedTime(int groupId, String permission)
      Description copied from interface: GroupPermission
      Obtains the created time of a permission.
      Specified by:
      getCreatedTime in interface GroupPermission
      Parameters:
      groupId - The id of the group.
      permission - The permission.
      Returns:
      The created time of the permission.
    • getCreatedDate

      public String getCreatedDate(int groupId, String permission)
      Description copied from interface: GroupPermission
      Obtains the created date of a permission.
      Specified by:
      getCreatedDate in interface GroupPermission
      Parameters:
      groupId - The id of the group.
      permission - The permission.
      Returns:
      The created date of the permission.
    • getExpiredTime

      public long getExpiredTime(int groupId, String permission)
      Description copied from interface: GroupPermission
      Obtains the expired time of a permission.
      Specified by:
      getExpiredTime in interface GroupPermission
      Parameters:
      groupId - The id of the group.
      permission - The permission.
      Returns:
      The expired time of the permission.
    • getExpiredDate

      public String getExpiredDate(int groupId, String permission)
      Description copied from interface: GroupPermission
      Obtains the expired date of a permission.
      Specified by:
      getExpiredDate in interface GroupPermission
      Parameters:
      groupId - The id of the group.
      permission - The permission.
      Returns:
      The expired date of the permission.
    • setExpiredTime

      public String setExpiredTime(int groupId, String permission, long time)
      Description copied from interface: GroupPermission
      Sets the expired time of a permission.
      Specified by:
      setExpiredTime in interface GroupPermission
      Parameters:
      groupId - The id of the group.
      permission - The permission.
      time - The time the permission will expire.
      Returns:
      The expired date of the permission.
    • addExpiredTime

      public String addExpiredTime(int groupId, String permission, long time)
      Description copied from interface: GroupPermission
      Adds time to the expired time of a permission.
      Specified by:
      addExpiredTime in interface GroupPermission
      Parameters:
      groupId - The id of the group.
      permission - The permission.
      time - The time to add to the expired time.
      Returns:
      The expired date of the permission.
    • removeExpiredTime

      public String removeExpiredTime(int groupId, String permission, long time)
      Description copied from interface: GroupPermission
      Removes time from the expired time of a permission.
      Specified by:
      removeExpiredTime in interface GroupPermission
      Parameters:
      groupId - The id of the group.
      permission - The permission.
      time - The time to remove from the expired time.
      Returns:
      The expired date of the permission.
    • loadExpired

      public void loadExpired(Group group)
      Description copied from interface: GroupPermission
      Loads all expired permissions of a group.
      Specified by:
      loadExpired in interface GroupPermission
      Parameters:
      group - The group.