public class AttributesStoreImpl extends Object implements AttributesStore
DATA_USAGE_KEY, DATA_USAGE_LIMIT_KEY, USER_KEY| Constructor and Description |
|---|
AttributesStoreImpl(PersistentStore persistentStore) |
| Modifier and Type | Method and Description |
|---|---|
List<Map<String,Object>> |
getAllUsers()
Gets a list of all users and their attributes
|
long |
getCurrentDataUsageByUser(String username)
Returns the user's current data usage from the persistent store
|
long |
getDataLimitByUser(String username)
Returns the user's current data limit from the persistent store
|
void |
resetUserDataUsages()
Resets all known user's data usages to 0.
|
void |
setDataLimit(String username,
long dataLimit)
Resets the user's data limit in the persistent store to the size specified in bytes
|
void |
setDataUsage(String username,
long dataUsage)
Resets the user's data usage in the persistent store to the usage specified in bytes
|
void |
updateUserDataUsage(String username,
long newDataUsage)
Adds the specified data usage in bytes to the user's data usage in the persistent store
|
public AttributesStoreImpl(PersistentStore persistentStore)
public long getCurrentDataUsageByUser(String username) throws PersistenceException
AttributesStoregetCurrentDataUsageByUser in interface AttributesStorePersistenceExceptionpublic long getDataLimitByUser(String username) throws PersistenceException
AttributesStoregetDataLimitByUser in interface AttributesStorePersistenceExceptionpublic void updateUserDataUsage(String username, long newDataUsage) throws PersistenceException
AttributesStoreupdateUserDataUsage in interface AttributesStorePersistenceExceptionpublic void setDataUsage(String username, long dataUsage) throws PersistenceException
AttributesStoresetDataUsage in interface AttributesStorePersistenceExceptionpublic void setDataLimit(String username, long dataLimit) throws PersistenceException
AttributesStoresetDataLimit in interface AttributesStorePersistenceExceptionpublic List<Map<String,Object>> getAllUsers() throws PersistenceException
AttributesStoregetAllUsers in interface AttributesStorePersistenceExceptionpublic void resetUserDataUsages()
throws PersistenceException
AttributesStoreresetUserDataUsages in interface AttributesStorePersistenceExceptionThis work is licensed under a Creative Commons Attribution 4.0 International License.