Package 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 (må, 06 apr 2009) $
-
Method Summary
Modifier and Type Method Description 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 theLocation
the items is stored at.String
getQuotaTypeSystemId()
Get theQuotaType
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.AccessControlled
checkPermission, getPermissions, hasPermission
Methods inherited from interface net.sf.basedb.core.Identifiable
getId, getType, getVersion
Methods inherited from interface net.sf.basedb.core.Ownable
getOwner, isOwner, setOwner, takeOwnership
-
Method Details
-
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 ifuseDifference()
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 theLocation
the items is stored at.- Returns:
- The location
-
getQuotaTypeSystemId
String getQuotaTypeSystemId()Get theQuotaType
system id of this item. It is not allowed to return theQuotaType.TOTAL
quota type.- Returns:
- The systemid of the QuotaType
-