Class GroupProvider

java.lang.Object
de.murmelmeister.murmelapi.group.GroupProvider
All Implemented Interfaces:
Group

public final class GroupProvider extends Object implements Group
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Creates a default group with the specified name.
    void
    createNewGroup(String groupName, int createdBy, int priority, String teamId)
    Creates a new group with the specified details.
    void
    deleteGroup(int executorId, int groupId)
    Deletes a group with the specified group ID.
    boolean
    existsGroup(int groupId)
    Checks if a group with the specified group ID exists.
    boolean
    existsGroup(String groupName)
    Checks if a group with the specified group name exists.
    Retrieves the color information associated with a group.
    getCreatedAt(int groupId)
    Retrieves the creation timestamp of the group specified by its unique ID.
    int
    getCreatedBy(int groupId)
    Retrieves the unique identifier of the user who created the specified group.
    getModifiedAt(int groupId)
    Retrieves the timestamp indicating when the specified group was last modified.
    int
    getModifiedBy(int groupId)
    Retrieves the unique identifier of the user who last modified the group specified by its unique identifier.
    getName(int groupId)
    Retrieves the name of the group associated with the specified group ID.
    Retrieves a list of names associated with the groups.
    Retrieves the parent information associated with the group.
    Retrieves the permission details associated with the group.
    int
    getPriority(int groupId)
    Retrieves the priority level assigned to a group specified by its unique identifier.
    getTeamSort(int groupId)
    Retrieves the team sort value associated with the specified group ID.
    int
    getUniqueId(String groupName)
    Retrieves the unique identifier for the specified group name.
    Retrieves a list of unique identifiers for the groups.
    void
    Loads expired group data for processing or further operations.
    void
    rename(int executorId, int groupId, String newName)
    Renames the specified group to a new name.
    void
    setPriority(int executorId, int groupId, int priority)
    Updates the priority level of a specified group.
    void
    setTeamSort(int executorId, int groupId, String teamSort)
    Sets the team sort order for the specified group.
    static void
    setup(Database database)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GroupProvider

      public GroupProvider(Database database)
  • Method Details

    • setup

      public static void setup(Database database)
    • existsGroup

      public boolean existsGroup(int groupId)
      Description copied from interface: Group
      Checks if a group with the specified group ID exists.
      Specified by:
      existsGroup in interface Group
      Parameters:
      groupId - The unique identifier of the group to check.
      Returns:
      True if the group exists, false otherwise.
    • existsGroup

      public boolean existsGroup(String groupName)
      Description copied from interface: Group
      Checks if a group with the specified group name exists.
      Specified by:
      existsGroup in interface Group
      Parameters:
      groupName - The name of the group to check.
      Returns:
      True if the group exists, false otherwise.
    • createNewGroup

      public void createNewGroup(String groupName, int createdBy, int priority, String teamId)
      Description copied from interface: Group
      Creates a new group with the specified details.
      Specified by:
      createNewGroup in interface Group
      Parameters:
      groupName - The name of the new group to be created.
      createdBy - The ID of the user creating the group.
      priority - The priority level of the group.
      teamId - The ID of the team to which the group belongs.
    • deleteGroup

      public void deleteGroup(int executorId, int groupId)
      Description copied from interface: Group
      Deletes a group with the specified group ID.
      Specified by:
      deleteGroup in interface Group
      Parameters:
      executorId - The unique identifier of the user performing the deletion.
      groupId - The unique identifier of the group to be deleted.
    • getUniqueId

      public int getUniqueId(String groupName)
      Description copied from interface: Group
      Retrieves the unique identifier for the specified group name.
      Specified by:
      getUniqueId in interface Group
      Parameters:
      groupName - The name of the group whose unique identifier is to be retrieved.
      Returns:
      The unique identifier associated with the specified group name.
    • getName

      public String getName(int groupId)
      Description copied from interface: Group
      Retrieves the name of the group associated with the specified group ID.
      Specified by:
      getName in interface Group
      Parameters:
      groupId - The unique identifier of the group whose name is to be retrieved.
      Returns:
      The name of the group corresponding to the provided group ID.
    • rename

      public void rename(int executorId, int groupId, String newName)
      Description copied from interface: Group
      Renames the specified group to a new name.
      Specified by:
      rename in interface Group
      Parameters:
      executorId - The unique identifier of the user performing the rename operation.
      groupId - The unique identifier of the group to be renamed.
      newName - The new name for the group.
    • getUniqueIds

      public List<Integer> getUniqueIds()
      Description copied from interface: Group
      Retrieves a list of unique identifiers for the groups.
      Specified by:
      getUniqueIds in interface Group
      Returns:
      A list of integers representing the unique identifiers for the groups.
    • getNames

      public List<String> getNames()
      Description copied from interface: Group
      Retrieves a list of names associated with the groups.
      Specified by:
      getNames in interface Group
      Returns:
      A list of strings representing the names of the groups.
    • getPriority

      public int getPriority(int groupId)
      Description copied from interface: Group
      Retrieves the priority level assigned to a group specified by its unique identifier.
      Specified by:
      getPriority in interface Group
      Parameters:
      groupId - The unique identifier of the group whose priority is to be retrieved.
      Returns:
      The priority level of the specified group as an integer.
    • setPriority

      public void setPriority(int executorId, int groupId, int priority)
      Description copied from interface: Group
      Updates the priority level of a specified group.
      Specified by:
      setPriority in interface Group
      Parameters:
      executorId - The unique identifier of the user performing the update.
      groupId - The unique identifier of the group whose priority is to be set.
      priority - The new priority level to assign to the group.
    • getTeamSort

      public String getTeamSort(int groupId)
      Description copied from interface: Group
      Retrieves the team sort value associated with the specified group ID.
      Specified by:
      getTeamSort in interface Group
      Parameters:
      groupId - The unique identifier of the group whose team sort value is to be retrieved.
      Returns:
      The team sort value of the specified group as a string.
    • setTeamSort

      public void setTeamSort(int executorId, int groupId, String teamSort)
      Description copied from interface: Group
      Sets the team sort order for the specified group.
      Specified by:
      setTeamSort in interface Group
      Parameters:
      executorId - The unique identifier of the user performing the operation.
      groupId - The unique identifier of the group whose team sort is being set.
      teamSort - The new team sort value to assign to the group.
    • getCreatedBy

      public int getCreatedBy(int groupId)
      Description copied from interface: Group
      Retrieves the unique identifier of the user who created the specified group.
      Specified by:
      getCreatedBy in interface Group
      Parameters:
      groupId - The unique identifier of the group whose creator's ID is to be retrieved.
      Returns:
      The unique identifier of the user who created the specified group.
    • getCreatedAt

      public Timestamp getCreatedAt(int groupId)
      Description copied from interface: Group
      Retrieves the creation timestamp of the group specified by its unique ID.
      Specified by:
      getCreatedAt in interface Group
      Parameters:
      groupId - The unique identifier of the group whose creation timestamp is to be retrieved.
      Returns:
      The creation timestamp of the group as a Timestamp.
    • getModifiedBy

      public int getModifiedBy(int groupId)
      Description copied from interface: Group
      Retrieves the unique identifier of the user who last modified the group specified by its unique identifier.
      Specified by:
      getModifiedBy in interface Group
      Parameters:
      groupId - The unique identifier of the group whose modifier is to be retrieved.
      Returns:
      The unique identifier of the user who last modified the specified group.
    • getModifiedAt

      public Timestamp getModifiedAt(int groupId)
      Description copied from interface: Group
      Retrieves the timestamp indicating when the specified group was last modified.
      Specified by:
      getModifiedAt in interface Group
      Parameters:
      groupId - The unique identifier of the group whose modification timestamp is to be retrieved.
      Returns:
      A Timestamp object representing the last modification time of the specified group.
    • createDefaultGroup

      public void createDefaultGroup(String groupName)
      Description copied from interface: Group
      Creates a default group with the specified name.
      Specified by:
      createDefaultGroup in interface Group
      Parameters:
      groupName - The name of the group to be created.
    • loadExpired

      public void loadExpired()
      Description copied from interface: Group
      Loads expired group data for processing or further operations. This method fetches and handles groups that have surpassed their expiration criteria. Typically used to manage or clean up expired group entries.
      Specified by:
      loadExpired in interface Group
    • getColor

      public GroupColor getColor()
      Description copied from interface: Group
      Retrieves the color information associated with a group.
      Specified by:
      getColor in interface Group
      Returns:
      An instance of GroupColor representing the color configuration of the group.
    • getParent

      public GroupParent getParent()
      Description copied from interface: Group
      Retrieves the parent information associated with the group.
      Specified by:
      getParent in interface Group
      Returns:
      An instance of GroupParent representing the parent configuration of the group.
    • getPermission

      public GroupPermission getPermission()
      Description copied from interface: Group
      Retrieves the permission details associated with the group.
      Specified by:
      getPermission in interface Group
      Returns:
      An instance of GroupPermission representing the permission configuration of the group.