Interface GroupParent
- All Known Implementing Classes:
GroupParentProvider
Group parent interface to manage group parents.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddParent(int executorId, int groupId, int parentId, long time) Adds a parent relationship for a group.voidclearParent(int groupId) Removes all parent associations for a specified group.booleanexistsParent(int groupId, int parentId) Checks whether a parent exists for a specified group.getCreatedAt(int groupId, int parentId) Retrieves the creation timestamp of the association between the specified group and parent.intgetCreatedBy(int groupId, int parentId) Retrieves the ID of the creator associated with the specified group and parent relationship.getExpiredDate(int groupId, int parentId) Retrieves the expiration date of the association between the specified group and parent.longgetExpiredTime(int groupId, int parentId) Retrieves the expiration time of the association between the specified group and parent.getModifiedAt(int groupId, int parentId) Retrieves the last modified timestamp of the association between the specified group and parent.intgetModifiedBy(int groupId, int parentId) Retrieves the unique identifier of the user who last modified the association between the specified group and parent.getParentIds(int groupId) Retrieves the list of IDs of all parent associations for the specified group.getParentNames(Group group, int groupId) Retrieves the names of all parent entities associated with the specified group.booleanisExpired(int groupId, int parentId) Determines if the association between the specified group and parent is expired.voidloadExpired(Group group) Loads all expired parent associations for the specified group.voidremoveParent(int groupId, int parentId) Removes the association between a specified parent and a group.setExpiredTime(int executorId, int groupId, int parentId, long time) Updates the expiration time for the association between the specified group and parent.
-
Method Details
-
existsParent
boolean existsParent(int groupId, int parentId) Checks whether a parent exists for a specified group.- Parameters:
groupId- The unique identifier of the group.parentId- The unique identifier of the parent to check.- Returns:
- True if the specified parent exists for the group; otherwise, false.
-
addParent
void addParent(int executorId, int groupId, int parentId, long time) Adds a parent relationship for a group. If the specified parent already exists for the group, the method will not perform any action.- Parameters:
executorId- The unique identifier of the user performing this action.groupId- The unique identifier of the group to which the parent will be added.parentId- The unique identifier of the parent to be added.time- The duration in milliseconds until the parent relationship expires. Use -1 for no expiration.
-
removeParent
void removeParent(int groupId, int parentId) Removes the association between a specified parent and a group.- Parameters:
groupId- The unique identifier of the group whose parent should be removed.parentId- The unique identifier of the parent to be removed.
-
clearParent
void clearParent(int groupId) Removes all parent associations for a specified group.- Parameters:
groupId- The unique identifier of the group whose parent associations should be cleared.
-
getParentIds
Retrieves the list of IDs of all parent associations for the specified group.- Parameters:
groupId- The unique identifier of the group whose parent IDs are being retrieved.- Returns:
- A list of integers representing the IDs of the parents associated with the specified group.
-
getParentNames
Retrieves the names of all parent entities associated with the specified group.- Parameters:
group- The instance of theGroupinterface representing the group.groupId- The unique identifier of the group whose parent names are to be retrieved.- Returns:
- A list of strings representing the names of the parent entities associated with the group.
-
getExpiredTime
long getExpiredTime(int groupId, int parentId) Retrieves the expiration time of the association between the specified group and parent.- Parameters:
groupId- The unique identifier of the group.parentId- The unique identifier of the parent.- Returns:
- The expiration time of the association, represented as a long value in milliseconds since the epoch. If the association does not have an expiration, it may return a specific value to indicate such a case (e.g., -1).
-
getExpiredDate
Retrieves the expiration date of the association between the specified group and parent.- Parameters:
groupId- The unique identifier of the group.parentId- The unique identifier of the parent.- Returns:
- A string representing the expiration date of the association. If no expiration is set, it may return a specific value indicating such a case.
-
setExpiredTime
Updates the expiration time for the association between the specified group and parent. If the expiration is successfully updated, returns a confirmation status or message.- Parameters:
executorId- The unique identifier of the user performing this action.groupId- The unique identifier of the group whose parent association is being updated.parentId- The unique identifier of the parent whose association expiration is being updated.time- The new expiration time in milliseconds since the epoch. Use -1 for no expiration.- Returns:
- A string representing the result of the operation, such as confirmation or error details.
-
isExpired
boolean isExpired(int groupId, int parentId) Determines if the association between the specified group and parent is expired.- Parameters:
groupId- The unique identifier of the group.parentId- The unique identifier of the parent.- Returns:
- True if the association is expired; otherwise, false.
-
getCreatedBy
int getCreatedBy(int groupId, int parentId) Retrieves the ID of the creator associated with the specified group and parent relationship.- Parameters:
groupId- The unique identifier of the group.parentId- The unique identifier of the parent.- Returns:
- An integer representing the ID of the creator of the group-parent relationship.
-
getCreatedAt
Retrieves the creation timestamp of the association between the specified group and parent.- Parameters:
groupId- The unique identifier of the group.parentId- The unique identifier of the parent.- Returns:
- A
Timestampobject representing the creation date and time of the association.
-
getModifiedBy
int getModifiedBy(int groupId, int parentId) Retrieves the unique identifier of the user who last modified the association between the specified group and parent.- Parameters:
groupId- The unique identifier of the group.parentId- The unique identifier of the parent.- Returns:
- An integer representing the ID of the user who last modified the association.
-
getModifiedAt
Retrieves the last modified timestamp of the association between the specified group and parent.- Parameters:
groupId- The unique identifier of the group.parentId- The unique identifier of the parent.- Returns:
- A
Timestamprepresenting the last modified time of the association. If the association does not exist or has not been modified, it may return null or a specific value to indicate such a case.
-
loadExpired
Loads all expired parent associations for the specified group. This operation is performed on behalf of a specific user, and it handles any necessary processing related to expired associations within the given group.- Parameters:
group- The instance of theGrouprepresenting the group for which expired parent associations should be loaded.
-