E
- The specific Account implementationpublic abstract class AbstractAccountsManager<E extends Account> extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<String,E> |
accountsMap
The map that contains all statistics
|
protected org.apache.log4j.Logger |
logger
The logger provided by sub-classes
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractAccountsManager(String refreshThreadName,
org.apache.log4j.Logger logger) |
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
This methods performs a full refresh from database.
|
E |
getAccount(String username)
Returns the accounts for the user specified by its username
|
int |
getCacheValidityTimeInSeconds()
Returns the refresh rate of the accounts refresher.
|
abstract int |
getDefaultCacheValidityTimeInSeconds()
Returns the default value of the accounts refresher.
|
long |
getLastRefreshDurationInMilliseconds()
Returns the duration of the last refresh performed by the account refresher.
|
protected abstract E |
readAccount(String username)
Reads account information from the data base
|
void |
setCacheValidityTimeInSeconds(int cacheValidTimeInSeconds)
Sets the refresh rate of the accounts refresher.
|
protected final org.apache.log4j.Logger logger
protected AbstractAccountsManager(String refreshThreadName, org.apache.log4j.Logger logger)
protected abstract E readAccount(String username)
username
- the name of the user for which account is readpublic E getAccount(String username)
username
- the name of the userpublic void clearCache()
public void setCacheValidityTimeInSeconds(int cacheValidTimeInSeconds)
cacheValidTimeInSeconds
- the refresh ratepublic int getCacheValidityTimeInSeconds()
public abstract int getDefaultCacheValidityTimeInSeconds()
public long getLastRefreshDurationInMilliseconds()