com.sas.drugdev.remote.admin
Interface GroupService


public interface GroupService

GroupService provides an interface which may be used to remotely to access server methods to manage groups. Most interactions are done with Group objects. These can be either RemoteGroup or GroupBean.
A RemoteGroup is constructed by the service when information about a Group is retrieved from the server. This type of Group is immutable.
A GroupBean is constructed on the client by the consumer of the API. It is used to describe a server-side Group that you would like to update or create.


Method Summary
 boolean canManage()
          Tests whether the current user can manage groups on this SDD instance as determined by their policies
 RemoteGroup create(GroupBean groupBean)
          Creates a new group on the server as described by the GroupBean
 void delete(Group group)
          Deletes the specified group from the server as determined by the Group
 boolean exists(GroupBean groupBean)
          Tests whether the specified group exists on the server
 RemoteGroup get(GroupBean groupBean)
          Retrieves a group from the server as described by the GroupBean.
 java.util.List getAll()
          Returns all the Group objects currently available on the server
 java.util.List getUserGroups(User user)
          Gets all the groups that a given user is in
 boolean isUserInGroup(User user, Group group)
          Tests whether the specified User is in the given Group
 RemoteGroup update(GroupBean groupBean)
          Updates the group on the server with the parameters of the provided GroupBean.
 

Method Detail

canManage

boolean canManage()
                  throws InvalidSessionException,
                         RemoteException
Tests whether the current user can manage groups on this SDD instance as determined by their policies

Returns:
boolean of whether the current user can manage groups on this SDD instance
Throws:
RemoteException - if a server or transport error occurs
InvalidSessionException - if a session has expired

create

RemoteGroup create(GroupBean groupBean)
                   throws InvalidSessionException,
                          InsufficientPrivilegesException,
                          InvalidGroupException,
                          InvalidUserException,
                          RemoteException,
                          InvalidGroupBeanException
Creates a new group on the server as described by the GroupBean

Parameters:
groupBean - The GroupBean to be created on the server
Returns:
the RemoteGroup that has just been created on the server
Throws:
InvalidSessionException - if a session has expired
InsufficientPrivilegesException - if the user does not have the policy to manage groups
InvalidGroupException - if the group to be created does not meet group/description naming criteria
InvalidUserException - if the group has invalid members
RemoteException - if a server or transport error occurs
InvalidGroupBeanException - if the GroupBean is missing a required value

get

RemoteGroup get(GroupBean groupBean)
                throws InvalidSessionException,
                       InsufficientPrivilegesException,
                       InvalidGroupException,
                       RemoteException,
                       InvalidGroupBeanException
Retrieves a group from the server as described by the GroupBean. The name property of the group is used to find the appropriate Group on the server

Parameters:
groupBean - The GroupBean to get from the server
Returns:
a RemoteGroup from the server that matches the passed in GroupBean
Throws:
InvalidSessionException - if a session has expired
InsufficientPrivilegesException - if the user does not have the policy to manage groups
RemoteException - if a server or transport error occurs
InvalidGroupException - if the group does not exist
InvalidGroupBeanException - if the GroupBean is missing a required value

update

RemoteGroup update(GroupBean groupBean)
                   throws InvalidSessionException,
                          InsufficientPrivilegesException,
                          InvalidGroupException,
                          InvalidUserException,
                          RemoteException,
                          ObjectModifiedException,
                          InvalidGroupBeanException
Updates the group on the server with the parameters of the provided GroupBean. The name property of the group is used to match to the appropriate Group on the server.

Parameters:
groupBean - The GroupBean to update on the server
Returns:
the RemoteGroup that has just been updated on the server
Throws:
InvalidSessionException - if a session has expired
InsufficientPrivilegesException - if the user does not have the policy to manage groups
InvalidGroupException - if the group to be updated does not meet group/description naming criteria
InvalidUserException - if the group has invalid members
RemoteException - if a server or transport error occurs
ObjectModifiedException - if the group was modified on the server while the user was editing it
InvalidGroupBeanException - if the GroupBean is missing a required value

delete

void delete(Group group)
            throws InvalidSessionException,
                   InsufficientPrivilegesException,
                   InvalidGroupException,
                   RemoteException
Deletes the specified group from the server as determined by the Group

Parameters:
group - The Group to delete on the server
Throws:
InvalidSessionException - if a session has expired
InsufficientPrivilegesException - if the user does not have the policy to manage groups
InvalidGroupException - if the group does not exist.
RemoteException - if a server or transport error occurs

getAll

java.util.List getAll()
                      throws InvalidSessionException,
                             InsufficientPrivilegesException,
                             RemoteException
Returns all the Group objects currently available on the server

Returns:
a List of all the groups currently in the system
Throws:
InvalidSessionException - if a session has expired
InsufficientPrivilegesException - if the user does not have the policy to manage groups
RemoteException - if a server or transport error occurs

exists

boolean exists(GroupBean groupBean)
               throws InvalidSessionException,
                      InsufficientPrivilegesException,
                      RemoteException,
                      InvalidGroupBeanException
Tests whether the specified group exists on the server

Parameters:
groupBean - The GroupBean to test for
Returns:
true if the group exists; false otherwise
Throws:
InvalidSessionException - if a session has expired
InsufficientPrivilegesException - if the user does not have the policy to manage groups
RemoteException - if a server or transport error occurs
InvalidGroupBeanException - if the GroupBean is missing a required value

isUserInGroup

boolean isUserInGroup(User user,
                      Group group)
                      throws InvalidSessionException,
                             InsufficientPrivilegesException,
                             RemoteException,
                             InvalidGroupException,
                             InvalidUserException
Tests whether the specified User is in the given Group

Parameters:
user - The user to test
group - The group to check if the user is in
Returns:
true if the user is in the group; false otherwise
Throws:
InvalidSessionException - if a session has expired
InsufficientPrivilegesException - if the user does not have the policy to manage groups
RemoteException - if a server or transport error occurs
InvalidGroupException - if the specified group doesn't exist
InvalidUserException - if the specified user doesn't exist

getUserGroups

java.util.List getUserGroups(User user)
                             throws InvalidSessionException,
                                    InsufficientPrivilegesException,
                                    RemoteException,
                                    InvalidUserException
Gets all the groups that a given user is in

Parameters:
user - the user to search for
Returns:
List of Groups that contain the user
Throws:
InvalidSessionException - if the session is invalid
InsufficientPrivilegesException - if the user doesn't have the policy to manage groups
RemoteException - if a server or transport error occurs
InvalidUserException - if the specified user doesn't exist