Package net.sf.basedb.core
Class DataCubeExtraValue
- java.lang.Object
-
- net.sf.basedb.core.BasicItem
-
- net.sf.basedb.core.ChildItem
-
- net.sf.basedb.core.DataCubeExtraValue
-
- All Implemented Interfaces:
AccessControlled
,Identifiable
public class DataCubeExtraValue extends ChildItem
Represents a set of extra value in a data cube. The value type and coordinate type determines the database table where the extra values are stored. This item keeps track of the number of bytes the extra values occupies on disk. The number of bytes is reported up to theExperiment
which is the item that handles user quota.- Version:
- 2.0
- Author:
- Nicklas
- See Also:
ExtraValue
,ExtraValueType
,SpotExtraValueBatcher
,PositionExtraValueBatcher
,DataCube
- Last modified
- $Date: 2015-04-17 14:02:22 +0200 (fr, 17 apr 2015) $
-
-
Constructor Summary
Constructors Constructor Description DataCubeExtraValue(DataCubeExtraValueData data)
Creates a new data cube item from the given data.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
addBytes(long bytes)
static DataCubeExtraValue
getById(DbControl dc, int id)
Get aDataCubeExtraValue
item when you know the id.long
getBytes()
Get the number of bytes the data stored in this layer occupies on disk.ExtraValue.CoordinateType
getCoordinateType()
Get the coordinate type the extra values are attached to.(package private) DataCubeExtraValueData
getData()
Get theBasicData
object that holds all data for this item.DataCube
getDataCube()
Get the data cube this extra value belongs to.short
getDataCubeNo()
Get the number of the data cube this extra value belongs to.short
getExtraNo()
Get the extra value number.(package private) static DataCubeExtraValue
getNew(DbControl dc, DataCube cube, Type valueType, ExtraValue.CoordinateType coordinateType)
Create a newDataCubeExtraValue
item.(package private) Permission
getPermissionForWriteDeleteAndCreate()
USE permission is enough to be able to manage data cubes.(package private) SharedData
getSharedParent()
Get the experiment.Item
getType()
Get the type of item represented by the object.Type
getValueType()
Get the value type of the extra values.(package private) VirtualDb
getVirtualDb()
Get the virtual database this extra value belongs to.(package private) VirtualTable
getVirtualTable()
Get the virtual table this extra value stores it's data in.(package private) void
onBeforeCommit(Transactional.Action action)
Delete data and update disk usage information on the experiment if action == Action.DELETEprivate void
setCoordinateType(ExtraValue.CoordinateType coordinateType)
Set the coordinate type.private void
setDataCube(DataCube cube)
Set the data cube.private void
setExtraNo(short extraNo)
private void
setValueType(Type valueType)
Set the value type.-
Methods inherited from class net.sf.basedb.core.ChildItem
getPermissionForUse, getPluginPermissions, initPermissions
-
Methods inherited from class net.sf.basedb.core.BasicItem
addAnnotatableParents, addUsingItems, addUsingItems, breakCircularReferences, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, validate
-
-
-
-
Field Detail
-
TYPE
public static final Item TYPE
The type of item represented by this class.- See Also:
Item.DATACUBEEXTRAVALUE
,getType()
-
-
Constructor Detail
-
DataCubeExtraValue
DataCubeExtraValue(DataCubeExtraValueData data)
Creates a new data cube item from the given data.- Parameters:
data
- the data
-
-
Method Detail
-
getNew
static DataCubeExtraValue getNew(DbControl dc, DataCube cube, Type valueType, ExtraValue.CoordinateType coordinateType) throws BaseException
Create a newDataCubeExtraValue
item.- Parameters:
dc
- TheDbControl
which will be used for permission checking and database access.cube
- The cube the new extra value is located invalueType
- The data type of the extra valuescoordinateType
- Which coordinates the extra values should be attached to- Returns:
- The new
DataCubeExtraValue
item - Throws:
BaseException
- If there is an error
-
getById
public static DataCubeExtraValue getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
Get aDataCubeExtraValue
item when you know the id.- Parameters:
dc
- TheDbControl
which will be used for permission checking and database access.id
- The id of the item to load- Returns:
- The
DataCubeExtraValue
item - Throws:
ItemNotFoundException
- If an item with the specified id is not foundPermissionDeniedException
- If the logged in user doesn't havePermission.READ
permission to the itemBaseException
- If there is another error
-
getData
DataCubeExtraValueData getData()
Description copied from class:BasicItem
Get theBasicData
object that holds all data for this item.
-
getType
public Item getType()
Description copied from interface:Identifiable
Get the type of item represented by the object. The returned value is one of the values defined in theItem
enumeration.- Returns:
- A value indicating the type of item
-
onBeforeCommit
void onBeforeCommit(Transactional.Action action) throws BaseException
Delete data and update disk usage information on the experiment if action == Action.DELETE- Overrides:
onBeforeCommit
in classBasicItem
- Throws:
BaseException
- If there is an error- See Also:
Transactional
, Developer documentation: Transactions, Developer documentation: Coding rules and guidelines for item classes
-
getSharedParent
SharedData getSharedParent()
Get the experiment.- Specified by:
getSharedParent
in classChildItem
- Returns:
- The parent item
-
getPermissionForWriteDeleteAndCreate
Permission getPermissionForWriteDeleteAndCreate()
USE permission is enough to be able to manage data cubes.- Overrides:
getPermissionForWriteDeleteAndCreate
in classChildItem
-
getDataCube
public DataCube getDataCube() throws PermissionDeniedException, BaseException
Get the data cube this extra value belongs to.- Returns:
- A
DataCube
object - Throws:
PermissionDeniedException
- If the logged in user doesn't have read permission to the itemBaseException
- If there is another error
-
setDataCube
private void setDataCube(DataCube cube)
Set the data cube. This cannot be changed after the extra value has been created.
-
getCoordinateType
public ExtraValue.CoordinateType getCoordinateType()
Get the coordinate type the extra values are attached to.
-
setCoordinateType
private void setCoordinateType(ExtraValue.CoordinateType coordinateType) throws InvalidDataException
Set the coordinate type. Can't be changed once it has been saved.- Throws:
InvalidDataException
-
getValueType
public Type getValueType()
Get the value type of the extra values.
-
setValueType
private void setValueType(Type valueType) throws InvalidDataException
Set the value type. Can't be changed once it has been saved.- Throws:
InvalidDataException
-
getDataCubeNo
public short getDataCubeNo()
Get the number of the data cube this extra value belongs to.
-
getExtraNo
public short getExtraNo()
Get the extra value number.
-
setExtraNo
private void setExtraNo(short extraNo)
-
getBytes
public long getBytes()
Get the number of bytes the data stored in this layer occupies on disk.
-
addBytes
void addBytes(long bytes)
-
getVirtualDb
VirtualDb getVirtualDb()
Get the virtual database this extra value belongs to.
-
getVirtualTable
VirtualTable getVirtualTable()
Get the virtual table this extra value stores it's data in.
-
-