|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.DiskUsageStatistics
public class DiskUsageStatistics
Get disk usage statistics for the BASE server. The statistics
information is lazily loaded and internally cached. Ie. calling
getSummary(User)
only hits the database the first time the
method is called for a user. Use the reset()
method to clear
the internal cache.
You can control how long summaries are cached by setting a maximum age
with the setMaxAge(int)
method.
DiskUsage.getStatistics(DbControl)
Nested Class Summary | |
---|---|
class |
DiskUsageStatistics.Summary
Holds summary disk usage information for the total disk usage or for a specific user or group. |
Field Summary | |
---|---|
private DbControl |
dc
|
private int |
maxAge
|
private List<QuotaType> |
quotaTypes
|
private Map<Object,DiskUsageStatistics.Summary> |
summaries
|
private static Long |
ZERO
|
Constructor Summary | |
---|---|
DiskUsageStatistics(DbControl dc)
Create a new disk usage statistics object. |
Method Summary | |
---|---|
int |
getMaxAge()
Get the max age in seconds for a disk usage summary object before it is reloaded from the database again. |
List<QuotaType> |
getQuotaTypes()
Get the list of quota types that are registered for DiskConsumable
items. |
DiskUsageStatistics.Summary |
getSummary(Group group)
Get a summary of the disk usage for the specified group. |
DiskUsageStatistics.Summary |
getSummary(User user)
Get a summary of the disk usage for the specified user. |
DiskUsageStatistics.Summary |
getTotalSummary()
Get a summary of the total disk usage. |
void |
reset()
Reset the internal cache of already loaded statistics. |
void |
setDbControl(DbControl dc)
Set the DbControl which will be used to get statisics if it is not cached. |
void |
setMaxAge(int maxAge)
Set the max age in seconds for a disk usage summary object before it is reloaded from the database again. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Long ZERO
private DbControl dc
private Map<Object,DiskUsageStatistics.Summary> summaries
private List<QuotaType> quotaTypes
private int maxAge
Constructor Detail |
---|
DiskUsageStatistics(DbControl dc)
Method Detail |
---|
public void setDbControl(DbControl dc)
dc
- An open DbControl objectpublic void setMaxAge(int maxAge)
maxAge
- Number of seconds to keep summary in the cache,
or zero to disable the cache or a negative value to cache
foreverpublic int getMaxAge()
public void reset()
public List<QuotaType> getQuotaTypes()
DiskConsumable
items.
public DiskUsageStatistics.Summary getTotalSummary()
public DiskUsageStatistics.Summary getSummary(User user)
user
- The user to get the disk usage for
public DiskUsageStatistics.Summary getSummary(Group group)
group
- The group to get the disk usage for
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |