public class UserFactory extends Object implements IUserFactory, Serializable
| Modifier and Type | Field and Description |
|---|---|
static Logger |
logger
create a static logger.
|
static String |
SESSION_KEY |
static String |
USER_FACTORY_KEY |
protected List<IUserInfo> |
userInfoList |
AUTO_LOGIN_AGE_SEC, TOKEN_PARAM| Constructor and Description |
|---|
UserFactory() |
| Modifier and Type | Method and Description |
|---|---|
void |
addOrModifyUserInfo(IUserInfo userInfo)
if user info found, update data
|
void |
addUserInfo(IUserInfo userInfo) |
User |
autoLogin(javax.servlet.http.HttpServletRequest request,
String login) |
void |
clearUserInfoList() |
String |
createPasswordChangeKey(IUserInfo user) |
protected User |
createUser(String login,
Set<String> roles) |
static IUserFactory |
createUserFactory(GlobalContext globalContext,
javax.servlet.http.HttpSession session) |
static IUserFactory |
createUserFactory(javax.servlet.http.HttpServletRequest request)
Deprecated.
use createUserFactory(GlobalContext, HttpSession)
|
UserInfo |
createUserInfos() |
void |
deleteUser(String login) |
Set<String> |
getAllRoles(GlobalContext globalContext,
javax.servlet.http.HttpSession session)
get all roles of the user.
|
User |
getCurrentUser(GlobalContext globalContext,
javax.servlet.http.HttpSession session) |
protected String |
getFileName() |
static javax.mail.internet.InternetAddress |
getInternetAddress(IUserInfo userinfo) |
static javax.mail.internet.InternetAddress |
getInternetAddress(User user) |
IUserInfo |
getPasswordChangeWidthKey(String passwordChangeCode)
retrieve user for change password width special code.
|
protected Set<String> |
getRoleList(ContentContext ctx) |
RoleWrapper |
getRoleWrapper(ContentContext ctx,
User user) |
String |
getTokenCreateIfNotExist(User user) |
User |
getUser(String login) |
User |
getUserByEmail(String email) |
List<IUserInfo> |
getUserInfoForRoles(String[] inRoles) |
List<IUserInfo> |
getUserInfoList() |
IUserInfo |
getUserInfos(String id) |
void |
init(GlobalContext globalContext,
javax.servlet.http.HttpSession newSession) |
boolean |
isStandardStorage()
check if the user system use standard storage system of wcms
|
static List<IUserInfo> |
load(File file) |
User |
login(javax.servlet.http.HttpServletRequest request,
String token) |
User |
login(javax.servlet.http.HttpServletRequest request,
String login,
String password) |
void |
logout(javax.servlet.http.HttpSession session) |
void |
mergeUserInfo(IUserInfo userInfo) |
void |
releaseUserInfoList() |
void |
reload(GlobalContext globalContext,
javax.servlet.http.HttpSession session) |
void |
store() |
static void |
store(List<IUserInfo> userInfoList,
File userInfoFile) |
void |
updateUserInfo(IUserInfo userInfo) |
static List<javax.mail.internet.InternetAddress> |
userListAsInternetAddressList(ContentContext ctx,
List<String> users) |
public static Logger logger
public static final String USER_FACTORY_KEY
public static final String SESSION_KEY
public static IUserFactory createUserFactory(GlobalContext globalContext, javax.servlet.http.HttpSession session)
@Deprecated public static final IUserFactory createUserFactory(javax.servlet.http.HttpServletRequest request)
request - public void addUserInfo(IUserInfo userInfo) throws UserAllreadyExistException
addUserInfo in interface IUserFactoryUserAllreadyExistExceptionpublic void addOrModifyUserInfo(IUserInfo userInfo) throws UserAllreadyExistException
IUserFactoryaddOrModifyUserInfo in interface IUserFactoryUserAllreadyExistExceptionpublic User autoLogin(javax.servlet.http.HttpServletRequest request, String login)
autoLogin in interface IUserFactorypublic void clearUserInfoList()
clearUserInfoList in interface IUserFactorypublic UserInfo createUserInfos()
createUserInfos in interface IUserFactorypublic void deleteUser(String login)
deleteUser in interface IUserFactorypublic Set<String> getAllRoles(GlobalContext globalContext, javax.servlet.http.HttpSession session)
IUserFactorygetAllRoles in interface IUserFactorypublic User getCurrentUser(GlobalContext globalContext, javax.servlet.http.HttpSession session)
getCurrentUser in interface IUserFactoryprotected String getFileName()
public User getUser(String login)
getUser in interface IUserFactorypublic User getUserByEmail(String email)
getUserByEmail in interface IUserFactorypublic User login(javax.servlet.http.HttpServletRequest request, String token)
login in interface IUserFactorypublic List<IUserInfo> getUserInfoForRoles(String[] inRoles)
getUserInfoForRoles in interface IUserFactorypublic static final List<IUserInfo> load(File file) throws IOException, SecurityException, IllegalArgumentException, IllegalAccessException, InvocationTargetException
public List<IUserInfo> getUserInfoList()
getUserInfoList in interface IUserFactorypublic IUserInfo getUserInfos(String id)
getUserInfos in interface IUserFactorypublic void init(GlobalContext globalContext, javax.servlet.http.HttpSession newSession)
init in interface IUserFactorypublic boolean isStandardStorage()
IUserFactoryisStandardStorage in interface IUserFactorypublic User login(javax.servlet.http.HttpServletRequest request, String login, String password)
login in interface IUserFactorypublic void logout(javax.servlet.http.HttpSession session)
logout in interface IUserFactorypublic void mergeUserInfo(IUserInfo userInfo) throws IOException
mergeUserInfo in interface IUserFactoryIOExceptionpublic void releaseUserInfoList()
releaseUserInfoList in interface IUserFactorypublic void reload(GlobalContext globalContext, javax.servlet.http.HttpSession session)
reload in interface IUserFactorypublic void store()
throws IOException
store in interface IUserFactoryIOExceptionpublic static void store(List<IUserInfo> userInfoList, File userInfoFile) throws IOException
IOExceptionpublic void updateUserInfo(IUserInfo userInfo) throws IOException
updateUserInfo in interface IUserFactoryIOExceptionpublic IUserInfo getPasswordChangeWidthKey(String passwordChangeCode)
passwordChangeCode - protected Set<String> getRoleList(ContentContext ctx)
public RoleWrapper getRoleWrapper(ContentContext ctx, User user)
getRoleWrapper in interface IUserFactorypublic String getTokenCreateIfNotExist(User user) throws IOException
getTokenCreateIfNotExist in interface IUserFactoryIOExceptionpublic static javax.mail.internet.InternetAddress getInternetAddress(User user)
public static javax.mail.internet.InternetAddress getInternetAddress(IUserInfo userinfo)
public static List<javax.mail.internet.InternetAddress> userListAsInternetAddressList(ContentContext ctx, List<String> users)
Copyright © 2012-2018. All Rights Reserved.