2.17.2: 2011-06-17

net.sf.basedb.core
Class DataCubeLayer

java.lang.Object
  extended by net.sf.basedb.core.BasicItem<D>
      extended by net.sf.basedb.core.ChildItem<DataCubeLayerData>
          extended by net.sf.basedb.core.DataCubeLayer
All Implemented Interfaces:
AccessControlled, Identifiable

public class DataCubeLayer
extends ChildItem<DataCubeLayerData>

This represents the layer coordinate in a data cube. A BioAssaySet must have a link to an item of this type. It is possible for more than one bioassayset to link to the same layer. This item keeps track of two important things. The layer coordinate number and the number of bytes the data in this layer occupies on disk. The number of bytes is reported up to the Experiment which is the item that handles user quota.

Version:
2.0
Author:
Nicklas
See Also:
DataCube, BioAssaySet.getDataCubeLayer(), BioAssaySet.getDataCubeLayerNo()
Last modified
$Date: 2009-04-06 14:52:39 +0200 (Mon, 06 Apr 2009) $

Field Summary
static Item TYPE
          The type of item represented by this class.
 
Constructor Summary
DataCubeLayer(DataCubeLayerData data)
          Creates a new data cube item from the given data.
 
Method Summary
(package private)  void addBytes(long bytes)
           
static DataCubeLayer getById(DbControl dc, int id)
          Get a DataCubeLayer item when you know the id.
 long getBytes()
          Get the number of bytes the data stored in this layer occupies on disk.
 DataCube getDataCube()
          Get the data cube this layer belongs to.
 short getDataCubeNo()
          Get the number of the data cube this layer belongs to.
 short getLayerNo()
          Get the number of this layer.
(package private) static DataCubeLayer getNew(DbControl dc, DataCube cube)
          Create a new DataCubeLayer 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.
(package private)  VirtualDb getVirtualDb()
          Get the virtual database this layer belongs to.
(package private)  void onBeforeCommit(Transactional.Action action)
          Delete data and update disk usage information on the experiment if action == Action.DELETE
private  void setDataCube(DataCube cube)
          Set the data cube.
private  void setLayerNo(short layerNo)
           
 
Methods inherited from class net.sf.basedb.core.ChildItem
getPluginPermissions, initPermissions
 
Methods inherited from class net.sf.basedb.core.BasicItem
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static final Item TYPE
The type of item represented by this class.

See Also:
Item.DATACUBELAYER, getType()
Constructor Detail

DataCubeLayer

DataCubeLayer(DataCubeLayerData data)
Creates a new data cube item from the given data.

Parameters:
data - the data
Method Detail

getNew

static DataCubeLayer getNew(DbControl dc,
                            DataCube cube)
                     throws BaseException
Create a new DataCubeLayer item.

Parameters:
dc - The DbControl which will be used for permission checking and database access.
cube - The cube the new layer is located in
Returns:
The new DataCubeLayer item
Throws:
BaseException - If there is an error

getById

public static DataCubeLayer getById(DbControl dc,
                                    int id)
                             throws ItemNotFoundException,
                                    PermissionDeniedException,
                                    BaseException
Get a DataCubeLayer item when you know the id.

Parameters:
dc - The DbControl which will be used for permission checking and database access.
id - The id of the item to load
Returns:
The DataCubeLayer item
Throws:
ItemNotFoundException - If an item with the specified id is not found
PermissionDeniedException - If the logged in user doesn't have Permission.READ permission to the item
BaseException - If there is another error

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 the Item 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 class BasicItem<DataCubeLayerData>
Throws:
BaseException - If there is an error
See Also:
Transactional, Core API overview - Transaction handling, Coding rules and guidelines for item classes

getSharedParent

SharedData getSharedParent()
Get the experiment.

Specified by:
getSharedParent in class ChildItem<DataCubeLayerData>
Returns:
The parent item

getPermissionForWriteDeleteAndCreate

Permission getPermissionForWriteDeleteAndCreate()
USE permission is enough to be able to manage data cubes.

Overrides:
getPermissionForWriteDeleteAndCreate in class ChildItem<DataCubeLayerData>

getDataCube

public DataCube getDataCube()
                     throws PermissionDeniedException,
                            BaseException
Get the data cube this layer belongs to.

Returns:
A DataCube object
Throws:
PermissionDeniedException - If the logged in user doesn't have read permission to the item
BaseException - If there is another error

setDataCube

private void setDataCube(DataCube cube)
Set the data cube. This cannot be changed after the filter has been created.


getDataCubeNo

public short getDataCubeNo()
Get the number of the data cube this layer belongs to.


getLayerNo

public short getLayerNo()
Get the number of this layer.


setLayerNo

private void setLayerNo(short layerNo)

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 layer belongs to.


2.17.2: 2011-06-17