Class MongoUserUidDao
java.lang.Object
dev.getelements.elements.dao.mongo.MongoUserUidDao
- All Implemented Interfaces:
UserUidDao
-
Field Summary
Fields inherited from interface dev.getelements.elements.sdk.dao.UserUidDao
SCHEME_EMAIL, SCHEME_NAME, SCHEME_PHONE_NUMBER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateUserUid(UserUid userUid) Attempts to create a new UserUid with the given userUid object.createUserUidStrict(UserUid userUid) Attempts to create a new UserUid with the given userUid object.findUserUid(String id, String scheme) Gets the user uid with the given name or idgetAllUserIdsForUser(String userId) Gets all user uids for a given userdev.morphia.DatastoregetUserUid(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 uidsvoidsetDatastore(dev.morphia.Datastore datastore) voidsetDozerMapperRegistry(MapperRegistry dozerMapperRegistry) voidsetMongoDBUtils(MongoDBUtils mongoDBUtils) voidsetMongoUserDao(MongoUserDao mongoUserDao) voidsetValidationHelper(ValidationHelper validationHelper) 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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.getelements.elements.sdk.dao.UserUidDao
deleteUserUid, deleteUserUid, getAllUserIdsForUser, softDeleteUser, softDeleteUser, softDeleteUserUidsForUserId, tryDeleteUserUid
-
Constructor Details
-
MongoUserUidDao
public MongoUserUidDao()
-
-
Method Details
-
getAllUserIdsForUser
Description copied from interface:UserUidDaoGets all user uids for a given user- Specified by:
getAllUserIdsForUserin interfaceUserUidDao- Returns:
- the user uid pagination object
-
getUserUids
Description copied from interface:UserUidDaoAttempts to get a certain number of user uids- Specified by:
getUserUidsin interfaceUserUidDao- 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
Description copied from interface:UserUidDaoGets the user uid with the given name or id- Specified by:
getUserUidin interfaceUserUidDao- Parameters:
id- - the id associated with the schemescheme- - the scheme name- Returns:
- the user uid object
-
findUserUid
Description copied from interface:UserUidDaoGets the user uid with the given name or id- Specified by:
findUserUidin interfaceUserUidDao- Parameters:
id- - the id associated with the schemescheme- - the scheme name- Returns:
- the user uid object
-
createUserUidStrict
Description copied from interface:UserUidDaoAttempts to create a new UserUid with the given userUid object. Using "Strict" semantics, if the user exists then this will throw an exception.- Specified by:
createUserUidStrictin interfaceUserUidDao- Parameters:
userUid- - the object to create in the db- Returns:
- - the resultant userUid with any modifications made as a result of the creation
-
createUserUid
Description copied from interface:UserUidDaoAttempts to create a new UserUid with the given userUid object. Using "Strict" semantics, if the user exists then this will throw an exception.- Specified by:
createUserUidin interfaceUserUidDao- Parameters:
userUid- - the object to create in the db- Returns:
- - the resultant userUid with any modifications made as a result of the creation
-
tryDeleteUserUid
Description copied from interface:UserUidDaoDeletes a user uid by its scheme and user id.- Specified by:
tryDeleteUserUidin interfaceUserUidDao- Parameters:
scheme- Corresponds toUserUid.getScheme()id- Corresponds toUserUid.getId()- Returns:
- true if the UserUid was found and deleted, false otherwise
-
trySoftDeleteUser
Description copied from interface:UserUidDaoSoft 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.- Specified by:
trySoftDeleteUserin interfaceUserUidDao- Parameters:
userId- the user to soft delete- Returns:
- true if the user was found and soft deleted, false otherwise
-
getDatastore
public dev.morphia.Datastore getDatastore() -
setDatastore
@Inject public void setDatastore(dev.morphia.Datastore datastore) -
getValidationHelper
-
setValidationHelper
-
getMongoDBUtils
-
setMongoDBUtils
-
getDozerMapperRegistry
-
setDozerMapperRegistry
-
getMongoUserDao
-
setMongoUserDao
-