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
AttributesStore
getCurrentDataUsageByUser
in interface AttributesStore
PersistenceException
public long getDataLimitByUser(String username) throws PersistenceException
AttributesStore
getDataLimitByUser
in interface AttributesStore
PersistenceException
public void updateUserDataUsage(String username, long newDataUsage) throws PersistenceException
AttributesStore
updateUserDataUsage
in interface AttributesStore
PersistenceException
public void setDataUsage(String username, long dataUsage) throws PersistenceException
AttributesStore
setDataUsage
in interface AttributesStore
PersistenceException
public void setDataLimit(String username, long dataLimit) throws PersistenceException
AttributesStore
setDataLimit
in interface AttributesStore
PersistenceException
public List<Map<String,Object>> getAllUsers() throws PersistenceException
AttributesStore
getAllUsers
in interface AttributesStore
PersistenceException
public void resetUserDataUsages() throws PersistenceException
AttributesStore
resetUserDataUsages
in interface AttributesStore
PersistenceException
This work is licensed under a Creative Commons Attribution 4.0 International License.