Class LoginHandler

    • Field Summary

      • Fields inherited from class org.apache.struts.action.Action

        servlet
    • Constructor Summary

      Constructors 
      Constructor Description
      LoginHandler()  
    • Constructor Detail

      • LoginHandler

        public LoginHandler()
    • Method Detail

      • doLogin

        public ProfileMergeIssues doLogin​(javax.servlet.http.HttpServletRequest request,
                                          java.lang.String username,
                                          java.lang.String password)
        Log-in a user. After this method completes, SessionMethods::getProfile will return this user's profile.
        Parameters:
        request - The HttpServletRequest
        username - The username
        password - The password
        Returns:
        the map containing the renamed bags the user created before they were logged in
      • mergeProfiles

        public static ProfileMergeIssues mergeProfiles​(Profile fromProfile,
                                                       Profile toProfile)
        Merge two profiles together. This is mainly of use when a new user registers and we need to save their current anonymous session into their new profile.
        Parameters:
        fromProfile - The profile to take information from.
        toProfile - The profile to merge into.
        Returns:
        A map of bags, from old name to new name.
      • doStaticLogin

        public static ProfileMergeIssues doStaticLogin​(javax.servlet.http.HttpServletRequest request,
                                                       java.lang.String username,
                                                       java.lang.String password)
        Main log-in logic.
        Parameters:
        request - The current request.
        username - The current user's login name.
        password - The current user's password.
        Returns:
        A map of renamed-bags from old to new name.
      • setUpProfile

        public static Profile setUpProfile​(javax.servlet.http.HttpSession session,
                                           java.lang.String username,
                                           java.lang.String password)
        Initialises a profile for the current user based on their user name and password.
        Parameters:
        session - HTTP session
        username - user name
        password - password
        Returns:
        profile, fully ready to use.
      • setUpPermission

        public static void setUpPermission​(InterMineAPI api,
                                           ProfileManager.ApiPermission permission)
        Does whatever needs to be done to a permissions object to get it ready for a life cyle in a web service request. At the moment, this just means determining if this is the super user, and running the bag upgrade thread.
        Parameters:
        api - The InterMine API object.
        permission - The permission that needs setting up.
      • runBagUpgrade

        public static void runBagUpgrade​(UpgradeBagList procedure,
                                         InterMineAPI api,
                                         Profile profile)
        Kick off a bag upgrade for current user.
        Parameters:
        procedure - The bag upgrade routine.
        api - The InterMine state object.
        profile - The current user's profile.
      • setUpProfile

        public static Profile setUpProfile​(javax.servlet.http.HttpSession session,
                                           Profile profile)
        Sets up a profile ready for a session in InterMine.
        Parameters:
        session - http session
        profile - the user's profile (possibly anonymous and temporary)
        Returns:
        profile The profile all cleaned up and good to go.