Class SampleUserDirectoryProvider

    • Constructor Detail

      • SampleUserDirectoryProvider

        public SampleUserDirectoryProvider()
        Construct.
    • Method Detail

      • setCourseStudents

        public void setCourseStudents​(String count)
        Set how many students to recognize.
        Parameters:
        count - How many students to recognize.
      • setValueEncryptionUtilities

        public void setValueEncryptionUtilities​(ValueEncryptionUtilities encryptionUtilities)
      • init

        public void init()
        Final initialization, once all dependencies are set.
      • destroy

        public void destroy()
        Returns to uninitialized state. You can use this method to release resources thet your Service allocated when Turbine shuts down.
      • userExists

        protected boolean userExists​(String userId)
        See if a user by this id exists.
        Parameters:
        userId - The user id string.
        Returns:
        true if a user by this id exists, false if not.
      • getUser

        public boolean getUser​(UserEdit edit)
        Access a user object. Update the object with the information found.
        Specified by:
        getUser in interface UserDirectoryProvider
        Parameters:
        edit - The user object (id is set) to fill in.
        Returns:
        true if the user object was found and information updated, false if not.
      • getUsers

        public void getUsers​(Collection<UserEdit> users)
        Access a collection of UserEdit objects; if the user is found, update the information, otherwise remove the UserEdit object from the collection.
        Specified by:
        getUsers in interface UserDirectoryProvider
        Parameters:
        users - The UserEdit objects (with id set) to fill in or remove.
      • findUserByEmail

        public boolean findUserByEmail​(UserEdit edit,
                                       String email)
        Find a user object who has this email address. Update the object with the information found.
        Note: this method won't be used, because we are a UsersShareEmailUPD.
        This is the sort of method to provide if your external source has only a single user for any email address.
        Specified by:
        findUserByEmail in interface UserDirectoryProvider
        Parameters:
        email - The email address string.
        Returns:
        true if the user object was found and information updated, false if not.
      • findUsersByEmail

        public Collection<UserEdit> findUsersByEmail​(String email,
                                                     UserFactory factory)
        Find all user objects which have this email address.
        Specified by:
        findUsersByEmail in interface UsersShareEmailUDP
        Parameters:
        email - The email address string.
        factory - Use this factory's newUser() method to create all the UserEdit objects you populate and return in the return collection.
        Returns:
        Collection (UserEdit) of user objects that have this email address, or an empty Collection if there are none.
      • authenticateUser

        public boolean authenticateUser​(String userId,
                                        UserEdit edit,
                                        String password)
        Authenticate a user / password. If the user edit exists it may be modified, and will be stored if...
        Specified by:
        authenticateUser in interface UserDirectoryProvider
        Parameters:
        id - The user id.
        edit - The UserEdit matching the id to be authenticated (and updated) if we have one.
        password - The password.
        Returns:
        true if authenticated, false if not.
      • createUserRecord

        public boolean createUserRecord​(String id)