Class UserAccessorImpl

java.lang.Object
step.core.accessors.AbstractAccessor<User>
step.core.access.UserAccessorImpl
All Implemented Interfaces:
UserAccessor, step.core.accessors.Accessor<User>
Direct Known Subclasses:
InMemoryUserAccessor

public class UserAccessorImpl extends step.core.accessors.AbstractAccessor<User> implements UserAccessor
  • Field Summary

    Fields inherited from class step.core.accessors.AbstractAccessor

    collectionDriver, newVersionThresholdMs, versionedCollectionDriver
  • Constructor Summary

    Constructors
    Constructor
    Description
    UserAccessorImpl(step.core.collections.Collection<User> collectionDriver)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
     
     
     
    void
    Register hooks to be executed after removing a User, thrown exception don't stop the execution of next hooks
    void
    Register hooks to be executed before saving a User, any thrown exception will abort saving the user
    void
    remove(String username)
     
    void
    remove(org.bson.types.ObjectId id)
     
    void
    save(Iterable<User> entities)
     
    save(User user)
     

    Methods inherited from class step.core.accessors.AbstractAccessor

    createOrUpdateCompoundIndex, createOrUpdateIndex, enableVersioning, findByAttributes, findByAttributes, findByCriteria, findManyByAttributes, findManyByAttributes, findManyByCriteria, get, get, getAll, getCollectionDriver, getHistory, getRange, isVersioningEnabled, restoreVersion, stream, streamLazy

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface step.core.accessors.Accessor

    enableVersioning, findByAttributes, findByAttributes, findByCriteria, findManyByAttributes, findManyByAttributes, findManyByCriteria, get, get, getAll, getCollectionDriver, getHistory, getRange, isVersioningEnabled, restoreVersion, stream, streamLazy
  • Constructor Details

    • UserAccessorImpl

      public UserAccessorImpl(step.core.collections.Collection<User> collectionDriver)
  • Method Details

    • remove

      public void remove(String username)
      Specified by:
      remove in interface UserAccessor
    • remove

      public void remove(org.bson.types.ObjectId id)
      Specified by:
      remove in interface step.core.accessors.Accessor<User>
      Overrides:
      remove in class step.core.accessors.AbstractAccessor<User>
    • save

      public User save(User user)
      Specified by:
      save in interface step.core.accessors.Accessor<User>
      Overrides:
      save in class step.core.accessors.AbstractAccessor<User>
    • save

      public void save(Iterable<User> entities)
      Specified by:
      save in interface step.core.accessors.Accessor<User>
      Overrides:
      save in class step.core.accessors.AbstractAccessor<User>
    • getAllUsers

      public List<User> getAllUsers()
      Specified by:
      getAllUsers in interface UserAccessor
    • getByUsername

      public User getByUsername(String username)
      Specified by:
      getByUsername in interface UserAccessor
    • registerOnSaveHook

      public void registerOnSaveHook(Function<User,Void> f)
      Description copied from interface: UserAccessor
      Register hooks to be executed before saving a User, any thrown exception will abort saving the user
      Specified by:
      registerOnSaveHook in interface UserAccessor
      Parameters:
      f - the function to execute
    • registerOnRemoveHook

      public void registerOnRemoveHook(Function<User,Void> f)
      Description copied from interface: UserAccessor
      Register hooks to be executed after removing a User, thrown exception don't stop the execution of next hooks
      Specified by:
      registerOnRemoveHook in interface UserAccessor
      Parameters:
      f - the function to execute
    • encryptPwd

      public static String encryptPwd(String pwd)