com.bemoko.live.platform.content.dao
Class ProfileDao

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by com.bemoko.commons.dao.BemokoHibernateDaoSupport<M,N>
              extended by com.bemoko.live.platform.content.dao.LiveHibernateDaoSupport<Profile,String>
                  extended by com.bemoko.live.platform.content.dao.ProfileDao
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean

public class ProfileDao
extends LiveHibernateDaoSupport<Profile,String>


Field Summary
 
Fields inherited from class com.bemoko.commons.dao.BemokoHibernateDaoSupport
fromString
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
ProfileDao()
           
ProfileDao(org.hibernate.SessionFactory sessionFactory)
           
 
Method Summary
 void assignDefaultCredentials(Profile profile, String username, String password)
           
 Profile create()
           
 Profile createWithDefaultCredentialsAndSave(String username, String password)
           
 Profile createWithDefaultCredentialsAndSaveAndFlush(String username, String password)
           
 void deleteWithDefaultCredentials(Profile profile)
          Delete the profile along with any credentials they may have defined in the default authentication domain
 Profile get(String domain, String containerUid)
          Load a profile from the global identity referenced by the domain and the container UID
 CredentialsDao getCredentialsDao()
           
 Profile getFromDefaultCredentials(String containerUid)
           
 GlobalIdentityDao getGlobalIdentityDao()
           
 int getLastAccessedPersistPeriod()
           
 void populateProfile(ActiveUser user, com.bemoko.live.platform.context.LiveContextParameters contextParameters)
          Populate the active user context with user profile information.
 void populateProfile(com.bemoko.live.platform.context.identity.LocalIdentity identity)
           
 void setCredentialsDao(CredentialsDao credentialsDao)
           
 void setGlobalIdentityDao(GlobalIdentityDao globalIdentityDao)
           
 void setLastAccessedPersistPeriod(int lastAccessedPersistPeriod)
          Set the time period in seconds which the last accessed time won't be updated if the last accessed time is less than that period a go.
 void sync(com.bemoko.live.platform.context.identity.LocalIdentity identity)
          Deprecated. sync functionality is not necessary now that profile information is loaded within in each interaction (albeit via a secondary layer cache)
 boolean updateLastAccessed(Profile profile)
           
 
Methods inherited from class com.bemoko.live.platform.content.dao.LiveHibernateDaoSupport
syncAndFlush
 
Methods inherited from class com.bemoko.commons.dao.BemokoHibernateDaoSupport
contains, create, createAndSave, createAndSave, createAndSaveAndFlush, createAndSaveAndFlush, delete, delete, deleteAndFlush, deleteAndFlush, deleteForce, deleteForce, deleteForceAndFlush, deleteForceAndFlush, deleteWhere, deleteWhereDirect, execute, executeSQL, find, find, findFirst, findFirstWhere, findFirstWhereWithSubsetFromAll, findWhere, findWhereWithSubsetFromAll, flush, get, getCount, getCountWhere, getDomainClass, getFirstOrNull, getFromString, getIdentifierValue, getOrCreate, getOrCreateAndSave, getTableName, getValidator, initDao, isUsingQueries, load, merge, mergeAndFlush, reget, reload, save, saveAndFlush, saveOrUpdate, saveOrUpdateAndFlush, selectSQL, setUsingQueries, setValidator, sync, update, updateAndFlush, validate, validateAndSave, validateAndSaveAndFlush
 
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProfileDao

public ProfileDao()

ProfileDao

public ProfileDao(org.hibernate.SessionFactory sessionFactory)
Method Detail

create

public Profile create()
Overrides:
create in class BemokoHibernateDaoSupport<Profile,String>

setLastAccessedPersistPeriod

public void setLastAccessedPersistPeriod(int lastAccessedPersistPeriod)
Set the time period in seconds which the last accessed time won't be updated if the last accessed time is less than that period a go.

Parameters:
lastAccessedPersistPeriod -

getLastAccessedPersistPeriod

public int getLastAccessedPersistPeriod()

get

public Profile get(String domain,
                   String containerUid)
Load a profile from the global identity referenced by the domain and the container UID


getFromDefaultCredentials

public Profile getFromDefaultCredentials(String containerUid)

sync

@Deprecated
public void sync(com.bemoko.live.platform.context.identity.LocalIdentity identity)
Deprecated. sync functionality is not necessary now that profile information is loaded within in each interaction (albeit via a secondary layer cache)

Sync the profile in the identity with the persistent store

Parameters:
identity -

populateProfile

public void populateProfile(ActiveUser user,
                            com.bemoko.live.platform.context.LiveContextParameters contextParameters)
Populate the active user context with user profile information. This gets the model ready for plugins and FreeMarker.

Parameters:
user -
contextParameters -

populateProfile

public void populateProfile(com.bemoko.live.platform.context.identity.LocalIdentity identity)

updateLastAccessed

public boolean updateLastAccessed(Profile profile)

createWithDefaultCredentialsAndSave

public Profile createWithDefaultCredentialsAndSave(String username,
                                                   String password)
                                            throws UnsupportedEncodingException,
                                                   LiveException
Throws:
UnsupportedEncodingException
LiveException

assignDefaultCredentials

public void assignDefaultCredentials(Profile profile,
                                     String username,
                                     String password)
                              throws UnsupportedEncodingException,
                                     LiveException
Throws:
UnsupportedEncodingException
LiveException

createWithDefaultCredentialsAndSaveAndFlush

public Profile createWithDefaultCredentialsAndSaveAndFlush(String username,
                                                           String password)
                                                    throws UnsupportedEncodingException,
                                                           LiveException
Throws:
UnsupportedEncodingException
LiveException

deleteWithDefaultCredentials

public void deleteWithDefaultCredentials(Profile profile)
Delete the profile along with any credentials they may have defined in the default authentication domain

Parameters:
profile -

getCredentialsDao

public CredentialsDao getCredentialsDao()

setCredentialsDao

public void setCredentialsDao(CredentialsDao credentialsDao)

getGlobalIdentityDao

public GlobalIdentityDao getGlobalIdentityDao()

setGlobalIdentityDao

public void setGlobalIdentityDao(GlobalIdentityDao globalIdentityDao)