Package org.intermine.web.logic.profile
Class LoginHandler
- java.lang.Object
-
- org.apache.struts.action.Action
-
- org.intermine.web.struts.InterMineAction
-
- org.intermine.web.logic.profile.LoginHandler
-
- Direct Known Subclasses:
Callback
,CreateAccountAction
,LoginAction
,PasswordResetAction
public abstract class LoginHandler extends InterMineAction
- Author:
- Xavier Watkins Abstract class containing the methods for login in and copying current history, bags,... into profile.
-
-
Constructor Summary
Constructors Constructor Description LoginHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ProfileMergeIssues
doLogin(javax.servlet.http.HttpServletRequest request, java.lang.String username, java.lang.String password)
Log-in a user.static ProfileMergeIssues
doStaticLogin(javax.servlet.http.HttpServletRequest request, java.lang.String username, java.lang.String password)
Main log-in logic.static ProfileMergeIssues
mergeProfiles(Profile fromProfile, Profile toProfile)
Merge two profiles together.static void
runBagUpgrade(UpgradeBagList procedure, InterMineAPI api, Profile profile)
Kick off a bag upgrade for current user.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.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.static Profile
setUpProfile(javax.servlet.http.HttpSession session, Profile profile)
Sets up a profile ready for a session in InterMine.-
Methods inherited from class org.intermine.web.struts.InterMineAction
getWebProperties, recordError, recordError, recordError, recordMessage
-
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, execute, generateToken, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
-
-
-
-
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 HttpServletRequestusername
- The usernamepassword
- 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 sessionusername
- user namepassword
- 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 sessionprofile
- the user's profile (possibly anonymous and temporary)- Returns:
- profile The profile all cleaned up and good to go.
-
-