Package de.murmelmeister.murmelapi.user
Class UserProvider
java.lang.Object
de.murmelmeister.murmelapi.user.UserProvider
- All Implemented Interfaces:
User
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcreateOrGetUser(String username) Creates a new user with the specified username if it does not already exist, or retrieves the ID of an existing user with the specified username.intcreateOrGetUser(UUID uuid) Creates a new user with the specified UUID if it does not already exist, or retrieves the ID of an existing user associated with the specified UUID.voidcreateUser(UUID uuid, String username) Creates a new user in the system based on the provided UUID and username.voiddeleteUser(UUID uuid) Deletes a user associated with the specified UUID.booleanexistsUser(String username) Checks if a user with the specified username exists.booleanexistsUser(UUID uuid) Checks if a user with the specified UUID exists.getFirstJoinDate(int userId) Retrieves the first join date of a user as a formatted date string.getFirstJoinTime(int userId) Retrieves the first join time of a user in milliseconds since the epoch.intRetrieves the unique numeric ID of a user associated with the specified username.intRetrieves the unique numeric ID of a user associated with the specified UUID.Retrieves the parent information associated with the user.Retrieves the permission associated with a user.getUniqueId(int userId) Retrieves the unique identifier (UUID) associated with the specified user ID.getUniqueId(String username) Retrieves the unique identifier (UUID) associated with the specified username.Retrieves a list of unique identifiers (UUIDs) associated with all users.getUsername(int userId) Retrieves the username associated with the specified user ID.getUsername(UUID uuid) Retrieves the username associated with the specified UUID.Retrieves a list of usernames for all users.voidJoins the user identified by the specified UUID and username into the system.voidLoads and processes expired user data in the system.voidRenames a user by updating the username associated with the given user ID.voidUpdates the username of the user associated with the specified UUID.voidsetFirstJoinTime(int userId) Sets the first join time for a user identified by the given user ID.static void
-
Constructor Details
-
UserProvider
-
-
Method Details
-
setup
-
createOrGetUser
Description copied from interface:UserCreates a new user with the specified username if it does not already exist, or retrieves the ID of an existing user with the specified username.- Specified by:
createOrGetUserin interfaceUser- Parameters:
username- The username of the user to create or retrieve- Returns:
- The unique numeric ID of the newly created or existing user
-
createOrGetUser
Description copied from interface:UserCreates a new user with the specified UUID if it does not already exist, or retrieves the ID of an existing user associated with the specified UUID.- Specified by:
createOrGetUserin interfaceUser- Parameters:
uuid- The unique identifier of the user to create or retrieve- Returns:
- The unique numeric ID of the newly created or existing user
-
existsUser
Description copied from interface:UserChecks if a user with the specified UUID exists.- Specified by:
existsUserin interfaceUser- Parameters:
uuid- The unique identifier of the user to check- Returns:
- True if a user with the given UUID exists, false otherwise
-
existsUser
Description copied from interface:UserChecks if a user with the specified username exists.- Specified by:
existsUserin interfaceUser- Parameters:
username- The username of the user to check- Returns:
- True if a user with the given username exists, false otherwise
-
createUser
Description copied from interface:UserCreates a new user in the system based on the provided UUID and username. If the user already exists, no new user will be created.- Specified by:
createUserin interfaceUser- Parameters:
uuid- The unique identifier of the user to be createdusername- The username of the user to be created
-
deleteUser
Description copied from interface:UserDeletes a user associated with the specified UUID.- Specified by:
deleteUserin interfaceUser- Parameters:
uuid- The unique identifier of the user to be deleted
-
getId
Description copied from interface:UserRetrieves the unique numeric ID of a user associated with the specified UUID. -
getId
Description copied from interface:UserRetrieves the unique numeric ID of a user associated with the specified username. -
getUniqueId
Description copied from interface:UserRetrieves the unique identifier (UUID) associated with the specified user ID. If no user exists with the given ID, the behavior may vary depending on the implementation.- Specified by:
getUniqueIdin interfaceUser- Parameters:
userId- The unique numeric ID of the user- Returns:
- The UUID associated with the specified user ID
-
getUniqueId
Description copied from interface:UserRetrieves the unique identifier (UUID) associated with the specified username. If no user exists with the given username, the behavior may vary depending on the implementation.- Specified by:
getUniqueIdin interfaceUser- Parameters:
username- The username of the user whose UUID is to be retrieved- Returns:
- The UUID associated with the specified username
-
getUsername
Description copied from interface:UserRetrieves the username associated with the specified user ID.- Specified by:
getUsernamein interfaceUser- Parameters:
userId- The unique numeric ID of the user whose username is to be retrieved- Returns:
- The username associated with the given user ID
-
getUsername
Description copied from interface:UserRetrieves the username associated with the specified UUID.- Specified by:
getUsernamein interfaceUser- Parameters:
uuid- The unique identifier of the user whose username is to be retrieved- Returns:
- The username associated with the given UUID
-
rename
Description copied from interface:UserRenames a user by updating the username associated with the given user ID. -
rename
Description copied from interface:UserUpdates the username of the user associated with the specified UUID. -
getUniqueIds
Description copied from interface:UserRetrieves a list of unique identifiers (UUIDs) associated with all users.- Specified by:
getUniqueIdsin interfaceUser- Returns:
- A list of UUIDs representing all users.
-
getUsernames
Description copied from interface:UserRetrieves a list of usernames for all users.- Specified by:
getUsernamesin interfaceUser- Returns:
- A list of usernames representing all users.
-
getFirstJoinTime
Description copied from interface:UserRetrieves the first join time of a user in milliseconds since the epoch.- Specified by:
getFirstJoinTimein interfaceUser- Parameters:
userId- The unique numeric ID of the user- Returns:
- The first join time of the user in milliseconds since January 1, 1970, 00:00:00 GMT
-
getFirstJoinDate
Description copied from interface:UserRetrieves the first join date of a user as a formatted date string.- Specified by:
getFirstJoinDatein interfaceUser- Parameters:
userId- The unique numeric ID of the user whose first join date is to be retrieved- Returns:
- A string representing the first join date of the user
-
setFirstJoinTime
public void setFirstJoinTime(int userId) Description copied from interface:UserSets the first join time for a user identified by the given user ID.- Specified by:
setFirstJoinTimein interfaceUser- Parameters:
userId- The unique numeric ID of the user whose first join time is to be set
-
joinUser
Description copied from interface:UserJoins the user identified by the specified UUID and username into the system. -
loadExpired
public void loadExpired()Description copied from interface:UserLoads and processes expired user data in the system. This method handles expired or outdated user records, executing relevant operations such as cleanup, refresh, or other maintenance tasks depending on the specific implementation.- Specified by:
loadExpiredin interfaceUser
-
getParent
Description copied from interface:UserRetrieves the parent information associated with the user. -
getPermission
Description copied from interface:UserRetrieves the permission associated with a user.- Specified by:
getPermissionin interfaceUser- Returns:
- The UserPermission object representing the user's permissions.
-