Class DatabaseRemember
java.lang.Object
rife.database.DbQueryManager
rife.authentication.remembermanagers.DatabaseRemember
- All Implemented Interfaces:
Cloneable
,RememberManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
_createRememberId
(Insert createRememberId, long userId) protected void
_eraseAllRememberIds
(Delete eraseAllRememberIds) protected boolean
_eraseRememberId
(Delete eraseRememberId, String rememberId) protected boolean
_eraseUserRememberIds
(Delete eraseUserRememberIds, long userId) protected long
_getRememberedUserId
(Select getRememberedUserId, String rememberId) protected boolean
_install
(CreateTable createRemember, String createRememberMomentIndex) protected void
_purgeRememberIds
(Delete purgeRememberIds) protected boolean
long
Obtains the maximum time that a remember ID can be used before it becomes invalid.int
Obtains the frequency at which the purging will happen in relationship to the scale.int
Obtains the scale at which the purging will happen in relationship to the frequency.abstract boolean
install()
abstract boolean
remove()
void
setRememberDuration
(long milliseconds) Sets the maximum time that a remember ID can be used before it becomes invalid.void
setRememberPurgeFrequency
(int frequency) Set the frequency at which the purging will happen in relationship to the scale.void
setRememberPurgeScale
(int scale) Set the scale at which the purging will happen in relationship to the frequency.Methods inherited from class rife.database.DbQueryManager
clone, executeFetchAll, executeFetchAll, executeFetchAll, executeFetchAll, executeFetchAllBeans, executeFetchAllBeans, executeFetchFirst, executeFetchFirst, executeFetchFirst, executeFetchFirst, executeFetchFirstBean, executeFetchFirstBean, executeGetFirstBoolean, executeGetFirstBoolean, executeGetFirstByte, executeGetFirstByte, executeGetFirstBytes, executeGetFirstBytes, executeGetFirstDate, executeGetFirstDate, executeGetFirstDate, executeGetFirstDate, executeGetFirstDouble, executeGetFirstDouble, executeGetFirstFloat, executeGetFirstFloat, executeGetFirstInt, executeGetFirstInt, executeGetFirstLong, executeGetFirstLong, executeGetFirstShort, executeGetFirstShort, executeGetFirstString, executeGetFirstString, executeGetFirstTime, executeGetFirstTime, executeGetFirstTime, executeGetFirstTime, executeGetFirstTimestamp, executeGetFirstTimestamp, executeGetFirstTimestamp, executeGetFirstTimestamp, executeHasResultRows, executeHasResultRows, executeQuery, executeQuery, executeResultQuery, executeUpdate, executeUpdate, executeUpdate, executeUseFirstAsciiStream, executeUseFirstAsciiStream, executeUseFirstBinaryStream, executeUseFirstBinaryStream, executeUseFirstCharacterStream, executeUseFirstCharacterStream, fetch, fetch, fetch, fetchAll, fetchAll, getConnection, getDatasource, inTransaction, inTransaction, reserveConnection
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface rife.authentication.RememberManager
createRememberId, eraseAllRememberIds, eraseRememberId, eraseUserRememberIds, getRememberedUserId, purgeRememberIds
-
Constructor Details
-
DatabaseRemember
-
-
Method Details
-
getRememberDuration
public long getRememberDuration()Description copied from interface:RememberManager
Obtains the maximum time that a remember ID can be used before it becomes invalid.- Specified by:
getRememberDuration
in interfaceRememberManager
- Returns:
- The maximum lifetime in milliseconds.
-
setRememberDuration
public void setRememberDuration(long milliseconds) Description copied from interface:RememberManager
Sets the maximum time that a remember ID can be used before it becomes invalid.- Specified by:
setRememberDuration
in interfaceRememberManager
- Parameters:
milliseconds
- The lifetime in milliseconds.
-
getRememberPurgeFrequency
public int getRememberPurgeFrequency()Description copied from interface:RememberManager
Obtains the frequency at which the purging will happen in relationship to the scale.This defaults to
RifeConfig.AuthenticationConfig.getRememberPurgeFrequency()
.- Specified by:
getRememberPurgeFrequency
in interfaceRememberManager
- Returns:
- the purge frequency
- See Also:
-
setRememberPurgeFrequency
public void setRememberPurgeFrequency(int frequency) Description copied from interface:RememberManager
Set the frequency at which the purging will happen in relationship to the scale.By default, the frequency and scale respectively are 20 and 1000, which means that the purging will have once every fifty times the remember sessions are accessed.
- Specified by:
setRememberPurgeFrequency
in interfaceRememberManager
- Parameters:
frequency
- the purge frequency- See Also:
-
getRememberPurgeScale
public int getRememberPurgeScale()Description copied from interface:RememberManager
Obtains the scale at which the purging will happen in relationship to the frequency.This defaults to
RifeConfig.AuthenticationConfig.getRememberPurgeScale()
.- Specified by:
getRememberPurgeScale
in interfaceRememberManager
- Returns:
- the purge scale
- See Also:
-
setRememberPurgeScale
public void setRememberPurgeScale(int scale) Description copied from interface:RememberManager
Set the scale at which the purging will happen in relationship to the frequency.By default, the frequency and scale respectively are 20 and 1000, which means that the purging will have once every fifty times the remember sessions are accessed.
- Specified by:
setRememberPurgeScale
in interfaceRememberManager
- Parameters:
scale
- the purge scale- See Also:
-
install
- Throws:
RememberManagerException
-
remove
- Throws:
RememberManagerException
-
_install
-
_remove
-
_createRememberId
protected String _createRememberId(Insert createRememberId, long userId) throws RememberManagerException - Throws:
RememberManagerException
-
_eraseRememberId
protected boolean _eraseRememberId(Delete eraseRememberId, String rememberId) throws RememberManagerException - Throws:
RememberManagerException
-
_eraseUserRememberIds
protected boolean _eraseUserRememberIds(Delete eraseUserRememberIds, long userId) throws RememberManagerException - Throws:
RememberManagerException
-
_eraseAllRememberIds
- Throws:
RememberManagerException
-
_getRememberedUserId
protected long _getRememberedUserId(Select getRememberedUserId, String rememberId) throws RememberManagerException - Throws:
RememberManagerException
-
_purgeRememberIds
- Throws:
RememberManagerException
-