Package dev.getelements.elements.sdk.dao
Interface UserUidDao
- All Known Implementing Classes:
MongoUserUidDao
public interface UserUidDao
This is the UserUidDao which is used to manage associated unique user ids. These will represent different
methods of authentication and associate them with a singular User object. All user id schemes that begin with
'dev.getelements' are reserved.
Created by keithhudnall on 1/29/25.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncreateUserUid(UserUid userUid) Attempts to create a new UserUid with the given userUid object.createUserUidStrict(UserUid userUid) Deprecated.default voiddeleteUserUid(UserUid userUid) Deletes a user uid by its UserUid object.default voiddeleteUserUid(String scheme, String id) Deletes a user uid by its scheme and user id.findUserUid(String id, String scheme) Gets the user uid with the given name or idgetAllUserIdsForUser(User user) Gets all user uids for a given usergetAllUserIdsForUser(String userId) Gets all user uids for a given usergetUserUid(String id, String scheme) Gets the user uid with the given name or idgetUserUids(int offset, int count, String search) Attempts to get a certain number of user uidsdefault voidsoftDeleteUser(User user) Soft deletes the user by removing all ID references to the user in the UserUid records.default voidsoftDeleteUser(String userId) Soft deletes the user by removing all ID references to the user in the UserUid records.default voidDeprecated.default booleantryDeleteUserUid(UserUid userUid) Deletes a user uid by its UserUid object.booleantryDeleteUserUid(String scheme, String id) Deletes a user uid by its scheme and user id.booleantrySoftDeleteUser(String userId) Soft deletes the user by removing all ID references to the user in the UserUid records.
-
Field Details
-
SCHEME_NAME
- See Also:
-
SCHEME_EMAIL
- See Also:
-
SCHEME_PHONE_NUMBER
- See Also:
-
-
Method Details
-
getAllUserIdsForUser
Gets all user uids for a given user- Returns:
- the user uid pagination object
-
getAllUserIdsForUser
Gets all user uids for a given user- Returns:
- the user uid pagination object
-
getUserUids
Attempts to get a certain number of user uids- Parameters:
offset- - the page offsetcount- - total results per pagesearch- - search query - valid search properties are scheme, uid, and user id- Returns:
- the user uid pagination object
-
getUserUid
Gets the user uid with the given name or id- Parameters:
id- - the id associated with the schemescheme- - the scheme name- Returns:
- the user uid object
-
findUserUid
Gets the user uid with the given name or id- Parameters:
id- - the id associated with the schemescheme- - the scheme name- Returns:
- the user uid object
-
createUserUidStrict
Deprecated.Attempts to create a new UserUid with the given userUid object. Using "Strict" semantics, if the user exists then this will throw an exception.- Parameters:
userUid- - the object to create in the db- Returns:
- - the resultant userUid with any modifications made as a result of the creation
-
createUserUid
Attempts to create a new UserUid with the given userUid object. Using "Strict" semantics, if the user exists then this will throw an exception.- Parameters:
userUid- - the object to create in the db- Returns:
- - the resultant userUid with any modifications made as a result of the creation
-
deleteUserUid
Deletes a user uid by its UserUid object.- Parameters:
userUid- the UserUid object to delete- Throws:
UserNotFoundException- if the UserUid with the given scheme and id does not exist
-
deleteUserUid
Deletes a user uid by its scheme and user id.- Parameters:
scheme- Corresponds toUserUid.getScheme()id- Corresponds toUserUid.getId()- Throws:
UserNotFoundException- if the UserUid with the given scheme and id does not exist
-
tryDeleteUserUid
Deletes a user uid by its UserUid object.- Parameters:
userUid- the UserUid object to delete- Returns:
- true if the UserUid was found and deleted, false otherwise
-
tryDeleteUserUid
Deletes a user uid by its scheme and user id.- Parameters:
scheme- Corresponds toUserUid.getScheme()id- Corresponds toUserUid.getId()- Returns:
- true if the UserUid was found and deleted, false otherwise
-
softDeleteUser
Soft deletes the user by removing all ID references to the user in the UserUid records. This does not delete the actual User object, just the references to it in UserUid records. It is STRONGLY RECOMMENDED to use this method from within a transaction to ensure data integrity as it requires multiple operations to complete. Outside of a transaction, there is a substantial risk of partial completion leaving the associated data in an inconsistent state.- Parameters:
user- the user to soft delete
-
softDeleteUser
Soft deletes the user by removing all ID references to the user in the UserUid records. This does not delete the actual User object, just the references to it in UserUid records. It is STRONGLY RECOMMENDED to use this method from within a transaction to ensure data integrity as it requires multiple operations to complete. Outside of a transaction, there is a substantial risk of partial completion leaving the associated data in an inconsistent state.- Parameters:
userId- the user to soft delete- Throws:
UserNotFoundException- if the user with the given id does not exist
-
trySoftDeleteUser
Soft deletes the user by removing all ID references to the user in the UserUid records. This does not delete the actual User object, just the references to it in UserUid records. It is STRONGLY RECOMMENDED to use this method from within a transaction to ensure data integrity as it requires multiple operations to complete. Outside of a transaction, there is a substantial risk of partial completion leaving the associated data in an inconsistent state.- Parameters:
userId- the user to soft delete- Returns:
- true if the user was found and soft deleted, false otherwise
-
softDeleteUserUidsForUserId
Deprecated.UsesoftDeleteUser(User)instead.This will scrub all scheme ids for all UserUids referencing the user with the given id. It is STRONGLY RECOMMENDED to use this method from within a transaction to ensure data integrity as it requires multiple operations to complete. Outside of a transaction, there is a substantial risk of partial completion leaving the associated data in an inconsistent state.- Parameters:
user- - the id of the user to search for
-
softDeleteUser(User)instead.