Class EPersonServiceImpl

    • Field Detail

      • ePersonDAO

        @Autowired(required=true)
        protected EPersonDAO ePersonDAO
      • authorizeService

        @Autowired(required=true)
        protected AuthorizeService authorizeService
      • itemService

        @Autowired(required=true)
        protected ItemService itemService
      • subscribeService

        @Autowired(required=true)
        protected SubscribeService subscribeService
    • Constructor Detail

      • EPersonServiceImpl

        protected EPersonServiceImpl()
    • Method Detail

      • find

        public EPerson find​(Context context,
                            UUID id)
                     throws SQLException
        Description copied from interface: DSpaceObjectService
        Generic find for when the precise type of an Entity is not known
        Specified by:
        find in interface DSpaceObjectService<EPerson>
        Parameters:
        context - - the context
        id - - uuid within table of type'd dspace objects
        Returns:
        the dspace object found, or null if it does not exist.
        Throws:
        SQLException - only upon failure accessing the database.
      • findByEmail

        public EPerson findByEmail​(Context context,
                                   String email)
                            throws SQLException
        Description copied from interface: EPersonService
        Find the eperson by their email address.
        Specified by:
        findByEmail in interface EPersonService
        Parameters:
        context - The relevant DSpace Context.
        email - EPerson's email to search by
        Returns:
        EPerson, or null if none such exists.
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • findByNetid

        public EPerson findByNetid​(Context context,
                                   String netId)
                            throws SQLException
        Description copied from interface: EPersonService
        Find the eperson by their netid.
        Specified by:
        findByNetid in interface EPersonService
        Parameters:
        context - The relevant DSpace Context.
        netId - Network ID
        Returns:
        corresponding EPerson, or null
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • search

        public List<EPerson> search​(Context context,
                                    String query)
                             throws SQLException
        Description copied from interface: EPersonService
        Find the epeople that match the search query across firstname, lastname or email.
        Specified by:
        search in interface EPersonService
        Parameters:
        context - The relevant DSpace Context.
        query - The search string
        Returns:
        array of EPerson objects
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • search

        public List<EPerson> search​(Context context,
                                    String query,
                                    int offset,
                                    int limit)
                             throws SQLException
        Description copied from interface: EPersonService
        Find the epeople that match the search query across firstname, lastname or email. This method also allows offsets and limits for pagination purposes.
        Specified by:
        search in interface EPersonService
        Parameters:
        context - The relevant DSpace Context.
        query - The search string
        offset - Inclusive offset
        limit - Maximum number of matches returned
        Returns:
        array of EPerson objects
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • searchResultCount

        public int searchResultCount​(Context context,
                                     String query)
                              throws SQLException
        Description copied from interface: EPersonService
        Returns the total number of epeople returned by a specific query, without the overhead of creating the EPerson objects to store the results.
        Specified by:
        searchResultCount in interface EPersonService
        Parameters:
        context - The relevant DSpace Context.
        query - The search string
        Returns:
        the number of epeople matching the query
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • findAll

        public List<EPerson> findAll​(Context context,
                                     int sortField)
                              throws SQLException
        Specified by:
        findAll in interface EPersonService
        Parameters:
        context - The relevant DSpace Context.
        sortField - which field to sort EPersons by
        Returns:
        list of EPerson objects
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • findAll

        public List<EPerson> findAll​(Context context,
                                     int sortField,
                                     int pageSize,
                                     int offset)
                              throws SQLException
        Description copied from interface: EPersonService
        Find all the epeople in a specific order
        • ID
        • LASTNAME
        • EMAIL
        • NETID
        Specified by:
        findAll in interface EPersonService
        Parameters:
        context - The relevant DSpace Context.
        sortField - which field to sort EPersons by
        pageSize - how many results return
        offset - the position of the first result to return
        Returns:
        list of EPerson objects
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • setPassword

        public void setPassword​(EPerson ePerson,
                                String password)
        Description copied from interface: EPersonService
        Set the EPerson's password.
        Specified by:
        setPassword in interface EPersonService
        Parameters:
        ePerson - EPerson whose password we want to set.
        password - the new password.
      • setPasswordHash

        public void setPasswordHash​(EPerson ePerson,
                                    PasswordHash password)
        Description copied from interface: EPersonService
        Set the EPerson's password hash.
        Specified by:
        setPasswordHash in interface EPersonService
        Parameters:
        ePerson - EPerson whose password hash we want to set.
        password - hashed password, or null to set row data to NULL.
      • getPasswordHash

        public PasswordHash getPasswordHash​(EPerson ePerson)
        Description copied from interface: EPersonService
        Return the EPerson's password hash.
        Specified by:
        getPasswordHash in interface EPersonService
        Parameters:
        ePerson - EPerson whose password hash we want to get.
        Returns:
        hash of the password, or null on failure (such as no password).
      • checkPassword

        public boolean checkPassword​(Context context,
                                     EPerson ePerson,
                                     String attempt)
        Description copied from interface: EPersonService
        Check EPerson's password. Side effect: original unsalted MD5 hashes are converted using the current algorithm.
        Specified by:
        checkPassword in interface EPersonService
        Parameters:
        context - The relevant DSpace Context.
        ePerson - EPerson whose password we want to check
        attempt - the password attempt
        Returns:
        boolean successful/unsuccessful
      • getDeleteConstraints

        public List<String> getDeleteConstraints​(Context context,
                                                 EPerson ePerson)
                                          throws SQLException
        Description copied from interface: EPersonService
        Check for presence of EPerson in tables that have constraints on EPersons. Called by delete() to determine whether the eperson can actually be deleted. An EPerson cannot be deleted if it exists in the item, workflowitem, or tasklistitem tables.
        Specified by:
        getDeleteConstraints in interface EPersonService
        Parameters:
        context - The relevant DSpace Context.
        ePerson - EPerson to find
        Returns:
        List of tables that contain a reference to the eperson.
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • findByGroups

        public List<EPerson> findByGroups​(Context c,
                                          Set<Group> groups)
                                   throws SQLException
        Description copied from interface: EPersonService
        Retrieve all accounts which belong to at least one of the specified groups.
        Specified by:
        findByGroups in interface EPersonService
        Parameters:
        c - The relevant DSpace Context.
        groups - set of eperson groups
        Returns:
        a list of epeople
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • findEPeopleWithSubscription

        public List<EPerson> findEPeopleWithSubscription​(Context context)
                                                  throws SQLException
        Description copied from interface: EPersonService
        Retrieve all accounts which are subscribed to receive information about new items.
        Specified by:
        findEPeopleWithSubscription in interface EPersonService
        Parameters:
        context - The relevant DSpace Context.
        Returns:
        a list of epeople
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • setMetadata

        public void setMetadata​(Context context,
                                EPerson ePerson,
                                String field,
                                String value)
                         throws SQLException
        Description copied from interface: EPersonService
        Set a metadata value (in the metadatavalue table) of the metadata field specified by 'field'.
        Specified by:
        setMetadata in interface EPersonService
        Parameters:
        context - The relevant DSpace Context.
        ePerson - EPerson whose metadata we want to set.
        field - Metadata field we want to set (e.g. "phone").
        value - Metadata value we want to set
        Throws:
        SQLException - if the requested metadata field doesn't exist
      • findUnsalted

        public List<EPerson> findUnsalted​(Context context)
                                   throws SQLException
        Description copied from interface: EPersonService
        Retrieve all accounts which have a password but do not have a digest algorithm
        Specified by:
        findUnsalted in interface EPersonService
        Parameters:
        context - The relevant DSpace Context.
        Returns:
        a list of epeople
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • findNotActiveSince

        public List<EPerson> findNotActiveSince​(Context context,
                                                Date date)
                                         throws SQLException
        Description copied from interface: EPersonService
        Retrieve all accounts which have not logged in since the specified date
        Specified by:
        findNotActiveSince in interface EPersonService
        Parameters:
        context - The relevant DSpace Context.
        date - from which date
        Returns:
        a list of epeople
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • countTotal

        public int countTotal​(Context context)
                       throws SQLException
        Description copied from interface: EPersonService
        Count all accounts.
        Specified by:
        countTotal in interface EPersonService
        Parameters:
        context - The relevant DSpace Context.
        Returns:
        the total number of epeople
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.