public class PlateEvent extends ChildItem<PlateEventData> implements Registered
Plate
.
The possible events for a plate are defined by the
PlateEventType
:s of a the plates PlateType
.Plate
,
PlateEventType
Modifier and Type | Field and Description |
---|---|
static int |
MAX_COMMENT_LENGTH
The maximum length of the comment about this event.
|
private static QueryRuntimeFilter |
RUNTIME_FILTER
This filter will only return items if the logged in user has
generic read permission to plates.
|
static Item |
TYPE
The type of item represented by this class.
|
Constructor and Description |
---|
PlateEvent(PlateEventData plateEventData) |
Modifier and Type | Method and Description |
---|---|
static PlateEvent |
getById(DbControl dc,
int id)
Get a
PlateEvent item when you know the id. |
java.lang.String |
getComment()
Get the comment about this event.
|
java.util.Date |
getEntryDate()
Get the date this event was added to the database.
|
java.util.Date |
getEventDate()
Get the date this event was done in the lab.
|
Hardware |
getHardware()
Get the
Hardware that was used in this event. |
static PlateEvent |
getNew(DbControl dc,
Plate plate,
PlateEventType plateEventType)
Create a new
PlateEvent item. |
Plate |
getPlate()
Get the
Plate this event belongs to. |
PlateEventType |
getPlateEventType()
Get the
PlateEventType of this event. |
Protocol |
getProtocol()
Get the
Protocol that was followed in this event. |
static ItemQuery<PlateEvent> |
getQuery(Plate plate)
Get a query configured to retrieve plate events for the specified plate.
|
(package private) SharedData |
getSharedParent()
Get the shareable parent item of this child item.
|
Item |
getType()
Get the type of item represented by the object.
|
User |
getUser()
Get the
User that is responsible for this event. |
void |
setComment(java.lang.String comment)
Set the comment about this event.
|
void |
setEventDate(java.util.Date eventDate)
Set the date this event was done in the lab.
|
void |
setHardware(Hardware hardware)
Set the
Hardware that was used in this event. |
private void |
setPlate(Plate plate)
Set the plate owning this event.
|
private void |
setPlateEventType(PlateEventType plateEventType)
Set the plate event type of this event.
|
void |
setProtocol(Protocol protocol)
Set the protocol that was followed in this event.
|
getPermissionForUse, getPermissionForWriteDeleteAndCreate, getPluginPermissions, initPermissions
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getVersion
checkPermission, getPermissions, hasPermission
public static final Item TYPE
Item.PLATEEVENT
,
getType()
private static final QueryRuntimeFilter RUNTIME_FILTER
public static final int MAX_COMMENT_LENGTH
setComment(String)
method to avoid exceptions.PlateEvent(PlateEventData plateEventData)
public static PlateEvent getNew(DbControl dc, Plate plate, PlateEventType plateEventType) throws InvalidDataException, BaseException
PlateEvent
item.dc
- The DbControl
which will be used for
permission checking and database accessplate
- The plateplateEventType
- The type of the eventPlateEvent
itemPermissionDeniedException
- If the loggged in user
doesn't have write permission for the plate typeInvalidDataException
- If the plate or event type is null,
or if the plate type of the plate and event type are differentBaseException
- If there is an errorpublic static PlateEvent getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
PlateEvent
item when you know the id.dc
- The DbControl
which will be used for
permission checking and database access.id
- The id of the item to loadPlateEvent
itemItemNotFoundException
- If an item with the specified
id is not foundPermissionDeniedException
- If the logged in user doesn't
have Permission.READ
permission to the itemBaseException
- If there is another errorpublic static ItemQuery<PlateEvent> getQuery(Plate plate)
plate
- The plate to retreive event for, null is allowed if
the logged in user has generic READ permission for plates in which case
all events will be returnedItemQuery
objectPlate.getEvents()
public Item getType()
Identifiable
Item
enumeration.getType
in interface Identifiable
SharedData getSharedParent()
ChildItem
ChildItem.initPermissions(int, int)
method to calculate
the logged in user's permissions for the child item.getSharedParent
in class ChildItem<PlateEventData>
public Plate getPlate() throws PermissionDeniedException, BaseException
Plate
this event belongs to.Plate
itemPermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission for the plateBaseException
- If there is another errorprivate void setPlate(Plate plate) throws PermissionDeniedException, InvalidDataException
PermissionDeniedException
- If the logged in user
doesn't have write permission for the plateInvalidDataException
- If the plate is nullpublic PlateEventType getPlateEventType() throws PermissionDeniedException, BaseException
PlateEventType
of this event.PlateEventType
itemPermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission for the event typeBaseException
- If there is another errorprivate void setPlateEventType(PlateEventType plateEventType) throws PermissionDeniedException, InvalidDataException
InvalidDataException
- If the event type is null
or belongs to a different PlateType
than the
platePermissionDeniedException
public Protocol getProtocol() throws PermissionDeniedException, BaseException
Protocol
that was followed in this event.Protocol
item, or null
if no protocol type has been specifiedPermissionDeniedException
- If the logged in user doesn't
have read permission to the protocolBaseException
- If there is another errorpublic void setProtocol(Protocol protocol) throws PermissionDeniedException, BaseException
ItemSubtype
of the protocol matches the
protocol type set by the PlateEventType
, but the core doesn't
check this.protocol
- The new Protocol
PermissionDeniedException
- If the logged in user doesn't have
write permission for this event or use permission for the
protocolBaseException
- If there is another errorpublic Hardware getHardware() throws PermissionDeniedException, BaseException
Hardware
that was used in this event.Hardware
item or null of not knownPermissionDeniedException
- If the logged in user doesn't have
read permission to the hardware.BaseException
- If there is another error.public void setHardware(Hardware hardware) throws PermissionDeniedException
Hardware
that was used in this event.hardware
- A Hardware
item or null if not known.PermissionDeniedException
- If the logged in user doesn't have
write permission on this event or use permission for the hardware.public java.lang.String getComment()
public void setComment(java.lang.String comment) throws PermissionDeniedException, InvalidDataException
MAX_COMMENT_LENGTH
constant.comment
- The new commentPermissionDeniedException
- If the logged in user doesn't have
write permission on this eventInvalidDataException
- If the comment is too longpublic java.util.Date getEntryDate()
getEntryDate
in interface Registered
Date
objectpublic java.util.Date getEventDate()
Date
object, or null if not knownpublic void setEventDate(java.util.Date eventDate) throws PermissionDeniedException
eventDate
- The date, or null if not knownPermissionDeniedException
- If the logged in user doesn't have
write permission on this eventpublic User getUser() throws PermissionDeniedException, BaseException
User
that is responsible for this event.User
itemPermissionDeniedException
- If the logged in user doesn't have
read permission to the userBaseException
- If there is another error