199 lines
8.6 KiB
Java
199 lines
8.6 KiB
Java
package org.gcube.vomanagement.usermanagement;
|
|
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
import org.gcube.vomanagement.usermanagement.exception.GroupRetrievalFault;
|
|
import org.gcube.vomanagement.usermanagement.exception.RoleRetrievalFault;
|
|
import org.gcube.vomanagement.usermanagement.exception.UserManagementPortalException;
|
|
import org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException;
|
|
import org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault;
|
|
import org.gcube.vomanagement.usermanagement.model.GCubeMembershipRequest;
|
|
import org.gcube.vomanagement.usermanagement.model.GCubeRole;
|
|
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
|
|
import org.gcube.vomanagement.usermanagement.model.MembershipRequestStatus;
|
|
|
|
|
|
/**
|
|
*
|
|
*
|
|
* @author Massimiliano Assante, CNR-ISTI
|
|
*
|
|
*/
|
|
public interface UserManager {
|
|
/**
|
|
*
|
|
* @param username the username of the user you want
|
|
* @param email a valid email address
|
|
* @param firstName
|
|
* @param middleName
|
|
* @param lastName
|
|
* @param jobTitle
|
|
* @param backgroundSummary
|
|
* @param male
|
|
* @return an instance of the yet created user
|
|
* @throws UserManagementSystemException
|
|
*/
|
|
GCubeUser createUser(String username, String email, String firstName, String middleName, String lastName, String jobTitle, String backgroundSummary, boolean male, String reminderQuestion, String reminderAnswer) throws UserManagementSystemException;
|
|
/**
|
|
*
|
|
* @param username the username of the user you want to get
|
|
* @return the instance of the user
|
|
* @throws UserManagementSystemException
|
|
* @throws UserRetrievalFault
|
|
*/
|
|
GCubeUser getUserByUsername(String username) throws UserManagementSystemException, UserRetrievalFault;
|
|
/**
|
|
*
|
|
* @param username the email of the user you want to get
|
|
* @return the instance of the user
|
|
* @throws UserManagementSystemException
|
|
* @throws UserRetrievalFault
|
|
*/
|
|
GCubeUser getUserByEmail(String email) throws UserManagementSystemException, UserRetrievalFault;
|
|
/**
|
|
*
|
|
* @param userId the LR UserId
|
|
* @return the instance of the user
|
|
* @throws UserManagementSystemException
|
|
* @throws UserRetrievalFault
|
|
*/
|
|
GCubeUser getUserById(long userId) throws UserManagementSystemException, UserRetrievalFault;
|
|
/**
|
|
*
|
|
* @param username the LR screenname
|
|
* @return the LR userId associated to this screenname
|
|
* @throws UserManagementSystemException
|
|
* @throws UserRetrievalFault
|
|
*/
|
|
long getUserId(String username) throws UserManagementSystemException, UserRetrievalFault;
|
|
/**
|
|
*
|
|
* @return a list of all portal active users no matter if the belong or not to a VRE, if a user is deactived is not returned
|
|
* @throws UserManagementSystemException
|
|
*/
|
|
List<GCubeUser> listUsers() throws UserManagementSystemException;
|
|
/**
|
|
*
|
|
* @param groupId the LR groupId
|
|
* @return
|
|
* @throws UserManagementSystemException
|
|
* @throws GroupRetrievalFault
|
|
* @throws UserRetrievalFault
|
|
*/
|
|
List<GCubeUser> listUsersByGroup(long groupId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault;
|
|
/**
|
|
*
|
|
* @param the name of the VO or VRE (e.g. devVRE, or gcube etc.)
|
|
* @return
|
|
* @throws UserManagementSystemException
|
|
* @throws GroupRetrievalFault
|
|
* @throws UserRetrievalFault
|
|
*/
|
|
List<GCubeUser> listUsersByGroupName(String name) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault;
|
|
/**
|
|
*
|
|
* @param groupId the LR groupId
|
|
* @return the list of {@link GCubeMembershipRequest} with their status and users given the LR GroupId (status can be requested, approved or rejected, @see {@link MembershipRequestStatus}
|
|
* @throws UserManagementSystemException
|
|
* @throws GroupRetrievalFault
|
|
* @throws UserRetrievalFault
|
|
*/
|
|
List<GCubeMembershipRequest> listMembershipRequestsByGroup(long groupId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault;
|
|
/**
|
|
*
|
|
* @param requestId
|
|
* @return an istance of {@link GCubeMembershipRequest}
|
|
*/
|
|
GCubeMembershipRequest getMembershipRequestsById(long membershipRequestId);
|
|
/**
|
|
*
|
|
* @param userId the LR userid
|
|
* @param groupId the LR groupId the
|
|
* @param status an istance of {@link MembershipRequestStatus}
|
|
* @return the list of {@link GCubeMembershipRequest} with their status and users given the LR GroupId and userId (status can be requested, approved or rejected, @see {@link MembershipRequestStatus}
|
|
*/
|
|
List<GCubeMembershipRequest> getMembershipRequests(long userId, long groupId, MembershipRequestStatus status) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault;
|
|
/**
|
|
* request the membership to a restricted Site, no further actions are performed (no emails are sent, nor notifications)
|
|
* @param userId the LR userid
|
|
* @param groupId the LR groupId the
|
|
* @param comment a comment to the request must not be null
|
|
* @throws UserManagementSystemException
|
|
* @throws GroupRetrievalFault
|
|
* @throws UserRetrievalFault
|
|
*/
|
|
GCubeMembershipRequest requestMembership(long userId, long groupId, String comment) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault;
|
|
/**
|
|
* accept a membership request and optionally add the user to the group
|
|
* @param requestUserId the LR userid of the request
|
|
* @param groupId the LR groupId
|
|
* @param addUserToGroup if you want it to also add the user to the group
|
|
* @param String the username (screenname) of the user accepting the request
|
|
* @param replyComment a comment attachd to the reply (must not be null)
|
|
* @throws UserManagementSystemException
|
|
* @throws GroupRetrievalFault
|
|
* @throws UserManagementPortalException
|
|
*/
|
|
GCubeMembershipRequest acceptMembershipRequest(long requestUserId,long groupId, boolean addUserToGroup, String replyUsername, String replyComment) throws UserManagementSystemException, GroupRetrievalFault, UserManagementPortalException;
|
|
/**
|
|
* rejects a membership request
|
|
* @param requestUserId the LR userid of the request
|
|
* @param groupId the LR groupId
|
|
* @param String the username (screenname) of the user accepting the request
|
|
* @param replyComment a comment attachd to the reply (must not be null)
|
|
* @throws UserManagementSystemException
|
|
* @throws GroupRetrievalFault
|
|
* @throws UserManagementPortalException
|
|
*/
|
|
GCubeMembershipRequest rejectMembershipRequest(long userId, long groupId, String replyUsername, String replyComment) throws UserManagementSystemException, GroupRetrievalFault, UserManagementPortalException;
|
|
/**
|
|
*
|
|
* @param groupId the LR groupId
|
|
* @return the list of {@link GCubeUser} with their GCubeRole given the LR GroupId
|
|
* @throws GroupRetrievalFault
|
|
* @throws UserManagementSystemException
|
|
* @throws UserRetrievalFault
|
|
*/
|
|
Map<GCubeUser, List<GCubeRole>> listUsersAndRolesByGroup(long groupId) throws GroupRetrievalFault, UserManagementSystemException, UserRetrievalFault ;
|
|
/**
|
|
*
|
|
* @param groupId the LR groupId
|
|
* @parmam roleId the LR roleId
|
|
* @return the list of {@link GCubeUser} having group and role that matches
|
|
* @throws GroupRetrievalFault
|
|
* @throws UserManagementSystemException
|
|
* @throws UserRetrievalFault
|
|
*/
|
|
List<GCubeUser> listUsersByGroupAndRole(long groupId, long roleId) throws UserManagementSystemException, RoleRetrievalFault, GroupRetrievalFault, UserRetrievalFault;
|
|
/**
|
|
* this method assigns the user to the Group and perform other necessary actions (such as adding him to the HL Folder)
|
|
* @param groupId LR groupId
|
|
* @param userId LR userId
|
|
* @throws UserManagementSystemException
|
|
* @throws GroupRetrievalFault
|
|
* @throws UserRetrievalFault
|
|
* @throws UserManagementPortalException
|
|
*/
|
|
void assignUserToGroup(long groupId, long userId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault, UserManagementPortalException;
|
|
/**
|
|
* this method removes the user to the Group and perform other necessary actions (such as removing him from the HL Folder)
|
|
* @param groupId LR groupId
|
|
* @param userId LR userId
|
|
* @throws UserManagementSystemException
|
|
* @throws GroupRetrievalFault
|
|
* @throws UserRetrievalFault
|
|
* @throws UserManagementPortalException
|
|
*/
|
|
void dismissUserFromGroup(long groupId, long userId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault;
|
|
/**
|
|
*
|
|
* @param groupId LR groupId
|
|
* @return all the users of the portal not belonging to the groupId
|
|
* @throws UserManagementSystemException
|
|
* @throws GroupRetrievalFault
|
|
* @throws UserRetrievalFault
|
|
*/
|
|
List<GCubeUser> listUnregisteredUsersByGroup(long groupId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault;
|
|
}
|