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 IUserFactory
UserAllreadyExistException
public void addOrModifyUserInfo(IUserInfo userInfo) throws UserAllreadyExistException
IUserFactory
addOrModifyUserInfo
in interface IUserFactory
UserAllreadyExistException
public User autoLogin(javax.servlet.http.HttpServletRequest request, String login)
autoLogin
in interface IUserFactory
public void clearUserInfoList()
clearUserInfoList
in interface IUserFactory
public UserInfo createUserInfos()
createUserInfos
in interface IUserFactory
public void deleteUser(String login)
deleteUser
in interface IUserFactory
public Set<String> getAllRoles(GlobalContext globalContext, javax.servlet.http.HttpSession session)
IUserFactory
getAllRoles
in interface IUserFactory
public User getCurrentUser(GlobalContext globalContext, javax.servlet.http.HttpSession session)
getCurrentUser
in interface IUserFactory
protected String getFileName()
public User getUser(String login)
getUser
in interface IUserFactory
public User getUserByEmail(String email)
getUserByEmail
in interface IUserFactory
public User login(javax.servlet.http.HttpServletRequest request, String token)
login
in interface IUserFactory
public List<IUserInfo> getUserInfoForRoles(String[] inRoles)
getUserInfoForRoles
in interface IUserFactory
public static final List<IUserInfo> load(File file) throws IOException, SecurityException, IllegalArgumentException, IllegalAccessException, InvocationTargetException
public List<IUserInfo> getUserInfoList()
getUserInfoList
in interface IUserFactory
public IUserInfo getUserInfos(String id)
getUserInfos
in interface IUserFactory
public void init(GlobalContext globalContext, javax.servlet.http.HttpSession newSession)
init
in interface IUserFactory
public boolean isStandardStorage()
IUserFactory
isStandardStorage
in interface IUserFactory
public User login(javax.servlet.http.HttpServletRequest request, String login, String password)
login
in interface IUserFactory
public void logout(javax.servlet.http.HttpSession session)
logout
in interface IUserFactory
public void mergeUserInfo(IUserInfo userInfo) throws IOException
mergeUserInfo
in interface IUserFactory
IOException
public void releaseUserInfoList()
releaseUserInfoList
in interface IUserFactory
public void reload(GlobalContext globalContext, javax.servlet.http.HttpSession session)
reload
in interface IUserFactory
public void store() throws IOException
store
in interface IUserFactory
IOException
public static void store(List<IUserInfo> userInfoList, File userInfoFile) throws IOException
IOException
public void updateUserInfo(IUserInfo userInfo) throws IOException
updateUserInfo
in interface IUserFactory
IOException
public IUserInfo getPasswordChangeWidthKey(String passwordChangeCode)
passwordChangeCode
- protected Set<String> getRoleList(ContentContext ctx)
public RoleWrapper getRoleWrapper(ContentContext ctx, User user)
getRoleWrapper
in interface IUserFactory
public String getTokenCreateIfNotExist(User user) throws IOException
getTokenCreateIfNotExist
in interface IUserFactory
IOException
public 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.