Package de.murmelmeister.murmelapi.user
Interface User
- All Known Implementing Classes:
UserProvider
User interface to manage users.
-
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.
-
Method Details
-
createOrGetUser
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.- Parameters:
username- The username of the user to create or retrieve- Returns:
- The unique numeric ID of the newly created or existing user
-
createOrGetUser
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.- 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
Checks if a user with the specified UUID exists.- Parameters:
uuid- The unique identifier of the user to check- Returns:
- True if a user with the given UUID exists, false otherwise
-
existsUser
Checks if a user with the specified username exists.- Parameters:
username- The username of the user to check- Returns:
- True if a user with the given username exists, false otherwise
-
createUser
Creates a new user in the system based on the provided UUID and username. If the user already exists, no new user will be created.- Parameters:
uuid- The unique identifier of the user to be createdusername- The username of the user to be created
-
deleteUser
Deletes a user associated with the specified UUID.- Parameters:
uuid- The unique identifier of the user to be deleted
-
getId
Retrieves the unique numeric ID of a user associated with the specified UUID.- Parameters:
uuid- The unique identifier of the user whose ID is to be retrieved- Returns:
- The unique numeric ID of the user associated with the given UUID
-
getId
Retrieves the unique numeric ID of a user associated with the specified username.- Parameters:
username- The username of the user whose ID is to be retrieved- Returns:
- The unique numeric ID of the user associated with the given username
-
getUniqueId
Retrieves 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.- Parameters:
userId- The unique numeric ID of the user- Returns:
- The UUID associated with the specified user ID
-
getUniqueId
Retrieves 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.- Parameters:
username- The username of the user whose UUID is to be retrieved- Returns:
- The UUID associated with the specified username
-
getUsername
Retrieves the username associated with the specified user ID.- 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
Retrieves the username associated with the specified UUID.- Parameters:
uuid- The unique identifier of the user whose username is to be retrieved- Returns:
- The username associated with the given UUID
-
rename
Renames a user by updating the username associated with the given user ID.- Parameters:
userId- The unique numeric ID of the user whose username is to be updatednewUsername- The new username to associate with the user
-
rename
Updates the username of the user associated with the specified UUID.- Parameters:
uuid- The unique identifier of the user to be updatednewUsername- The new username to assign to the user
-
getUniqueIds
Retrieves a list of unique identifiers (UUIDs) associated with all users.- Returns:
- A list of UUIDs representing all users.
-
getUsernames
Retrieves a list of usernames for all users.- Returns:
- A list of usernames representing all users.
-
getFirstJoinTime
Retrieves the first join time of a user in milliseconds since the epoch.- 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
Retrieves the first join date of a user as a formatted date string.- 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
void setFirstJoinTime(int userId) Sets the first join time for a user identified by the given user ID.- Parameters:
userId- The unique numeric ID of the user whose first join time is to be set
-
joinUser
Joins the user identified by the specified UUID and username into the system.- Parameters:
uuid- The unique identifier associated with the user to joinusername- The username of the user to join
-
loadExpired
void loadExpired()Loads 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. -
getParent
UserParent getParent()Retrieves the parent information associated with the user.- Returns:
- A UserParent object representing the parent information of the user.
-
getPermission
UserPermission getPermission()Retrieves the permission associated with a user.- Returns:
- The UserPermission object representing the user's permissions.
-