Interface DuracloudUserService

  • All Known Implementing Classes:
    DuracloudUserServiceImpl

    public interface DuracloudUserService
    This interface defines the contract for loading, storing, and managing DuracloudUser entities.
    Author:
    Andrew Woods Date: Oct 8, 2010
    • Method Detail

      • setUserRights

        @Secured("role:ROLE_ADMIN, scope:SELF_ACCT_PEER_UPDATE")
        boolean setUserRights​(Long acctId,
                              Long userId,
                              org.duracloud.account.db.model.Role... roles)
        This method sets the roles of a user in an account.

        Note that this method only sets a user to new roles. To remove a user from an account, use revokeAllRights().

        Returns:
        true if an update was performed.
      • addUserToAccount

        @Secured("role:ROLE_ADMIN, scope:SELF_ACCT")
        boolean addUserToAccount​(Long acctId,
                                 Long userId)
                          throws DBNotFoundException
        This method sets the roles of a user in an account.

        Note that this method only sets a user to new roles. To remove a user from an account, use revokeAllRights().

        Returns:
        true if an update was performed.
        Throws:
        DBNotFoundException
      • revokeUserRights

        @Secured("role:ROLE_ADMIN, scope:SELF_ACCT_PEER")
        void revokeUserRights​(Long acctId,
                              Long userId)
        This method removes all rights to an account for a given user.
        Parameters:
        acctId - on which rights will be revoked
        userId - of user whose rights will be revoked
      • changePassword

        @Secured("role:ROLE_USER, scope:SELF_ID")
        void changePassword​(Long userId,
                            String oldPassword,
                            boolean oldPasswordEncoded,
                            String newPassword)
                     throws DBNotFoundException,
                            InvalidPasswordException
        This method changes the password of the user with the arg userId from the oldPassword to the newPassword.
        Parameters:
        userId - of user who is seeking a password change
        oldPassword -
        oldPasswordEncoded - flag noting if the password is hashed
        newPassword -
        Throws:
        InvalidPasswordException
        DBNotFoundException
      • retrievePassordChangeInvitation

        @Secured("role:ROLE_ANONYMOUS, scope:ANY")
        org.duracloud.account.db.model.UserInvitation retrievePassordChangeInvitation​(String redemptionCode)
                                                                               throws DBNotFoundException
        Returns a user password change invitation
        Parameters:
        redemptionCode -
        Returns:
        Throws:
        DBNotFoundException
      • loadDuracloudUserByUsername

        @Secured("role:ROLE_USER, scope:SELF_NAME")
        org.duracloud.account.db.model.DuracloudUser loadDuracloudUserByUsername​(String username)
                                                                          throws DBNotFoundException
        This method loads a DuracloudUser from the persistence layer and populate its rights info.
        Parameters:
        username - of user to load
        Returns:
        DuracloudUser
        Throws:
        DBNotFoundException
      • loadDuracloudUserByUsernameInternal

        @Secured("role:ROLE_ANONYMOUS, scope:ANY")
        org.duracloud.account.db.model.DuracloudUser loadDuracloudUserByUsernameInternal​(String username)
                                                                                  throws DBNotFoundException
        Throws:
        DBNotFoundException
      • loadDuracloudUserByIdInternal

        @Secured("role:ROLE_USER, scope:ANY")
        org.duracloud.account.db.model.DuracloudUser loadDuracloudUserByIdInternal​(Long userId)
                                                                            throws DBNotFoundException
        Throws:
        DBNotFoundException
      • redeemAccountInvitation

        @Secured("role:ROLE_USER, scope:SELF_ID")
        Long redeemAccountInvitation​(Long userId,
                                     String redemptionCode)
                              throws InvalidRedemptionCodeException
        This method redeems an invitation to add this user to a DuraCloud account.
        Parameters:
        userId - the id of the user which will be added to the account indicated in the invitation
        redemptionCode - code which was sent to the user as part of the invitation to become part of an account
        Returns:
        the account id associated with the newly redeemed invitation.
        Throws:
        InvalidRedemptionCodeException
      • storeUserDetails

        @Secured("role:ROLE_USER, scope:SELF_ID")
        void storeUserDetails​(Long userId,
                              String firstName,
                              String lastName,
                              String email,
                              String securityQuestion,
                              String securityAnswer,
                              String allowableIPAddressRange)
                       throws DBNotFoundException
        This method persists the arg user details.
        Parameters:
        userId - of user
        firstName - of user
        lastName - of user
        email - of user
        securityQuestion - of user
        securityAnswer - of user
        allowableIPAddressRange -
        Throws:
        DBNotFoundException