2.17.2: 2011-06-17

net.sf.basedb.core
Class ArrayBatch

java.lang.Object
  extended by net.sf.basedb.core.BasicItem<D>
      extended by net.sf.basedb.core.OwnedItem<D>
          extended by net.sf.basedb.core.SharedItem<D>
              extended by net.sf.basedb.core.CommonItem<D>
                  extended by net.sf.basedb.core.AnnotatedItem<ArrayBatchData>
                      extended by net.sf.basedb.core.ArrayBatch
All Implemented Interfaces:
AccessControlled, Annotatable, Identifiable, Nameable, Ownable, Registered, Removable, Shareable

public class ArrayBatch
extends AnnotatedItem<ArrayBatchData>
implements Registered

This class represents the making of a new batch of microarray slides of a particular design.

Version:
2.0
Author:
Enell

Field Summary
private  boolean protocolHasBeenSet
           
private  boolean robotHasBeenSet
           
static Item TYPE
          The type of item represented by this class.
 
Fields inherited from interface net.sf.basedb.core.Nameable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
 
Constructor Summary
ArrayBatch(ArrayBatchData annotatedData)
           
 
Method Summary
 Set<Annotatable> getAnnotatableParents()
          Get the array design.
 ArrayDesign getArrayDesign()
          Get the ArrayDesign item that was used for this batch.
 ItemQuery<ArraySlide> getArraySlides()
          Get a query that returns the slides in this batch.
static ArrayBatch getById(DbControl dc, int id)
          Get a ArrayBatch object when you know the ID.
 Date getEntryDate()
          Get the date that the item was registered in the database.
static ArrayBatch getNew(DbControl dc, ArrayDesign arrayDesign)
          Create a new ArrayBatch item.
 Hardware getPrintRobot()
          Get the print robot used for printing the arrays.
 Protocol getProtocol()
          Get the Protocol used for printing the arrays.
static ItemQuery<ArrayBatch> getQuery()
          Get a ItemQuery that returns array batches.
 Item getType()
          Get the type of item represented by the object.
 Set<ItemProxy> getUsingItems()
          Get all: ArraySlide:s in this batch
 boolean isUsed()
          Check if this item is used by some other item.
 ArraySlide newArraySlide()
          Create a new ArraySlide item for this batch.
private  void setArrayDesign(ArrayDesign arrayDesign)
          Set the ArrayDesign used in this ArrayBatch.
 void setPrintRobot(Hardware printRobot)
          Set the print robot used for this array batch.
(package private)  void setProjectDefaults(Project activeProject)
          Set print robot and protocol from project default settings.
 void setProtocol(Protocol protocol)
          Set the Protocol used for printing the arrays.
 
Methods inherited from class net.sf.basedb.core.AnnotatedItem
getAnnotationSet, isAnnotated, removeAnnotations, toTransferable
 
Methods inherited from class net.sf.basedb.core.CommonItem
getDescription, getName, isRemoved, setDescription, setName, setRemoved, toTransferable
 
Methods inherited from class net.sf.basedb.core.SharedItem
getItemKey, getProjectKey, initPermissions, isShared, onBeforeCommit, setItemKey, setProjectKey, toTransferable
 
Methods inherited from class net.sf.basedb.core.OwnedItem
getOwner, isOwner, setOwner, takeOwnership, toTransferable
 
Methods inherited from class net.sf.basedb.core.BasicItem
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onRollback, setDbControl, toString, toTransferable, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.basedb.core.Identifiable
getId, getVersion
 
Methods inherited from interface net.sf.basedb.core.AccessControlled
checkPermission, getPermissions, hasPermission
 
Methods inherited from interface net.sf.basedb.core.Ownable
getOwner, isOwner, setOwner, takeOwnership
 

Field Detail

TYPE

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

See Also:
Item.ARRAYBATCH, getType()

protocolHasBeenSet

private boolean protocolHasBeenSet

robotHasBeenSet

private boolean robotHasBeenSet
Constructor Detail

ArrayBatch

ArrayBatch(ArrayBatchData annotatedData)
Method Detail

getNew

public static ArrayBatch getNew(DbControl dc,
                                ArrayDesign arrayDesign)
                         throws BaseException
Create a new ArrayBatch item.

Parameters:
dc - The DbControl which will be used for permission checking and database access
arrayDesign - The ArrayDesign used for the batch
Returns:
The new ArrayBatch item
Throws:
PermissionDeniedException - If the logged in user doesn't have create permission for this type of item, or use permission for the design
BaseException - If there is another error

getById

public static ArrayBatch getById(DbControl dc,
                                 int id)
                          throws ItemNotFoundException,
                                 PermissionDeniedException,
                                 BaseException
Get a ArrayBatch object 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 ArrayBatch item
Throws:
ItemNotFoundException - If an item with the specified ID is not found
PermissionDeniedException - If the logged in user doesn't have read permission to the item
BaseException - If there is another error

getQuery

public static ItemQuery<ArrayBatch> getQuery()
Get a ItemQuery that returns array batches.

Returns:
An ItemQuery object

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.

Specified by:
getType in interface Identifiable
Returns:
A value indicating the type of item

getAnnotatableParents

public Set<Annotatable> getAnnotatableParents()
                                       throws BaseException
Get the array design.

Specified by:
getAnnotatableParents in interface Annotatable
Returns:
A set containing annotatable items, or null
Throws:
BaseException - If there is an error

getEntryDate

public Date getEntryDate()
Description copied from interface: Registered
Get the date that the item was registered in the database.

Specified by:
getEntryDate in interface Registered
Returns:
A date or null if this is not known

isUsed

public boolean isUsed()
               throws BaseException
Description copied from class: BasicItem
Check if this item is used by some other item. With used we mean that another item is linking to this item in way that prevents this item from beeing deleted. Ie. if we tried to delete an item that is used, we would get a foreign key violation error from the database. If the subclass overrides this method it should propagate the call to the superclass, ie. super.isUsed(), unless it has decided that the item is used by some other means.

Overrides:
isUsed in class BasicItem<ArrayBatchData>
Returns:
TRUE if this item is used, FALSE otherwise
Throws:
BaseException - If not able to tell if item is used or not.
See Also:
BasicItem.getUsingItems()

getUsingItems

public Set<ItemProxy> getUsingItems()
Get all:

setProjectDefaults

void setProjectDefaults(Project activeProject)
                  throws BaseException
Set print robot and protocol from project default settings.

Overrides:
setProjectDefaults in class BasicItem<ArrayBatchData>
Parameters:
activeProject - The currently active project
Throws:
BaseException
Since:
2.9

getArrayDesign

public ArrayDesign getArrayDesign()
                           throws PermissionDeniedException,
                                  BaseException
Get the ArrayDesign item that was used for this batch.

Returns:
The ArrayDesign item
Throws:
PermissionDeniedException - If the logged in user doesn't have read permission to the item
BaseException - If there is an error

setArrayDesign

private void setArrayDesign(ArrayDesign arrayDesign)
                     throws InvalidDataException,
                            PermissionDeniedException
Set the ArrayDesign used in this ArrayBatch.

Parameters:
arrayDesign - the arrayDesign to be set. Cannot be null.
Throws:
InvalidDataException - if arrayDesign is null.
PermissionDeniedException - If the logged in user doesn't have use permission for the array design.

getProtocol

public Protocol getProtocol()
                     throws PermissionDeniedException,
                            BaseException
Get the Protocol used for printing the arrays.

Specified by:
getProtocol in interface Annotatable
Overrides:
getProtocol in class AnnotatedItem<ArrayBatchData>
Returns:
The Protocol item
Throws:
PermissionDeniedException - If the logged in user doesn't have read permission to the item
BaseException - If there is an error

setProtocol

public void setProtocol(Protocol protocol)
                 throws PermissionDeniedException
Set the Protocol used for printing the arrays.

Parameters:
protocol - A Protocol item of the ProtocolType.PRINTING protocol type
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission on this array batch or use permission for the protocol

getPrintRobot

public Hardware getPrintRobot()
                       throws PermissionDeniedException,
                              BaseException
Get the print robot used for printing the arrays.

Returns:
A Hardware item of type HardwareType.PRINT_ROBOT
Throws:
PermissionDeniedException - If the logged in user doesn't have read permission to the item
BaseException - If there is an error

setPrintRobot

public void setPrintRobot(Hardware printRobot)
                   throws PermissionDeniedException
Set the print robot used for this array batch.

Parameters:
printRobot - A Hardware item of type HardwareType.PRINT_ROBOT
Throws:
PermissionDeniedException - If the logged in user doesn't have write permission on this array batch or use permission for the hardware

newArraySlide

public ArraySlide newArraySlide()
                         throws PermissionDeniedException,
                                BaseException
Create a new ArraySlide item for this batch.

Returns:
The new ArraySlide item
Throws:
PermissionDeniedException - If the logged in user doesn't have use permission for this batch
BaseException - If there is another error

getArraySlides

public ItemQuery<ArraySlide> getArraySlides()
Get a query that returns the slides in this batch.

Returns:
An ItemQuery object

2.17.2: 2011-06-17