Class SecurityServiceImpl

  • All Implemented Interfaces:
    com.google.gwt.user.client.rpc.RemoteService, com.google.gwt.user.server.rpc.SerializationPolicyProvider, SecurityService, Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    public class SecurityServiceImpl
    extends com.google.gwt.user.server.rpc.RemoteServiceServlet
    implements SecurityService
    Implementation of the SecurityService
    Since:
    6.0
    Author:
    Marco Meschieri - LogicalDOC
    See Also:
    Serialized Form
    • Constructor Detail

      • SecurityServiceImpl

        public SecurityServiceImpl()
    • Method Detail

      • getTenant

        public static GUITenant getTenant​(long tenantId)
      • loadSession

        public GUISession loadSession​(Session sess,
                                      String locale)
        Used internally by login procedures, instantiates a new GUISession by a given authenticated user
        Parameters:
        sess - the current session
        locale - the current locale
        Returns:
        session details
      • getSession

        public GUISession getSession​(String locale)
        Description copied from interface: SecurityService
        Logs-in a user by an existing session ID (session reuse)
        Specified by:
        getSession in interface SecurityService
        Parameters:
        locale - the currently used language specification
        Returns:
        session informations
      • changePassword

        public int changePassword​(Long requestorUserId,
                                  long userId,
                                  String oldPassword,
                                  String newPassword,
                                  boolean notify)
        Description copied from interface: SecurityService
        Changes the password of a user
        Specified by:
        changePassword in interface SecurityService
        Parameters:
        requestorUserId - The user Identifier of the requestor
        userId - The user Identifier
        oldPassword - can be null
        newPassword - the new password
        notify - If the new credentials have to be notified
        Returns:
        0 if all is ok, 1 if the password is incorrect, 2 if the new password cannot be notified, otherwise a positive number grater than 2
      • addUserToGroup

        public void addUserToGroup​(long groupId,
                                   long userId)
                            throws ServerException
        Description copied from interface: SecurityService
        Adds a user to a group
        Specified by:
        addUserToGroup in interface SecurityService
        Parameters:
        groupId - identifier of the group
        userId - identifier of the user
        Throws:
        ServerException - error generated in the server application
      • getGroup

        public GUIGroup getGroup​(long groupId)
                          throws ServerException
        Description copied from interface: SecurityService
        Loads a given group from the database
        Specified by:
        getGroup in interface SecurityService
        Parameters:
        groupId - identifier of the group
        Returns:
        group retrieved from the server application
        Throws:
        ServerException - error generated in the server application
      • getUser

        public GUIUser getUser​(long userId)
                        throws ServerException
        Description copied from interface: SecurityService
        Loads a given user from the database
        Specified by:
        getUser in interface SecurityService
        Parameters:
        userId - identifier of the user
        Returns:
        the user retrieved from the server application
        Throws:
        ServerException - error generated in the server application
      • removeFromGroup

        public void removeFromGroup​(long groupId,
                                    long[] userIds)
                             throws ServerException
        Description copied from interface: SecurityService
        Removes users from a group
        Specified by:
        removeFromGroup in interface SecurityService
        Parameters:
        groupId - identifier of the group
        userIds - array of user identifiers
        Throws:
        ServerException - error generated in the server application
      • kill

        public void kill​(String sid)
        Description copied from interface: SecurityService
        Kill the session with the given sid
        Specified by:
        kill in interface SecurityService
        Parameters:
        sid - identifier of the session
      • getMenu

        public GUIMenu getMenu​(long menuId)
                        throws ServerException
        Description copied from interface: SecurityService
        Retrieves the specified menu
        Specified by:
        getMenu in interface SecurityService
        Parameters:
        menuId - identifier of the menu
        Returns:
        the menu retrieved from the server application
        Throws:
        ServerException - error generated in the server application
      • replicateUsersSettings

        public void replicateUsersSettings​(long masterUserId,
                                           Long[] userIds,
                                           boolean gui,
                                           boolean groups)
                                    throws ServerException
        Description copied from interface: SecurityService
        Replicates the settings of a given user to a selection of other users
        Specified by:
        replicateUsersSettings in interface SecurityService
        Parameters:
        masterUserId - identifier of the user with the settings you want to replicate
        userIds - identifiers of the users to replicate the settings to
        gui - if the user interface settings must be replicated
        groups - if the groups must be replicated(the read-only users will not be affected by this flag)
        Throws:
        ServerException - error generated in the server application