3.0.4: 2012-03-05

net.sf.basedb.core
Class BioMaterialEventSource

java.lang.Object
  extended by net.sf.basedb.core.BioMaterialEventSource
All Implemented Interfaces:
AccessControlled

public class BioMaterialEventSource
extends Object
implements AccessControlled

Class for holding information about a parent biomaterial that was used in an event that created a child biomaterial or a physical bioassay. Each event may only include the same parent biomaterial once. Permission-wise the information belongs to the BioMaterialEvent and the user has the same permissions as for the event.

Since:
3.0
Author:
Nicklas
Last modified
$Date: 2011-06-20 13:55:13 +0200 (Mon, 20 Jun 2011) $

Nested Class Summary
static class BioMaterialEventSource.BioMaterialEventSourceTransformer
           
 
Field Summary
private  BioMaterialEventSourceData data
           
private  DbControl dc
           
 
Constructor Summary
BioMaterialEventSource(DbControl dc, BioMaterialEventSourceData data)
           
 
Method Summary
 void checkPermission(Permission permission)
          Check if the logged in user has the desired permission on the item, otherwise throw an exception.
 BioMaterial getBioMaterial()
          Get the biomaterial that was used as a source in this event.
 BioMaterialEvent getEvent()
          Get the event that this information belongs to.
 Set<Permission> getPermissions()
          Get the logged in user's permissions on the item.
 int getPosition()
          Get the position that the source biomaterial was used on in the event.
 Float getUsedQuantity()
          Get the quantity that was used from the source biomaterial by the event.
 boolean hasPermission(Permission permission)
          Check if the logged in user has the desired permission on the item.
 void setPosition(int position)
           
 void setUsedQuantity(Float usedQuantity)
          Set the quantity that was used from the source biomaterial by the event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dc

private final DbControl dc

data

private final BioMaterialEventSourceData data
Constructor Detail

BioMaterialEventSource

BioMaterialEventSource(DbControl dc,
                       BioMaterialEventSourceData data)
Method Detail

hasPermission

public boolean hasPermission(Permission permission)
Description copied from interface: AccessControlled
Check if the logged in user has the desired permission on the item.

Specified by:
hasPermission in interface AccessControlled
Parameters:
permission - The permission to check if the user has.
Returns:
TRUE if the user has the permission, FALSE otherwise

checkPermission

public void checkPermission(Permission permission)
                     throws PermissionDeniedException
Description copied from interface: AccessControlled
Check if the logged in user has the desired permission on the item, otherwise throw an exception.

Specified by:
checkPermission in interface AccessControlled
Parameters:
permission - Permission the user should have.
Throws:
PermissionDeniedException - If the user doesn't have the requested permission

getPermissions

public Set<Permission> getPermissions()
Description copied from interface: AccessControlled
Get the logged in user's permissions on the item.

Specified by:
getPermissions in interface AccessControlled

getEvent

public BioMaterialEvent getEvent()
Get the event that this information belongs to.


getBioMaterial

public BioMaterial getBioMaterial()
Get the biomaterial that was used as a source in this event.


getUsedQuantity

public Float getUsedQuantity()
Get the quantity that was used from the source biomaterial by the event.

Returns:
A float, or null if not known

setUsedQuantity

public void setUsedQuantity(Float usedQuantity)
Set the quantity that was used from the source biomaterial by the event. This method call is ignored if the source biomaterial is not a MeasuredBioMaterial.

Parameters:
usedQuantity - The used quantity or null if not known

getPosition

public int getPosition()
Get the position that the source biomaterial was used on in the event.


setPosition

public void setPosition(int position)

3.0.4: 2012-03-05