org.gcube.portlets.admin.usersmanagementportlet.gwt.server
Class UsersManagementServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
              extended by com.google.gwt.user.server.rpc.RemoteServiceServlet
                  extended by org.gcube.portlets.admin.usersmanagementportlet.gwt.server.UsersManagementServlet
All Implemented Interfaces:
com.google.gwt.user.client.rpc.RemoteService, com.google.gwt.user.server.rpc.SerializationPolicyProvider, Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, UsersManagementService

public class UsersManagementServlet
extends com.google.gwt.user.server.rpc.RemoteServiceServlet
implements UsersManagementService

UsersManagement servlet

Author:
Panagiota Koltsida, NKUA
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
perThreadRequest, perThreadResponse
 
Constructor Summary
UsersManagementServlet()
          Class constructor
 
Method Summary
 Boolean addNewUsersToVO(ArrayList<String> users)
          This method is invoked to add new Users to a VO.
 Boolean addUsersToVO(ArrayList<String> users)
          Add users to the current VO
 Boolean denyRequests(String[] users, boolean sendCustomMailToRejectedUsers)
          Denies a list of requests from users for registration
 ArrayList<UserInfo> getAllRegisteredUsers()
          Returns all the users that are registered in VOMS.
 String[] getAvailableRolesByCurrentGroup()
          Returns the available roles of the current VO
 Integer getNumberOfUserThatReceiveNots()
           
 ArrayList<UserInfo> getRegisteredUsersForaVO()
          Returns all the users and their roles that are registered to the current VO
 ArrayList<UserInfo> getUnregisteredUsersForVO()
          Retrieves all the users that are registered to portal but are not registered to the current VO
 ArrayList<UserInfo> getUsersRequests()
          This method returns a hash map with key the username of the new user and value an array list with all the roles that this user requests
 Boolean removeUsersFromVO(String[] users)
          Removes the users with the given username from the current VO
 void sendEmail(ArrayList<String> emails, String subject, String body)
          Sends an email with the given subject and body to all registered users of the current VO/VRE
 void sendEmailToRegisteredUsers(String subject, String body)
          Sends an email with the given subject and body to all registered users of the current VO/VRE
 void sendEmailWithErrorToSupport(Throwable caught)
           
 String updateUserRoles(String username, String[][] rolesAndValues)
          Update the user's roles
 
Methods inherited from class com.google.gwt.user.server.rpc.RemoteServiceServlet
checkPermutationStrongName, doGetSerializationPolicy, getSerializationPolicy, onAfterResponseSerialized, onBeforeRequestDeserialized, processCall, processPost, shouldCompressResponse
 
Methods inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
doPost, doUnexpectedFailure, getPermutationStrongName, getThreadLocalRequest, getThreadLocalResponse, onAfterRequestDeserialized, readContent
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UsersManagementServlet

public UsersManagementServlet()
Class constructor

Method Detail

getAvailableRolesByCurrentGroup

public String[] getAvailableRolesByCurrentGroup()
Returns the available roles of the current VO

Specified by:
getAvailableRolesByCurrentGroup in interface UsersManagementService
Returns:
An array with the available roles

getAllRegisteredUsers

public ArrayList<UserInfo> getAllRegisteredUsers()
Returns all the users that are registered in VOMS. These users may not be registered in any VO/VRE

Specified by:
getAllRegisteredUsers in interface UsersManagementService
Returns:
A list with the users that are registered to portal independent of the VOs and VREs

getUnregisteredUsersForVO

public ArrayList<UserInfo> getUnregisteredUsersForVO()
Retrieves all the users that are registered to portal but are not registered to the current VO

Specified by:
getUnregisteredUsersForVO in interface UsersManagementService
Returns:
A list with the username of the unregistered users

getRegisteredUsersForaVO

public ArrayList<UserInfo> getRegisteredUsersForaVO()
Returns all the users and their roles that are registered to the current VO

Specified by:
getRegisteredUsersForaVO in interface UsersManagementService
Returns:
A Hash map that contains the registered users and the roles that each user has, or null

removeUsersFromVO

public Boolean removeUsersFromVO(String[] users)
                          throws CurrentGroupRetrievalException,
                                 RolesRetrievalException,
                                 UserRemovalFailureException,
                                 UserInfoRetrievalException
Removes the users with the given username from the current VO

Specified by:
removeUsersFromVO in interface UsersManagementService
Parameters:
users - The users to be removed
Returns:
True if the users removed, else False
Throws:
CurrentGroupRetrievalException
RolesRetrievalException
UserRemovalFailureException
UserInfoRetrievalException

denyRequests

public Boolean denyRequests(String[] users,
                            boolean sendCustomMailToRejectedUsers)
                     throws CurrentGroupRetrievalException,
                            RolesRetrievalException,
                            UserRemovalFailureException,
                            UserInfoRetrievalException
Denies a list of requests from users for registration

Specified by:
denyRequests in interface UsersManagementService
Parameters:
The - list of users' requests to deny
Returns:
True if everything is ok
Throws:
CurrentGroupRetrievalException
RolesRetrievalException
UserRemovalFailureException
UserInfoRetrievalException

addUsersToVO

public Boolean addUsersToVO(ArrayList<String> users)
                     throws RolesRetrievalException,
                            UserInfoRetrievalException,
                            CurrentGroupRetrievalException,
                            GroupAssignmentException
Add users to the current VO

Specified by:
addUsersToVO in interface UsersManagementService
Parameters:
The - users to be added
Returns:
True if the users have been added, else False
Throws:
UserInfoRetrievalException
RolesRetrievalException
CurrentGroupRetrievalException
GroupAssignmentException

addNewUsersToVO

public Boolean addNewUsersToVO(ArrayList<String> users)
                        throws CurrentGroupRetrievalException
This method is invoked to add new Users to a VO. These users can be either VOMS users that do not belong to this VO, either users that belong to this VO but hane no roles, or users that belong to this VO and have the "pending" role

Specified by:
addNewUsersToVO in interface UsersManagementService
Parameters:
users - The users' username that will be added to the VO
Returns:
True if all users added, else false
Throws:
CurrentGroupRetrievalException

updateUserRoles

public String updateUserRoles(String username,
                              String[][] rolesAndValues)
Update the user's roles

Specified by:
updateUserRoles in interface UsersManagementService
Parameters:
username - User's username
rolesAndValues - A 2-dimensional array with the roles names and the values for the specified user
Returns:
True if the roles were updated, else False

getUsersRequests

public ArrayList<UserInfo> getUsersRequests()
                                     throws PendingUsersRetrievalException
This method returns a hash map with key the username of the new user and value an array list with all the roles that this user requests

Specified by:
getUsersRequests in interface UsersManagementService
Returns:
An array list with the Users that have made a request
Throws:
PendingUsersRetrievalException

sendEmailToRegisteredUsers

public void sendEmailToRegisteredUsers(String subject,
                                       String body)
                                throws CurrentGroupRetrievalException,
                                       RegisteredUsersRetrievalException,
                                       UserInfoRetrievalException
Sends an email with the given subject and body to all registered users of the current VO/VRE

Specified by:
sendEmailToRegisteredUsers in interface UsersManagementService
Parameters:
subject - The email's subject
body - The email's body
Throws:
CurrentGroupRetrievalException
RegisteredUsersRetrievalException
UserInfoRetrievalException

sendEmail

public void sendEmail(ArrayList<String> emails,
                      String subject,
                      String body)
Sends an email with the given subject and body to all registered users of the current VO/VRE

Specified by:
sendEmail in interface UsersManagementService
Parameters:
subject - The email's subject
body - The email's body
Throws:
CurrentGroupRetrievalException
RegisteredUsersRetrievalException
UserInfoRetrievalException

sendEmailWithErrorToSupport

public void sendEmailWithErrorToSupport(Throwable caught)
Specified by:
sendEmailWithErrorToSupport in interface UsersManagementService

getNumberOfUserThatReceiveNots

public Integer getNumberOfUserThatReceiveNots()
                                       throws RegisteredUsersRetrievalException
Specified by:
getNumberOfUserThatReceiveNots in interface UsersManagementService
Throws:
RegisteredUsersRetrievalException


Copyright © 2013. All Rights Reserved.