2.17.2: 2011-06-17

net.sf.basedb.core
Interface DiskConsumable

All Superinterfaces:
AccessControlled, Controlled, Identifiable, Ownable
All Known Implementing Classes:
Experiment, File, RawBioAssay

public interface DiskConsumable
extends Controlled, Ownable

This interface is implemented by items that can use a lot of disk space. This interface directs the DbControl object to check the logged in users quota before saving or updating items.

Version:
2.0
Author:
Nicklas
Last modified
$Date: 2009-04-06 14:52:39 +0200 (Mon, 06 Apr 2009) $

Method Summary
 long getBytes()
          Get the absolute number of bytes this item uses.
 long getDifference()
          Get the number of bytes this items now is using compared to when it was loaded from the database.
 Location getLocation()
          Get the Location the items is stored at.
 String getQuotaTypeSystemId()
          Get the QuotaType system id of this item.
 boolean useDifference()
          If this item reports the difference in used bytes or the absolute number.
 
Methods inherited from interface net.sf.basedb.core.Ownable
getOwner, isOwner, setOwner, takeOwnership
 
Methods inherited from interface net.sf.basedb.core.Identifiable
getId, getType, getVersion
 
Methods inherited from interface net.sf.basedb.core.AccessControlled
checkPermission, getPermissions, hasPermission
 

Method Detail

useDifference

boolean useDifference()
If this item reports the difference in used bytes or the absolute number.

Returns:
TRUE if the item reports the difference, FALSE if it reports the absolute
See Also:
getBytes(), getDifference()

getBytes

long getBytes()
Get the absolute number of bytes this item uses. All items must report this number.

Returns:
The absolute number of bytes the item uses
See Also:
useDifference(), getDifference()

getDifference

long getDifference()
Get the number of bytes this items now is using compared to when it was loaded from the database. This number may be negative if the item is now using less bytes than before. An item doesn't have to report this value if useDifference() returns FALSE.

Returns:
The difference in bytes between now and when the item was loaded, or 0 if this item doesn't report differences

getLocation

Location getLocation()
Get the Location the items is stored at.

Returns:
The location

getQuotaTypeSystemId

String getQuotaTypeSystemId()
Get the QuotaType system id of this item. It is not allowed to return the QuotaType.TOTAL quota type.

Returns:
The systemid of the QuotaType

2.17.2: 2011-06-17