public class AuthenticatedUser extends Object implements IBasicUserInfoDetailNames
Modifier and Type | Field and Description |
---|---|
static String |
ADMIN_BACKUP_PROFILE_IMAGE
The file name for the undefined user profile image in huge format.
|
static String |
ADMIN_BACKUP_USER_NAME
The user name for default backup administrator user: "iiziAdmin BACKUP".
|
static String |
ADMIN_PROFILE_IMAGE
The file name for the undefined user profile image in huge format.
|
static String |
ADMIN_USER_NAME
The user name for default administrator user: "iiziAdmin".
|
static String |
PROFILE_IMAGE_FILE_NAME_BASE
The base name of the file name for profile images of a certain size.
|
static String |
UNDEFINED_USER_NAME
The user name for undefined user: "@undefined".
|
static String |
UNDEFINED_USER_PROFILE_IMAGE
The file name for the undefined user profile image in huge format.
|
String |
userName
The user name.
|
ALL_DETAILS, DETAIL_AdditionalEmail, DETAIL_Address, DETAIL_Address_2, DETAIL_Address_3, DETAIL_City, DETAIL_CompanyDivision, DETAIL_CompanyName, DETAIL_Country, DETAIL_DBAdministrationUserName, DETAIL_DeveloperGroupID, DETAIL_DeveloperID, DETAIL_Email, DETAIL_EmailVerify, DETAIL_FirstName, DETAIL_FixedPassword, DETAIL_FullName, DETAIL_HomeFax, DETAIL_HomeMobile, DETAIL_HomePhone, DETAIL_JobTitle, DETAIL_LargeProfileImage, DETAIL_LastName, DETAIL_MiddleName, DETAIL_Phone, DETAIL_Phone_2, DETAIL_PinCode, DETAIL_RecoveryAnswer, DETAIL_RecoveryQuestion, DETAIL_StateProvince, DETAIL_ThumbnailProfileImage, DETAIL_Title, DETAIL_UploadedProfileImage, DETAIL_WorkFax, DETAIL_WorkMobile, DETAIL_WorkPhone, DETAIL_ZipCode, detailsSet, PROFILE_PICTURE_DETAILS
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Checks for equality.
|
BasicUserInfo |
getBasicUserInfo()
Gets the basic user information that was last refreshed from the database.
|
long |
getLastAccessedTime()
Gets the last access time for the user.
|
UserLocationHistory |
getLocationHistory()
Gets the user's location history.
|
RuntimeImageDefinition |
getProfileImage(IAppSessionGyro appGyro,
int width,
int height,
int quality,
boolean createDefault)
Gets the profile image for the user scaled to the requested size.
|
RuntimeImageDefinition |
getProfileImage(IClientSessionGyro clientGyro,
int width,
int height,
int quality)
Gets the profile image for the user scaled to the requested size.
|
RuntimeImageDefinition |
getProfileImage(int width,
int height,
int quality,
boolean createDefault)
Gets the profile image for the user scaled to the requested size.
|
String |
getProfileImageName(int width,
int height,
int quality)
Gets the name of the profile image for this particular user.
|
File |
getProfilePictureFile()
Gets the File for the full profile picture, or any lower resolution(s) if the full profile picture is not found.
|
File |
getProfilePictureFile(String detail)
Gets the File for the full profile picture, or any lower resolution(s) if the full profile picture is not found.
|
File |
getProfilePictureFile(String[] rcDetail)
Gets the File for the full profile picture, or any lower resolution(s) if the full profile picture is not found.
|
static AuthenticatedUser |
getUndefinedUser()
Gets the undefined "authenticated" user.
|
static File |
getUndefinedUserProfileImage()
Gets the file for the undefined profile image that can be used to create the requested sizes.
|
static File |
getUndefinedUserProfileImage(File webServerRoot)
Gets the file for the undefined profile image that can be used to create the requested sizes.
|
WSFileProvider |
getUserFileProvider()
Gets the user file provider for private user files such as images.
|
WSFileProvider |
getUserFileProvider(WSFileProviderEngine engine)
Gets the user file provider for private user files such as images.
|
boolean |
isUndefined()
Checks if this user is the "undefined" user that is used for external login.
|
Map<String,WSFile> |
loadAllUserFiles()
Loads the directory of all user files that are currently present and reserves the names in the
of this user. |
void |
markAccessed()
Marks the user as accessed and updates the "last access" time.
|
boolean |
removeAccount(Connection conn)
Removes the user from the database.
|
WSFile |
setProfileImage(Connection conn,
String detail,
File imageFile)
Sets a new profile image for the user.
|
WSFile |
setProfileImage(WSFileProviderEngine engine,
Connection conn,
String detail,
File imageFile)
Sets a new profile image for the user.
|
String |
toString()
String representation of the class.
|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isDetailInInternalServerDatabase
public static final String UNDEFINED_USER_NAME
public static final String ADMIN_USER_NAME
public static final String ADMIN_BACKUP_USER_NAME
public static final String PROFILE_IMAGE_FILE_NAME_BASE
public static final String UNDEFINED_USER_PROFILE_IMAGE
public static final String ADMIN_PROFILE_IMAGE
public static final String ADMIN_BACKUP_PROFILE_IMAGE
public final String userName
public static File getUndefinedUserProfileImage() throws FileNotFoundException
FileNotFoundException
public static File getUndefinedUserProfileImage(File webServerRoot) throws FileNotFoundException
webServerRoot
- The root of the web server.FileNotFoundException
public static AuthenticatedUser getUndefinedUser()
public void markAccessed()
public long getLastAccessedTime()
public boolean equals(Object o)
public String toString()
public boolean isUndefined()
public BasicUserInfo getBasicUserInfo()
public boolean removeAccount(Connection conn) throws SQLException, IllegalStateException
conn
- The connection.SQLException
- For SQL errors.IllegalStateException
- If the basic user information is not present or if it's one of the admin users.public UserLocationHistory getLocationHistory()
IllegalStateException
- If this call is done when the information of the user is undefined.public WSFileProvider getUserFileProvider() throws IOException
IOException
- If the user private directory failed to be created.IllegalStateException
- If the WSFile engine is disposed (server has been stopped).public WSFileProvider getUserFileProvider(WSFileProviderEngine engine) throws IOException
engine
- The file provider engine (when Designer creates a profile image).IOException
- If the user private directory failed to be created.IllegalStateException
- If the WSFile engine is disposed (server has been stopped).public Map<String,WSFile> loadAllUserFiles() throws IOException
WSFileProvider
of this user.
The key is the file name and the value is the WSFile with a reserved name ready for publishing, but not yet published.
WSFile
instance.IOException
- If the user private directory failed to be created or the directory failed to
list its files.public WSFile setProfileImage(Connection conn, String detail, File imageFile) throws IOException, SQLException
conn
- The connection.detail
- The image detail:
IBasicUserInfoDetailNames.DETAIL_UploadedProfileImage
,
IBasicUserInfoDetailNames.DETAIL_ThumbnailProfileImage
or
IBasicUserInfoDetailNames.DETAIL_LargeProfileImage
.imageFile
- The new profile image located inside the files provider.IOException
- For I/O errors.SQLException
- For SQL errors.NotFoundException
- If the file doesn't exist.IllegalArgumentException
- If the file parent is not this providers root directory.IllegalArgumentException
- If the detail is not valid.IllegalStateException
- If the WSFile engine is disposed (server has been stopped), or
if the user is undefined.public WSFile setProfileImage(WSFileProviderEngine engine, Connection conn, String detail, File imageFile) throws IOException, SQLException
detail
to IBasicUserInfoDetailNames.DETAIL_UploadedProfileImage
, the two others IBasicUserInfoDetailNames.DETAIL_LargeProfileImage
and
IBasicUserInfoDetailNames.DETAIL_ThumbnailProfileImage
will be removed.conn
- The connection.detail
- The image detail:
IBasicUserInfoDetailNames.DETAIL_UploadedProfileImage
,
IBasicUserInfoDetailNames.DETAIL_ThumbnailProfileImage
or
IBasicUserInfoDetailNames.DETAIL_LargeProfileImage
.imageFile
- The new profile image located inside the files provider.IOException
- For I/O errors.SQLException
- For SQL errors.NotFoundException
- If the file doesn't exist.IllegalArgumentException
- If the file parent is not this providers root directory.IllegalArgumentException
- If the detail is not valid.IllegalStateException
- If the WSFile engine is disposed (server has been stopped), or
if the user is undefined.public String getProfileImageName(int width, int height, int quality)
width
- The width requested (minimum 16, maximum 400).height
- The height requested (minimum 16, maximum 400).quality
- JPG quality 0-100, if zero a PNG is used. 100 means loss-less and 1 means really bad quality.public RuntimeImageDefinition getProfileImage(IClientSessionGyro clientGyro, int width, int height, int quality) throws IOException
clientGyro
- The client session gyro.width
- The width requested (minimum 16, maximum 400).height
- The height requested (minimum 16, maximum 400).quality
- JPG quality 0-100, if zero a PNG is used. 100 means loss-less and 1 means really bad quality.null
if a profile image is not available.IOException
- For file I/O errors.IllegalArgumentException
- If the width, height or quality is invalid, or if DPR=1 is not present.public RuntimeImageDefinition getProfileImage(IAppSessionGyro appGyro, int width, int height, int quality, boolean createDefault) throws IOException
This method will create images for the most common DPR's: 1, 1.5, 2, 3, and 4.
Profile images runtime definition is cached in the instance of the app session gyro.
appGyro
- The application session gyro.width
- The width requested (minimum 16, maximum 400).height
- The height requested (minimum 16, maximum 400).quality
- JPG quality 0-100, if zero a PNG is used. 100 means loss-less and 1 means really bad quality.createDefault
- Flag indicating the image will be created from the undefined profile image if no image is present.null
if a profile image is not available.IOException
- For file I/O errors.IllegalArgumentException
- If the width, height or quality is invalid, or if DPR=1 is not present.public RuntimeImageDefinition getProfileImage(int width, int height, int quality, boolean createDefault) throws IOException
This method will create images for the most common DPR's: 1, 1.5, 2, 3, and 4.
Profile images runtime definition is cached in this instance of the authenticated user.
width
- The width requested (minimum 16, maximum 400).height
- The height requested (minimum 16, maximum 400).quality
- JPG quality 0-100, if zero a PNG is used. 100 means loss-less and 1 means really bad quality.createDefault
- Flag indicating the image will be created from the undefined profile image if no image is present.null
if a profile image is not available.IOException
- For file I/O errors.IllegalArgumentException
- If the width, height or quality is invalid, or if DPR=1 is not present.public File getProfilePictureFile() throws IOException
IOException
- If the file provider for the user or its root directory fails retrieving.public File getProfilePictureFile(String[] rcDetail) throws IOException
rcDetail
- The detail of the file, must be an array of length 1, or null. Upon return and a file is
found, the rcDetail[0] contains the value IBasicUserInfoDetailNames.DETAIL_UploadedProfileImage
,
IBasicUserInfoDetailNames.DETAIL_UploadedProfileImage
or IBasicUserInfoDetailNames.DETAIL_UploadedProfileImage
.
If a file is not found, it is set to null (if array is not null).IOException
- If the file provider for the user or its root directory fails retrieving.public File getProfilePictureFile(String detail) throws IOException
detail
- The detail of the file, and be IBasicUserInfoDetailNames.DETAIL_UploadedProfileImage
,
IBasicUserInfoDetailNames.DETAIL_UploadedProfileImage
or IBasicUserInfoDetailNames.DETAIL_UploadedProfileImage
.IOException
- If the file provider for the user or its root directory fails retrieving.iizi® is a registered trademark of Mindus SARL. © Copyright Mindus SARL, 2020. All rights reserved.