Class MongoUserUidDao

java.lang.Object
dev.getelements.elements.dao.mongo.MongoUserUidDao
All Implemented Interfaces:
UserUidDao

public class MongoUserUidDao extends Object implements UserUidDao
  • Constructor Details

    • MongoUserUidDao

      public MongoUserUidDao()
  • Method Details

    • getAllUserIdsForUser

      public List<UserUid> getAllUserIdsForUser(String userId)
      Description copied from interface: UserUidDao
      Gets all user uids for a given user
      Specified by:
      getAllUserIdsForUser in interface UserUidDao
      Returns:
      the user uid pagination object
    • getUserUids

      public Pagination<UserUid> getUserUids(int offset, int count, String search)
      Description copied from interface: UserUidDao
      Attempts to get a certain number of user uids
      Specified by:
      getUserUids in interface UserUidDao
      Parameters:
      offset - - the page offset
      count - - total results per page
      search - - search query - valid search properties are scheme, uid, and user id
      Returns:
      the user uid pagination object
    • getUserUid

      public UserUid getUserUid(String id, String scheme)
      Description copied from interface: UserUidDao
      Gets the user uid with the given name or id
      Specified by:
      getUserUid in interface UserUidDao
      Parameters:
      id - - the id associated with the scheme
      scheme - - the scheme name
      Returns:
      the user uid object
    • findUserUid

      public Optional<UserUid> findUserUid(String id, String scheme)
      Description copied from interface: UserUidDao
      Gets the user uid with the given name or id
      Specified by:
      findUserUid in interface UserUidDao
      Parameters:
      id - - the id associated with the scheme
      scheme - - the scheme name
      Returns:
      the user uid object
    • createUserUidStrict

      public UserUid createUserUidStrict(UserUid userUid)
      Description copied from interface: UserUidDao
      Attempts 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:
      createUserUidStrict in interface UserUidDao
      Parameters:
      userUid - - the object to create in the db
      Returns:
      - the resultant userUid with any modifications made as a result of the creation
    • createUserUid

      public UserUid createUserUid(UserUid userUid)
      Description copied from interface: UserUidDao
      Attempts 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:
      createUserUid in interface UserUidDao
      Parameters:
      userUid - - the object to create in the db
      Returns:
      - the resultant userUid with any modifications made as a result of the creation
    • tryDeleteUserUid

      public boolean tryDeleteUserUid(String scheme, String id)
      Description copied from interface: UserUidDao
      Deletes a user uid by its scheme and user id.
      Specified by:
      tryDeleteUserUid in interface UserUidDao
      Parameters:
      scheme - Corresponds to UserUid.getScheme()
      id - Corresponds to UserUid.getId()
      Returns:
      true if the UserUid was found and deleted, false otherwise
    • trySoftDeleteUser

      public boolean trySoftDeleteUser(String userId)
      Description copied from interface: UserUidDao
      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.
      Specified by:
      trySoftDeleteUser in interface UserUidDao
      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

      public ValidationHelper getValidationHelper()
    • setValidationHelper

      @Inject public void setValidationHelper(ValidationHelper validationHelper)
    • getMongoDBUtils

      public MongoDBUtils getMongoDBUtils()
    • setMongoDBUtils

      @Inject public void setMongoDBUtils(MongoDBUtils mongoDBUtils)
    • getDozerMapperRegistry

      public MapperRegistry getDozerMapperRegistry()
    • setDozerMapperRegistry

      @Inject public void setDozerMapperRegistry(MapperRegistry dozerMapperRegistry)
    • getMongoUserDao

      public MongoUserDao getMongoUserDao()
    • setMongoUserDao

      @Inject public void setMongoUserDao(MongoUserDao mongoUserDao)