Package edu.cornell.mannlib.vedit.beans
Class LoginStatusBean
- java.lang.Object
-
- edu.cornell.mannlib.vedit.beans.LoginStatusBean
-
public class LoginStatusBean extends Object
An immutable object that records the user's login info as a session attribute.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLoginStatusBean.AuthenticationSource
-
Constructor Summary
Constructors Constructor Description LoginStatusBean(String userURI, LoginStatusBean.AuthenticationSource authenticationSource)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LoginStatusBean.AuthenticationSourcegetAuthenticationSource()static LoginStatusBeangetBean(javax.servlet.http.HttpServletRequest request)Get the bean from this request, or a dummy bean if the user is not logged in.static LoginStatusBeangetBean(javax.servlet.http.HttpSession session)Get the bean from this session, or a dummy bean if the user is not logged in.static UserAccountgetCurrentUser(javax.servlet.http.HttpServletRequest request)Get the current user, or null if not logged in.static UserAccountgetCurrentUser(javax.servlet.http.HttpSession session)Get the current user, or null if not logged in.StringgetUserURI()booleanhasExternalAuthentication()booleanisLoggedIn()static voidsetBean(javax.servlet.http.HttpSession session, LoginStatusBean lsb)Attach this bean to the session - this means you are logged in.StringtoString()
-
-
-
Constructor Detail
-
LoginStatusBean
public LoginStatusBean(String userURI, LoginStatusBean.AuthenticationSource authenticationSource)
-
-
Method Detail
-
setBean
public static void setBean(javax.servlet.http.HttpSession session, LoginStatusBean lsb)Attach this bean to the session - this means you are logged in.
-
getBean
public static LoginStatusBean getBean(javax.servlet.http.HttpServletRequest request)
Get the bean from this request, or a dummy bean if the user is not logged in. Never returns null.
-
getBean
public static LoginStatusBean getBean(javax.servlet.http.HttpSession session)
Get the bean from this session, or a dummy bean if the user is not logged in. Never returns null.
-
getCurrentUser
public static UserAccount getCurrentUser(javax.servlet.http.HttpServletRequest request)
Get the current user, or null if not logged in.
-
getCurrentUser
public static UserAccount getCurrentUser(javax.servlet.http.HttpSession session)
Get the current user, or null if not logged in.
-
getUserURI
public String getUserURI()
-
getAuthenticationSource
public LoginStatusBean.AuthenticationSource getAuthenticationSource()
-
isLoggedIn
public boolean isLoggedIn()
-
hasExternalAuthentication
public boolean hasExternalAuthentication()
-
-