usermanagement-core/src/main/java/org/gcube/vomanagement/usermanagement/UserManager.java

96 lines
4.5 KiB
Java
Raw Normal View History

package org.gcube.vomanagement.usermanagement;
import java.util.HashMap;
import java.util.List;
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.GroupModel;
import org.gcube.vomanagement.usermanagement.model.RoleModel;
import org.gcube.vomanagement.usermanagement.model.UserModel;
/**
*
*
* @author Massimiliano Assante, CNR-ISTI
*
*/
public interface UserManager {
/**
*
* @param username the username of the user you want to get
* @return the instance of the user
* @throws UserManagementSystemException
* @throws UserRetrievalFault
*/
UserModel 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
*/
UserModel getUserByEmail(String email) 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<UserModel> listUsers() throws UserManagementSystemException;
/**
*
* @param groupId the LR groupId
* @return
* @throws UserManagementSystemException
* @throws GroupRetrievalFault
* @throws UserRetrievalFault
*/
List<UserModel> 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<UserModel> listUsersByGroupName(String name) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault;
List<UserModel> listPendingUsersByGroup(String groupId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault;
String getMembershipRequestComment(String userId, String groupId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault;
HashMap<UserModel, List<RoleModel>> listUsersAndRolesByGroup(String groupId) throws GroupRetrievalFault, UserManagementSystemException, UserRetrievalFault ;
HashMap<UserModel, List<GroupModel>> listUsersAndGroupsByRole(String roleId) throws UserManagementSystemException, RoleRetrievalFault, UserRetrievalFault ;
List<UserModel> listUsersByGroupAndRole(String groupId, String roleId) throws UserManagementSystemException, RoleRetrievalFault, GroupRetrievalFault, UserRetrievalFault;
void assignUserToGroup(String groupId, String userId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault, UserManagementPortalException;
void dismissUserFromGroup(String groupId, String userId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault;
void requestMembership(String userId, String groupId, String comment) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault;
List<UserModel> listUnregisteredUsersByGroup(String groupId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault;
Long getUserId(String screenName) throws UserManagementSystemException;
List<UserModel> getMembershipRequests(String groupId) throws UserManagementSystemException,GroupRetrievalFault, UserRetrievalFault;
HashMap<String, String> getUserCustomAttributes(String userId) throws UserManagementSystemException, UserRetrievalFault;
void setUserCustomAttributes(String userId, HashMap<String,String> hMap) throws UserManagementSystemException, UserRetrievalFault, UserManagementPortalException;
String getUserCustomAttributeByName(String userId, String attrName)throws UserManagementSystemException, UserRetrievalFault;
void setUserCustomAttributeByName(String userId, String attrName, String attrValue) throws UserManagementSystemException, UserRetrievalFault, UserManagementPortalException;
void denyMembershipRequest(String userId,String groupId)throws UserManagementSystemException, GroupRetrievalFault, UserManagementPortalException;
}