com.sas.drugdev.remote.admin
Interface UserService


public interface UserService

The UserService provides a way to create and manage users in SDD. The intention for this service is to provide programmatic administration of users. Users can be created and updated given the user accessing this service has the approriate policy to manage users. Users can be created in SDD as well as created to authenticate against an external authentication provider. Note that once a user is created, that user must manually consent via the SDD user interface before they can successfully call other methods on the API.


Method Summary
 boolean canManage()
          Tests if the current user can manage user accounts on this SDD instance by verifying they have the User Manager policy.
 void changePassword(char[] currentPassword, char[] newPassword)
          Change the current user's password.
 RemoteUser create(UserBean userBean)
          Create the user described by the given UserBean.
 boolean exists(java.lang.String userId)
          Tests if the user with the specified userId exists
 RemoteUser get(java.lang.String userId)
          Get the user with the specified userId.
 java.util.List getAll()
          Gets a list of all users defined in SDD including active, inactive, and retired users.
 java.util.Date getPasswordExpirationDate()
          Get the date that the current user's password will expire.
 java.util.List getUsersWithPolicy(Policy policy)
          Gets a list of all users with the given policy
 RemoteUser update(UserBean userBean)
          Apply the changes that have been made on the given User on the server side.
 

Method Detail

canManage

boolean canManage()
                  throws RemoteException,
                         InvalidSessionException
Tests if the current user can manage user accounts on this SDD instance by verifying they have the User Manager policy.

Returns:
true if the current user can manage user accounts on this SDD instance, otherwise false
Throws:
RemoteException - if a server or transport error occurs
InvalidSessionException - if the current session is expired or has been invalidated

get

RemoteUser get(java.lang.String userId)
               throws InsufficientPrivilegesException,
                      RemoteException,
                      InvalidSessionException
Get the user with the specified userId. Returns null if the user does not exist.

Parameters:
userId - of the user
Returns:
The RemoteUser identified by the userId, null if the RemoteFile doesn't exist.
Throws:
InsufficientPrivilegesException - if the current user does not have the Policy to manage users
RemoteException - if a server or transport error occurs
InvalidSessionException - if the current session is expired or has been invalidated

getAll

java.util.List getAll()
                      throws InsufficientPrivilegesException,
                             RemoteException,
                             InvalidSessionException
Gets a list of all users defined in SDD including active, inactive, and retired users.

Returns:
Unmodifiable list of RemoteUser objects
Throws:
InsufficientPrivilegesException - if the current user does not have the Policy to manage users
RemoteException - if a server or transport error occurs
InvalidSessionException - if the current session is expired or has been invalidated

update

RemoteUser update(UserBean userBean)
                  throws ObjectModifiedException,
                         PropertyValidationException,
                         InvalidUserException,
                         InsufficientPrivilegesException,
                         RemoteException,
                         InvalidSessionException
Apply the changes that have been made on the given User on the server side.

Parameters:
userBean -
Returns:
the updated RemoteUser
Throws:
ObjectModifiedException - if the UserBean was constructed with a RemoteUser and the user has been modified since it was retrieved
PropertyValidationException - if any properties set on the user fail validation
InvalidUserException - if the user doesn't exist or user is retired
InsufficientPrivilegesException - if the current user does not have the Policy to manage users
RemoteException - if a server or transport error occurs
InvalidSessionException - if the current session is expired or has been invalidated

exists

boolean exists(java.lang.String userId)
               throws InsufficientPrivilegesException,
                      RemoteException,
                      InvalidSessionException
Tests if the user with the specified userId exists

Parameters:
userId - of the user
Returns:
true if the user exists, otherwise false
Throws:
InsufficientPrivilegesException - if the current user does not have the Policy to manage users
RemoteException - if a server or transport error occurs
InvalidSessionException - if the current session is expired or has been invalidated

create

RemoteUser create(UserBean userBean)
                  throws PropertyValidationException,
                         InvalidUserException,
                         InvalidSessionException,
                         InsufficientPrivilegesException,
                         RemoteException
Create the user described by the given UserBean. The UserBean must have a valid, non-null value for these required properties: userId, password, firstname, lastname, and email. No default policies are provided. Policies must be set explicitly on the UserBean. Once a user is created, that user must manually consent via the SDD user interface before they can successfully call other methods on the api

Parameters:
userBean -
Returns:
RemoteUser that was created
Throws:
PropertyValidationException - if any properties set on the user fail validation
InvalidUserException - if the user already exists
InsufficientPrivilegesException - if the current user does not have the Policy to manage users
RemoteException - if a server or transport error occurs
InvalidSessionException - if the current session is expired or has been invalidated

getPasswordExpirationDate

java.util.Date getPasswordExpirationDate()
                                         throws RemoteException,
                                                InvalidSessionException
Get the date that the current user's password will expire. This does not require the policy to manage users.

Returns:
Date on which the password will expire.
Throws:
RemoteException - if a server or transport error occurs
InvalidSessionException - if the current session is expired or has been invalidated

changePassword

void changePassword(char[] currentPassword,
                    char[] newPassword)
                    throws InvalidPasswordException,
                           RemoteException,
                           InvalidSessionException
Change the current user's password. This does not require the policy to manage users.

Parameters:
currentPassword - current password of the current user
newPassword - new password for the current user
Throws:
RemoteException - if a server or transport error occurs
InvalidSessionException - if the current session is expired or has been invalidated
InvalidPasswordException - if the current password is expired or is not valid

getUsersWithPolicy

java.util.List getUsersWithPolicy(Policy policy)
                                  throws PropertyValidationException,
                                         InsufficientPrivilegesException,
                                         RemoteException,
                                         InvalidSessionException
Gets a list of all users with the given policy

Parameters:
policy - the policy to check for
Returns:
Throws:
PropertyValidationException
InsufficientPrivilegesException
RemoteException
InvalidSessionException