public class DiskUsage extends BasicItem<DiskUsageData>
DiskConsumable
items. The creation, updating
and deletion of items of this type is handled entirely by Base
using the data package.
For each DiskConsuming
item there is a corresponding
item of this type.DiskUsageData
Modifier and Type | Field and Description |
---|---|
private DiskConsumable |
item
The item this diks usage information belongs to.
|
static Item |
TYPE
The type of item represented by this class.
|
Constructor and Description |
---|
DiskUsage(DiskUsageData data)
Create a new
DiskUsage item. |
Modifier and Type | Method and Description |
---|---|
long |
getBytes()
Get the number of bytes the
DiskConsumable
item is using. |
Group |
getGroup()
Get the group that owns the
DiskConsumable item or null
if ther is none. |
DiskConsumable |
getItem()
Get the item this disk usage holds information for
|
Item |
getItemType()
Get the
Item type of the item this annotation set belongs to. |
Location |
getLocation()
Get the location of the
DiskConsumable item. |
static ItemQuery<DiskUsage> |
getQuery(User user,
Group group)
Get a query configured to retrieve disk usage for the specified user.
|
QuotaType |
getQuotaType()
Get the
QuotaType the DiskConsumable item is using. |
static DiskUsageStatistics |
getStatistics(DbControl dc) |
Item |
getType()
Get the type of item represented by the object.
|
User |
getUser()
Get the user that owns the
DiskConsumable item. |
Set<ItemProxy> |
getUsingItems()
Get the item this disk usage information belongs to.
|
(package private) void |
initPermissions(int granted,
int denied)
READ permission is granted if the logged in user is the owner of this
disk usage.
|
boolean |
isUsed()
Check if this item is used by some other item.
|
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate
public static final Item TYPE
Item.DISKUSAGE
,
getType()
private DiskConsumable item
DiskUsage(DiskUsageData data)
DiskUsage
item.data
- The data class for this item.public static ItemQuery<DiskUsage> getQuery(User user, Group group)
user
- The user to retreive disk usage for, null is allowed if
the logged in user has generic READ permission for disk usage in which case
all items will be returnedgroup
- The group to retrieve the disk usage forItemQuery
objectpublic static DiskUsageStatistics getStatistics(DbControl dc)
public Item getType()
Identifiable
Item
enumeration.public boolean isUsed()
BasicItem
super.isUsed()
, unless it has decided
that the item is used by some other means.isUsed
in class BasicItem<DiskUsageData>
BasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems()
getUsingItems
in class BasicItem<DiskUsageData>
BasicItem.addUsingItems(Set, Item, org.hibernate.Query)
void initPermissions(int granted, int denied) throws BaseException
initPermissions
in class BasicItem<DiskUsageData>
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclassBaseException
- If the permissions couldn't be initialisedpublic DiskConsumable getItem() throws PermissionDeniedException, BaseException
DiskConsumable
itemPermissionDeniedException
- If the logged in user doesn't have
read permission to the itemBaseException
- If there is another errorpublic Item getItemType()
Item
type of the item this annotation set belongs to.public QuotaType getQuotaType() throws BaseException
QuotaType
the DiskConsumable
item is using.DiskUsage
item.BaseException
- If there is any errorpublic Location getLocation()
DiskConsumable
item.Location
of this DiskUsage
item.public long getBytes()
DiskConsumable
item is using.DiskUsage
item.public User getUser() throws BaseException
DiskConsumable
item.user
BaseException
- If there is any errorpublic Group getGroup() throws BaseException
DiskConsumable
item or null
if ther is none.group
BaseException
- If there is any error