Package org.javlo.user
Class AbstractDBUserFactory
- java.lang.Object
-
- org.javlo.user.UserFactory
-
- org.javlo.user.AbstractDBUserFactory
-
- All Implemented Interfaces:
Serializable
,IUserFactory
public abstract class AbstractDBUserFactory extends UserFactory
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static Logger
logger
-
Fields inherited from class org.javlo.user.UserFactory
USER_FACTORY_KEY, userInfoList
-
Fields inherited from interface org.javlo.user.IUserFactory
AUTO_LOGIN_AGE_SEC, TOKEN_PARAM
-
-
Constructor Summary
Constructors Constructor Description AbstractDBUserFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addUserInfo(IUserInfo userInfo)
User
autoLogin(javax.servlet.http.HttpServletRequest request, String login)
void
clearUserInfoList()
UserInfo
createUserInfos()
void
deleteUser(String login)
Set<String>
getAllRoles(GlobalContext globalContext, javax.servlet.http.HttpSession session)
get all roles of the user.protected static Connection
getConnection(GlobalContext globalContext)
User
getCurrentUser(GlobalContext globalContext, javax.servlet.http.HttpSession session)
RoleWrapper
getRoleWrapper(ContentContext ctx, User user)
User
getUser(String login)
List<IUserInfo>
getUserInfoForRoles(String[] inRoles)
List<IUserInfo>
getUserInfoList()
IUserInfo
getUserInfos(String id)
void
init(GlobalContext globalContext, javax.servlet.http.HttpSession session)
boolean
isStandardStorage()
check if the user system use standard storage system of wcmsUser
login(javax.servlet.http.HttpServletRequest request, String login, String password)
void
mergeUserInfo(IUserInfo userInfo)
void
releaseUserInfoList()
void
reload(GlobalContext globalContext, javax.servlet.http.HttpSession session)
protected abstract List<IUserInfo>
statementToUserInfoList(Statement statement)
void
store()
void
updateUserInfo(IUserInfo userInfo)
-
Methods inherited from class org.javlo.user.UserFactory
addOrModifyUserInfo, adminFakeLogin, checkUserAviability, createPasswordChangeKey, createUser, createUserFactory, createUserFactory, getFileName, getInternetAddress, getInternetAddress, getPasswordChangeWidthKey, getRoleList, getSessionKey, getTokenCreateIfNotExist, getUserByEmail, load, login, logout, store, uploadNewAvatar, userListAsInternetAddressList
-
-
-
-
Field Detail
-
logger
public static Logger logger
-
-
Method Detail
-
getConnection
protected static Connection getConnection(GlobalContext globalContext) throws ClassNotFoundException, SQLException, NamingException
-
addUserInfo
public void addUserInfo(IUserInfo userInfo) throws UserAllreadyExistException
- Specified by:
addUserInfo
in interfaceIUserFactory
- Overrides:
addUserInfo
in classUserFactory
- Throws:
UserAllreadyExistException
-
autoLogin
public User autoLogin(javax.servlet.http.HttpServletRequest request, String login)
- Specified by:
autoLogin
in interfaceIUserFactory
- Overrides:
autoLogin
in classUserFactory
-
clearUserInfoList
public void clearUserInfoList()
- Specified by:
clearUserInfoList
in interfaceIUserFactory
- Overrides:
clearUserInfoList
in classUserFactory
-
createUserInfos
public UserInfo createUserInfos()
- Specified by:
createUserInfos
in interfaceIUserFactory
- Overrides:
createUserInfos
in classUserFactory
-
deleteUser
public void deleteUser(String login)
- Specified by:
deleteUser
in interfaceIUserFactory
- Overrides:
deleteUser
in classUserFactory
-
getAllRoles
public Set<String> getAllRoles(GlobalContext globalContext, javax.servlet.http.HttpSession session)
Description copied from interface:IUserFactory
get all roles of the user.- Specified by:
getAllRoles
in interfaceIUserFactory
- Overrides:
getAllRoles
in classUserFactory
- Returns:
-
getCurrentUser
public User getCurrentUser(GlobalContext globalContext, javax.servlet.http.HttpSession session)
- Specified by:
getCurrentUser
in interfaceIUserFactory
- Overrides:
getCurrentUser
in classUserFactory
-
getUser
public User getUser(String login)
- Specified by:
getUser
in interfaceIUserFactory
- Overrides:
getUser
in classUserFactory
-
getUserInfoForRoles
public List<IUserInfo> getUserInfoForRoles(String[] inRoles)
- Specified by:
getUserInfoForRoles
in interfaceIUserFactory
- Overrides:
getUserInfoForRoles
in classUserFactory
-
getUserInfoList
public List<IUserInfo> getUserInfoList()
- Specified by:
getUserInfoList
in interfaceIUserFactory
- Overrides:
getUserInfoList
in classUserFactory
-
getUserInfos
public IUserInfo getUserInfos(String id)
- Specified by:
getUserInfos
in interfaceIUserFactory
- Overrides:
getUserInfos
in classUserFactory
-
init
public void init(GlobalContext globalContext, javax.servlet.http.HttpSession session)
- Specified by:
init
in interfaceIUserFactory
- Overrides:
init
in classUserFactory
-
isStandardStorage
public boolean isStandardStorage()
Description copied from interface:IUserFactory
check if the user system use standard storage system of wcms- Specified by:
isStandardStorage
in interfaceIUserFactory
- Overrides:
isStandardStorage
in classUserFactory
- Returns:
- true if standard system is used, false else a external system is used.
-
login
public User login(javax.servlet.http.HttpServletRequest request, String login, String password)
- Specified by:
login
in interfaceIUserFactory
- Overrides:
login
in classUserFactory
-
mergeUserInfo
public void mergeUserInfo(IUserInfo userInfo)
- Specified by:
mergeUserInfo
in interfaceIUserFactory
- Overrides:
mergeUserInfo
in classUserFactory
-
releaseUserInfoList
public void releaseUserInfoList()
- Specified by:
releaseUserInfoList
in interfaceIUserFactory
- Overrides:
releaseUserInfoList
in classUserFactory
-
reload
public void reload(GlobalContext globalContext, javax.servlet.http.HttpSession session)
- Specified by:
reload
in interfaceIUserFactory
- Overrides:
reload
in classUserFactory
-
statementToUserInfoList
protected abstract List<IUserInfo> statementToUserInfoList(Statement statement) throws SQLException
- Throws:
SQLException
-
store
public void store()
- Specified by:
store
in interfaceIUserFactory
- Overrides:
store
in classUserFactory
-
updateUserInfo
public void updateUserInfo(IUserInfo userInfo)
- Specified by:
updateUserInfo
in interfaceIUserFactory
- Overrides:
updateUserInfo
in classUserFactory
-
getRoleWrapper
public RoleWrapper getRoleWrapper(ContentContext ctx, User user)
- Specified by:
getRoleWrapper
in interfaceIUserFactory
- Overrides:
getRoleWrapper
in classUserFactory
-
-