|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.BasicItem<D> net.sf.basedb.core.ChildItem<PlateEventData> net.sf.basedb.core.PlateEvent
public class PlateEvent
This class represents an event in the life of a Plate
.
The possible events for a plate are defined by the
PlateEventType
:s of a the plates PlateType
.
Plate
,
PlateEventType
Field Summary | |
---|---|
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 Summary | |
---|---|
PlateEvent(PlateEventData plateEventData)
|
Method Summary | |
---|---|
static PlateEvent |
getById(DbControl dc,
int id)
Get a PlateEvent item when you know the id. |
String |
getComment()
Get the comment about this event. |
Date |
getEntryDate()
Get the date this event was added to the database. |
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(String comment)
Set the comment about this event. |
void |
setEventDate(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. |
Methods inherited from class net.sf.basedb.core.ChildItem |
---|
getPermissionForWriteDeleteAndCreate, getPluginPermissions, initPermissions |
Methods inherited from class net.sf.basedb.core.BasicItem |
---|
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 |
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 |
Field Detail |
---|
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.
Constructor Detail |
---|
PlateEvent(PlateEventData plateEventData)
Method Detail |
---|
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 event
PlateEvent
item
PermissionDeniedException
- If the loggged in user
doesn't have write permission for the plate type
InvalidDataException
- If the plate or event type is null,
or if the plate type of the plate and event type are different
BaseException
- 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 load
PlateEvent
item
ItemNotFoundException
- If an item with the specified
id is not found
PermissionDeniedException
- If the logged in user doesn't
have Permission.READ
permission to the item
BaseException
- 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 returned
ItemQuery
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
item
PermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission for the plate
BaseException
- 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 plate
InvalidDataException
- If the plate is nullpublic PlateEventType getPlateEventType() throws PermissionDeniedException, BaseException
PlateEventType
of this event.
PlateEventType
item
PermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission for the event type
BaseException
- 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
plate
PermissionDeniedException
public Protocol getProtocol() throws PermissionDeniedException, BaseException
Protocol
that was followed in this event.
Protocol
item, or null
if no protocol type has been specified
PermissionDeniedException
- If the logged in user doesn't
have read permission to the protocol
BaseException
- If there is another errorpublic void setProtocol(Protocol protocol) throws PermissionDeniedException, BaseException
ProtocolType
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
protocol
BaseException
- If there is another errorpublic Hardware getHardware() throws PermissionDeniedException, BaseException
Hardware
that was used in this event.
Hardware
item or null of not known
PermissionDeniedException
- 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 String getComment()
public void setComment(String comment) throws PermissionDeniedException, InvalidDataException
MAX_COMMENT_LENGTH
constant.
comment
- The new comment
PermissionDeniedException
- If the logged in user doesn't have
write permission on this event
InvalidDataException
- If the comment is too longpublic Date getEntryDate()
getEntryDate
in interface Registered
Date
objectpublic Date getEventDate()
Date
object, or null if not knownpublic void setEventDate(Date eventDate) throws PermissionDeniedException
eventDate
- The date, or null if not known
PermissionDeniedException
- 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
item
PermissionDeniedException
- If the logged in user doesn't have
read permission to the user
BaseException
- If there is another error
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |