Package net.sf.basedb.core
Class ArraySlide
- All Implemented Interfaces:
AccessControlled
,Annotatable
,Identifiable
,Nameable
,Ownable
,Registered
,Removable
,Shareable
This class represents a physical microarray slide.
- Version:
- 2.0
- Author:
- Nicklas, Enell
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The maximum length of the barcode that can be stored in the database.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 TypeMethodDescriptionstatic boolean
barcodeExists
(DbControl dc, String barcode) Checks if a slide with the given barcode already exists in the database.Get the array batch.Get theArrayBatch
item to which this slide belongs.Get the barcode of the slide.int
Get the index of this slide in the batch.static ArraySlide
Get aArraySlide
object when you know the ID.(package private) ArraySlideData
getData()
Get theBasicData
object that holds all data for this item.Get the date that the item was registered in the database.static ArraySlide
getNew
(DbControl dc, ArrayBatch arrayBatch) Create a newArraySlide
item.Get thePhysicalBioAssay
item which was used on this slide.static ItemQuery<ArraySlide>
getQuery()
Get aItemQuery
object configured to retrieve array slides.getType()
Get the type of item represented by the object.Get the bioassay that was used on this plate.boolean
Check if the slide is flagged as destroyed or not.boolean
isUsed()
Check if this item is used by some other item.boolean
Checks if this array slide is used by a different bioassay than the given one.private void
setArrayBatch
(ArrayBatch arrayBatch) Set theArrayBatch
this arrayslide belongs to.void
setBarcode
(String barcode) Set the barcode for the slide.void
setBatchIndex
(int batchIndex) Set the index of this slide in the batch.void
setDestroyed
(boolean destroyed) Set if the slide should be flagged as destroyed.void
setEntryDate
(Date entryDate) Set the date the entry was registered in the database.Methods inherited from class net.sf.basedb.core.AnnotatedItem
getAnnotationSet, getProtocol, 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, setProjectDefaults, 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:
-
MAX_BARCODE_LENGTH
public static final int MAX_BARCODE_LENGTHThe maximum length of the barcode that can be stored in the database. Check the length against this value before calling thesetBarcode
method to avoid exceptions.- See Also:
-
-
Constructor Details
-
ArraySlide
ArraySlide(ArraySlideData data)
-
-
Method Details
-
getNew
public static ArraySlide getNew(DbControl dc, ArrayBatch arrayBatch) throws PermissionDeniedException, BaseException Create a newArraySlide
item.- Parameters:
dc
- TheDbControl
which will be used for permission checking and database accessarrayBatch
- TheArrayBatch
this slide belongs to- Returns:
- The new
ArraySlide
item - Throws:
PermissionDeniedException
- If the logged in user doesn't have use permission for the array batchBaseException
- If there is another error
-
getById
public static ArraySlide getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException Get aArraySlide
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
ArraySlide
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
-
barcodeExists
Checks if a slide with the given barcode already exists in the database. The check is done on ALL slides, even on those not normally accessible by the logged in user.- Parameters:
dc
- The DbControl to use for database accessbarcode
- The barcode to check- Returns:
- TRUE if the barcode exists, FALSE if not or if the argument is NULL
- Since:
- 2.7
-
getQuery
Get aItemQuery
object configured to retrieve array slides.- Returns:
- An
ItemQuery
object
-
getData
ArraySlideData 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 batch.- 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 the bioassay that was used on this plate.- Overrides:
getUsingItems
in classBasicItem
- Returns:
- A set containing proxies for the items, or an empty set if no items are using this item
- Throws:
BaseException
- If there is an error loading the items- Since:
- 2.2
- See Also:
-
getBatchIndex
public int getBatchIndex()Get the index of this slide in the batch.- Returns:
- The index of the slide
-
setBatchIndex
Set the index of this slide in the batch.- Parameters:
batchIndex
- The index of the slide in the batch- Throws:
PermissionDeniedException
- This exception is thrown if the logged in user doesn't have write permission.
-
getBarcode
Get the barcode of the slide.- Returns:
- A string with the barcode sequence
-
setBarcode
Set the barcode for the slide. The value can be null and must not be longer than the value specified by theMAX_BARCODE_LENGTH
constant.- Parameters:
barcode
- The new barcode for the slide- Throws:
PermissionDeniedException
- If the logged in user doesn't have write permissionInvalidDataException
- This exception is thrown if the barcode is longer thanMAX_BARCODE_LENGTH
-
isDestroyed
public boolean isDestroyed()Check if the slide is flagged as destroyed or not. A destroyed slide may not be connected to a hybridization.- Returns:
- TRUE if the slide is destroyed, FALSE otherwise
-
setDestroyed
Set if the slide should be flagged as destroyed. A destroyed slide may not be connected to a hybridization.- Parameters:
destroyed
- true if the slide should be flagged as destroyed, false otherwise- Throws:
PermissionDeniedException
- If the logged in user doesn't have write permission
-
getArrayBatch
Get theArrayBatch
item to which this slide belongs.- Returns:
- The
ArrayBatch
item - Throws:
PermissionDeniedException
- If the logged in user doesn't have read permission for the array batchBaseException
- If there is another error
-
setArrayBatch
private void setArrayBatch(ArrayBatch arrayBatch) throws InvalidDataException, PermissionDeniedException Set theArrayBatch
this arrayslide belongs to.- Parameters:
arrayBatch
- the arrayBatch to be set. Cannot be null.- Throws:
InvalidDataException
- If the arrayBatch is nullPermissionDeniedException
- If the logged in user doesn't have use permission for the batch
-
getPhysicalBioAssay
Get thePhysicalBioAssay
item which was used on this slide. To set, use thePhysicalBioAssay.setArraySlide(ArraySlide)
method.- Returns:
- The
PhysicalBioAssay
item, or null - Throws:
PermissionDeniedException
- This exception is thrown if the logged in user doesn't have read permission to the itemBaseException
- If there is another error- Since:
- 3.0
-
isUsedByOther
Checks if this array slide is used by a different bioassay than the given one.- Parameters:
pba
- The bioassay to check, or null to check if the slide is used by any bioassay- Returns:
- TRUE if the slide is used by a different bioassay, or FALSE if it is used by the given bioassay, or not used at all
- Since:
- 2.8.3
-