Class AuthenticatedUser
- java.lang.Object
-
- net.sf.basedb.core.authentication.AuthenticatedUser
-
public class AuthenticatedUser extends Object
Objects of this class are returned by theAuthenticationManager.authenticate()
method and contains information about the authenticated user. This class provide information about the login and/or external id for the user as well as theAuthenticationMethod
that was used. Additional information for the user may be provided byExtraUserInformation
.- Since:
- 3.3
- Author:
- Nicklas
-
-
Field Summary
Fields Modifier and Type Field Description private String
externalId
private ExtraUserInformation
extraInfo
private int
internalId
private String
login
private AuthenticationMethod
method
-
Constructor Summary
Constructors Constructor Description AuthenticatedUser(AuthenticationMethod method, String login, String externalId)
Creates a newAuthenticatedUser
object without any link to an existing user in BASE.AuthenticatedUser(AuthenticationMethod method, UserData user)
Creates a newAuthenticatedUser
object with a link to an existing user in BASE.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthenticationMethod
getAuthenticationMethod()
Get the authentication method that was used to verify the login.String
getExternalId()
Get the external id for the user.ExtraUserInformation
getExtraInformation()
Get extra information about the user.int
getInternalId()
Get the internal id for the user (0 if not known)String
getLogin()
Get the login string for the user.boolean
hasExtraInformation()
Check if extra information about the user has been provided.void
setExtraInformation(ExtraUserInformation extraInfo)
Set extra information about the user.
-
-
-
Field Detail
-
method
private final AuthenticationMethod method
-
login
private final String login
-
externalId
private final String externalId
-
internalId
private final int internalId
-
extraInfo
private ExtraUserInformation extraInfo
-
-
Constructor Detail
-
AuthenticatedUser
public AuthenticatedUser(AuthenticationMethod method, String login, String externalId)
Creates a newAuthenticatedUser
object without any link to an existing user in BASE.- Parameters:
method
- The authentication method used to verify the userlogin
- The login nameexternalId
- The unique externalId of the user
-
AuthenticatedUser
public AuthenticatedUser(AuthenticationMethod method, UserData user)
Creates a newAuthenticatedUser
object with a link to an existing user in BASE.- Parameters:
method
- The authentication method used to verify the useruser
- The UserData object for an existing user
-
-
Method Detail
-
getAuthenticationMethod
public AuthenticationMethod getAuthenticationMethod()
Get the authentication method that was used to verify the login.
-
getLogin
public String getLogin()
Get the login string for the user.
-
getExternalId
public String getExternalId()
Get the external id for the user.
-
getInternalId
public int getInternalId()
Get the internal id for the user (0 if not known)
-
hasExtraInformation
public boolean hasExtraInformation()
Check if extra information about the user has been provided.
-
getExtraInformation
public ExtraUserInformation getExtraInformation()
Get extra information about the user.
-
setExtraInformation
public void setExtraInformation(ExtraUserInformation extraInfo)
Set extra information about the user.
-
-