Package com.im.df.impl.db.persist
Class IJCUserLoginServiceImpl
- java.lang.Object
-
- com.im.df.impl.db.persist.IJCUserLoginServiceImpl
-
- All Implemented Interfaces:
com.im.df.api.capabilities.IJCUserLoginService,com.im.df.api.capabilities.SchemaServiceCapability,com.im.df.api.ddl.DFCapability,IJCUserLoginServiceEx
- Direct Known Subclasses:
IJCUserLoginServiceAdminImpl
public class IJCUserLoginServiceImpl extends Object implements com.im.df.api.capabilities.IJCUserLoginService, IJCUserLoginServiceEx
- Author:
- Tim Dudgeon
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringSCHEMA_EDITING_LOCK_KEY
-
Constructor Summary
Constructors Constructor Description IJCUserLoginServiceImpl(String schemaId, com.im.commons.db.DatabasePlatform platform)Creates a new instance of IJCUserLoginServiceImpl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringfindCurrentDDLLockOwner()List<com.im.df.api.support.DFUserLoginInfo>getAllLogins()protected com.im.ijcs.api.ddl.DDLServicegetDdlService()protected com.chemaxon.ijc.db.dao.schema.api.IjcItemInventoryDaogetItemInventoryDao()com.im.df.api.support.DFUserLoginInfogetLogin(String username)com.im.ijcs.api.util.DFUsergetMe()org.springframework.security.core.GrantedAuthority[]getMyRoles()protected StringgetSchemaId()protected com.chemaxon.ijc.db.dao.schema.api.IjcUserLoginDaogetUserLoginDao()voidinjectWhoAmI(String username, org.springframework.security.core.GrantedAuthority[] roles)TODO P4 - This is internal implementation method and TEMPORARY solution only - it should be passed to constructor.voidinvalidate()This method should be called when schema is beeing deleted.voidlockSchemaDDL()voidloginMe()Mark the user as logged in.voidlogoutMe()voidsetDdlService(com.im.ijcs.api.ddl.DDLService ddlService)voidunlockSchemaDDL()StringwhoAmI()
-
-
-
Field Detail
-
SCHEMA_EDITING_LOCK_KEY
protected static final String SCHEMA_EDITING_LOCK_KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
IJCUserLoginServiceImpl
public IJCUserLoginServiceImpl(String schemaId, com.im.commons.db.DatabasePlatform platform)
Creates a new instance of IJCUserLoginServiceImpl.
-
-
Method Detail
-
getDdlService
protected final com.im.ijcs.api.ddl.DDLService getDdlService()
-
getSchemaId
protected final String getSchemaId()
-
getAllLogins
@Transactional(readOnly=true) public final List<com.im.df.api.support.DFUserLoginInfo> getAllLogins()
- Specified by:
getAllLoginsin interfacecom.im.df.api.capabilities.IJCUserLoginService
-
getLogin
@Transactional(readOnly=true) public final com.im.df.api.support.DFUserLoginInfo getLogin(String username)
- Specified by:
getLoginin interfacecom.im.df.api.capabilities.IJCUserLoginService
-
whoAmI
public final String whoAmI()
- Specified by:
whoAmIin interfacecom.im.df.api.capabilities.IJCUserLoginService
-
getMyRoles
public final org.springframework.security.core.GrantedAuthority[] getMyRoles()
- Specified by:
getMyRolesin interfacecom.im.df.api.capabilities.IJCUserLoginService
-
getMe
public final com.im.ijcs.api.util.DFUser getMe()
- Specified by:
getMein interfacecom.im.df.api.capabilities.IJCUserLoginService
-
injectWhoAmI
public final void injectWhoAmI(String username, org.springframework.security.core.GrantedAuthority[] roles)
TODO P4 - This is internal implementation method and TEMPORARY solution only - it should be passed to constructor. Tim, is it possible to do it? We would probably need to update application context after user specifies username? [Petr H.] No, not a good solution, as this assumes username is known at the start and is constant throughout life cycle, which would be a bad assumption. This information should not be obtained from the service [Tim].- Specified by:
injectWhoAmIin interfaceIJCUserLoginServiceEx
-
invalidate
public void invalidate()
This method should be called when schema is beeing deleted. Once this flag is set then it's impossible to change it back to valid again. This validity flag is used during logout - invalid schema doesn't clean its DDL lock, because this is happening when the IJC metadata DB table is already deleted from database. See FS#6739- Specified by:
invalidatein interfaceIJCUserLoginServiceEx
-
getUserLoginDao
protected final com.chemaxon.ijc.db.dao.schema.api.IjcUserLoginDao getUserLoginDao()
-
getItemInventoryDao
protected final com.chemaxon.ijc.db.dao.schema.api.IjcItemInventoryDao getItemInventoryDao()
-
loginMe
public final void loginMe()
Mark the user as logged in. If the user does not have an entry in IJC_USER table then one will be created.- Specified by:
loginMein interfaceIJCUserLoginServiceEx- Throws:
AlreadyLoggedException
-
logoutMe
public final void logoutMe()
- Specified by:
logoutMein interfaceIJCUserLoginServiceEx
-
findCurrentDDLLockOwner
public final String findCurrentDDLLockOwner()
- Specified by:
findCurrentDDLLockOwnerin interfacecom.im.df.api.capabilities.IJCUserLoginService
-
lockSchemaDDL
public final void lockSchemaDDL()
- Specified by:
lockSchemaDDLin interfaceIJCUserLoginServiceEx
-
unlockSchemaDDL
public final void unlockSchemaDDL()
- Specified by:
unlockSchemaDDLin interfaceIJCUserLoginServiceEx
-
setDdlService
public final void setDdlService(com.im.ijcs.api.ddl.DDLService ddlService)
-
-