Package net.sf.basedb.core
Class ArrayBatch
- All Implemented Interfaces:
AccessControlled
,Annotatable
,Identifiable
,Nameable
,Ownable
,Registered
,Removable
,Shareable
This class represents the making of a new batch of microarray
slides of a particular design.
- Version:
- 2.0
- Author:
- Enell
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private boolean
static final Item
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
-
Method Summary
Modifier and TypeMethodDescriptionGet the array design.Get theArrayDesign
item that was used for this batch.Get a query that returns the slides in this batch.static ArrayBatch
Get aArrayBatch
object when you know the ID.(package private) ArrayBatchData
getData()
Get theBasicData
object that holds all data for this item.Get the date that the item was registered in the database.static ArrayBatch
getNew
(DbControl dc, ArrayDesign arrayDesign) Create a newArrayBatch
item.Get theprint robot
used for printing the arrays.Get theProtocol
used for printing the arrays.static ItemQuery<ArrayBatch>
getQuery()
Get aItemQuery
that returns array batches.getType()
Get the type of item represented by the object.Get all:ArraySlide
:s in this batchboolean
isUsed()
Check if this item is used by some other item.Create a newArraySlide
item for this batch.private void
setArrayDesign
(ArrayDesign arrayDesign) Set theArrayDesign
used in this ArrayBatch.void
setEntryDate
(Date entryDate) Set the date the entry was registered in the database.void
setPrintRobot
(Hardware printRobot) Set theprint 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 theProtocol
used for printing the arrays.Methods inherited from class net.sf.basedb.core.AnnotatedItem
getAnnotationSet, isAnnotated, removeAnnotations
Methods inherited from class net.sf.basedb.core.CommonItem
getDescription, getName, getRemovedBy, isRemoved, setDescription, setName, setRemoved
Methods inherited from class net.sf.basedb.core.SharedItem
getItemKey, getProjectKey, initPermissions, isShared, onBeforeCommit, setItemKey, setProjectKey
Methods inherited from class net.sf.basedb.core.OwnedItem
getOwner, isOwner, setOwner, takeOwnership
Methods inherited from class net.sf.basedb.core.BasicItem
addAnnotatableParents, addUsingItems, addUsingItems, breakCircularReferences, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onRollback, setDbControl, toString, validate
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.sf.basedb.core.AccessControlled
checkPermission, getPermissions, hasPermission
Methods inherited from interface net.sf.basedb.core.Identifiable
getId, getVersion
Methods inherited from interface net.sf.basedb.core.Ownable
getOwner, isOwner, setOwner, takeOwnership
-
Field Details
-
TYPE
The type of item represented by this class.- See Also:
-
protocolHasBeenSet
private boolean protocolHasBeenSet -
robotHasBeenSet
private boolean robotHasBeenSet
-
-
Constructor Details
-
ArrayBatch
ArrayBatch(ArrayBatchData annotatedData)
-
-
Method Details
-
getNew
Create a newArrayBatch
item.- Parameters:
dc
- TheDbControl
which will be used for permission checking and database accessarrayDesign
- TheArrayDesign
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 designBaseException
- If there is another error
-
getById
public static ArrayBatch getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException Get aArrayBatch
object 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
ArrayBatch
item - Throws:
ItemNotFoundException
- If an item with the specified ID is not foundPermissionDeniedException
- If the logged in user doesn't have read permission to the itemBaseException
- If there is another error
-
getQuery
Get aItemQuery
that returns array batches.- Returns:
- An
ItemQuery
object
-
getData
ArrayBatchData getData()Description copied from class:BasicItem
Get theBasicData
object that holds all data for this item.- Overrides:
getData
in classAnnotatedItem
-
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.- Specified by:
getType
in interfaceIdentifiable
- Returns:
- A value indicating the type of item
-
getAnnotatableParents
Get the array design.- Specified by:
getAnnotatableParents
in interfaceAnnotatable
- Returns:
- A set containing annotatable items, or null
- Throws:
BaseException
- If there is an error
-
getEntryDate
Description copied from interface:Registered
Get the date that the item was registered in the database.- Specified by:
getEntryDate
in interfaceRegistered
- Returns:
- A date or null if this is not known
-
setEntryDate
Description copied from interface:Registered
Set the date the entry was registered in the database. Implementations should only allow this property to be set before the item is first stored in the database. The intention of this method is to facilitate export/import of data between server.- Specified by:
setEntryDate
in interfaceRegistered
- Parameters:
entryDate
- A date or null to use today's date
-
isUsed
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 classBasicItem
- Returns:
- TRUE if this item is used, FALSE otherwise
- Throws:
BaseException
- If not able to tell if item is used or not.- See Also:
-
getUsingItems
Get all:ArraySlide
:s in this batch
- Overrides:
getUsingItems
in classBasicItem
- Returns:
- A set containing proxies for the items, or an empty set if no items are using this item
- Since:
- 2.2
- See Also:
-
setProjectDefaults
Set print robot and protocol from project default settings.- Overrides:
setProjectDefaults
in classBasicItem
- Parameters:
activeProject
- The currently active project- Throws:
BaseException
- Since:
- 2.9
-
getArrayDesign
Get theArrayDesign
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 itemBaseException
- If there is an error
-
setArrayDesign
private void setArrayDesign(ArrayDesign arrayDesign) throws InvalidDataException, PermissionDeniedException Set theArrayDesign
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
Get theProtocol
used for printing the arrays.- Specified by:
getProtocol
in interfaceAnnotatable
- Overrides:
getProtocol
in classAnnotatedItem
- Returns:
- The
Protocol
item - Throws:
PermissionDeniedException
- If the logged in user doesn't have read permission to the itemBaseException
- If there is an error
-
setProtocol
Set theProtocol
used for printing the arrays.- Parameters:
protocol
- AProtocol
item of theProtocol.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
Get theprint robot
used for printing the arrays.- Returns:
- A
Hardware
item of typeHardware.PRINT_ROBOT
- Throws:
PermissionDeniedException
- If the logged in user doesn't have read permission to the itemBaseException
- If there is an error
-
setPrintRobot
Set theprint robot
used for this array batch.- Parameters:
printRobot
- AHardware
item of typeHardware.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
Create a newArraySlide
item for this batch.- Returns:
- The new
ArraySlide
item - Throws:
PermissionDeniedException
- If the logged in user doesn't have use permission for this batchBaseException
- If there is another error
-
getArraySlides
Get a query that returns the slides in this batch.- Returns:
- An
ItemQuery
object
-