|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.cisban.rod.dao.DAO
public class DAO
The main class for connections to the the database. All other connections to the database are first routed through this class.
Field Summary | |
---|---|
Delete |
delete
Accessor for the DAO delete something methods |
Exists |
exists
Accessor for the DAO check-if-something-exists methods |
Find |
find
Accessor for the DAO find-something methods |
protected Persist |
persist
Accessor for the DAO persist-my-thing methods |
Method Summary | |
---|---|
void |
addDatabaseProgressListener(DatabaseProgressListener listener)
Allows any class to listen in on what is happening currently in the database. |
ActionApplication |
addInoculation(java.lang.Long actionApplicationId,
java.util.Set<Inoculation> logs,
java.util.Map<java.lang.String,java.lang.Exception> exceptionMap,
java.util.Map<java.lang.String,java.lang.String> barcodeSubs)
Adds a set of Inoculation logs to an existing ActionApplication. |
ActionApplication |
addSpotting(java.lang.Long actionApplicationId,
java.util.Collection<Spotting> logs,
java.util.Map<java.lang.String,java.lang.Exception> exceptionMap,
java.util.Map<java.lang.String,java.lang.String> barcodeSubs)
Adds a set of Spotting logs to an existing ActionApplication. |
ActionApplication |
applyAction(long pAppId,
long startACVId,
long aCVId)
Creates an ActionApplication in a ProtocolApplication based upon the trail of the ProtocolCV and ActionCV. |
java.util.Map<java.lang.String,java.lang.Exception> |
exportImage(java.lang.Long repeatId,
Image refImage,
ResultPrinter srl)
Prints the results from a particular Image to the passed ResultPrinter. |
java.util.Collection<BackgroundMutationCV> |
getBackgroundMutationCVs()
Returns the whole list of BackgroundMutationCVs in the database. |
java.util.Collection<Experiment> |
getExperiments()
Returns the whole list of Experiments in the database. |
Find |
getFind()
Returns the helper class for finding objects in the database |
static DAO |
getInstance()
Lazy instantiation and return of this singleton class. |
java.util.Collection<MasterplateLibraryCV> |
getMasterplateLibraryCVs()
Returns the whole list of MasterplateLibraryCVs in the database. |
java.util.Collection<MasterplateSet> |
getMasterplateSets()
Returns the whole list of MasterplateSets in the database. |
java.util.Collection<MediumCV> |
getMediumCVs()
Returns the whole list of MediumCVs in the database. |
Persist |
getPersist()
Returns the helper class for persisting objects to the database |
java.util.Collection<PlateCV> |
getPlateCVs()
Returns the whole list of PlateCVs in the database. |
java.util.Collection<Plate> |
getPlates()
Returns the whole list of Plates in the database. |
javax.jdo.PersistenceManagerFactory |
getPmf()
Returns the PersistenceManagerFactory initialized by this class. |
java.util.Collection<ProtocolCV> |
getProtocols()
Returns the whole list of ProtocolCVs in the database. |
Repeat |
getRepeat(java.lang.Long repeatID)
Return a repeat using its id. |
java.util.Collection<Repeat> |
getRepeats(java.lang.Long experimentId)
Returns all Repeat s from an Experiment . |
java.util.Collection<TreatmentCV> |
getTreatmentCVs()
Returns the whole list of TreatmentCVs in the database. |
void |
iterateProtocol(ProtocolApplication protocol)
Iterates through a ProtocolApplication and its ActionApplications recursively. |
void |
iterateProtocol(ProtocolCV protocol)
Iterates through a ProtocolCV and its ActionCVs recursively. |
Experiment |
loadExperiment(java.lang.Long experimentId)
Loads an experiment given its id (PK). |
java.util.Collection<Image> |
loadImagesBrief(java.util.List<java.lang.String> nonMappedPlates,
java.lang.String barcodeString)
Loads the collection of images associated with a Barcode without retrieving the individual ImageSpots (hence the "Brief"). |
java.util.Collection<LogEvent> |
loadLogs(java.lang.Long actionAppId)
Loads the LogEvents of an ActionApplication, given the AA's PK. |
java.util.Collection<LogEventMapping> |
loadSpots(java.util.Collection<java.lang.String> sourceBarcodes,
long aAppId)
Accesses the spot log for the given source barcodes based on ActionApplication id. |
java.util.Map<java.lang.String,java.lang.Exception> |
makeMasterplateSet(java.util.List<java.lang.String> barcodes,
java.util.Map<java.lang.Integer,java.util.Set<MasterplatePosition>> mp,
java.lang.String description,
MasterplateLibraryCV mpcv,
BackgroundMutationCV bmcv,
PlateCV pcv)
Creates a new MasterplateSet based on the given parameters. |
java.util.Map<java.lang.String,java.lang.Exception> |
pourPlates(java.util.Date datePoured,
java.util.List<java.lang.String> barcodes,
MediumCV medium,
PlateCV plateCV)
Adds a set of plates to the database. |
void |
removeDatabaseProgressListener(DatabaseProgressListener listener)
Removes this listener from listening to what is happening in the database |
void |
reportProgress(int progress)
Reports the progress of the database to whichever DatabaseProgressListener is interested. |
void |
reportProgressStatus(java.lang.String s)
Tells interested DatabaseProgressListener s what is happening currently with the database. |
java.util.Collection<java.lang.Exception> |
threadImageLogs(java.lang.Long actionApplicationId,
java.util.Collection<Image> logs)
Enters the image logs each in individual threads to improve performance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Find find
protected Persist persist
public Exists exists
public Delete delete
Method Detail |
---|
public javax.jdo.PersistenceManagerFactory getPmf()
PersistenceManagerFactory
initialized by this class.
PersistenceManagerFactory
initialized by this class.public static DAO getInstance()
public Persist getPersist()
public Find getFind()
public void iterateProtocol(ProtocolCV protocol)
protocol
- The protocol to iterate recursively throughpublic void iterateProtocol(ProtocolApplication protocol)
protocol
- The protocol to iterate recursively throughpublic Experiment loadExperiment(java.lang.Long experimentId)
experimentId
- the primary key of the experiment
public java.util.Collection<Repeat> getRepeats(java.lang.Long experimentId)
Repeat
s from an Experiment
.
experimentId
- the DB id of the experiment
Repeat
s from an Experiment
.public Repeat getRepeat(java.lang.Long repeatID)
repeatID
- the DB id
public java.util.Collection<LogEvent> loadLogs(java.lang.Long actionAppId) throws QueryNotFoundException
actionAppId
- primary key of the ActionApplication
QueryNotFoundException
- if the ActionApplication with that PK cannot be foundpublic java.util.Collection<Image> loadImagesBrief(java.util.List<java.lang.String> nonMappedPlates, java.lang.String barcodeString) throws QueryNotFoundException
nonMappedPlates
- a collection that holds the Barcodes that do not have associated images.
Intended to be re-used with several calls to this method for error-checking purposes.barcodeString
- the barcodeValue of the plate
QueryNotFoundException
- if the Barcode cannot be found based on the parameterpublic ActionApplication applyAction(long pAppId, long startACVId, long aCVId)
Creates an ActionApplication in a ProtocolApplication based upon the trail of the ProtocolCV and ActionCV.
This method calls the private createTrail method after locating the ProtocolApplication and ActionCV objects from the passed primary key identifiers.
In the createTrail method, A path is created from the ProtocolApplication to the ActionApplication through any intervening Protocol/Action steps. For example, in a simple situation, a ProtocolCV (P1) has an ActionCV (A1), which links to ProtocolCV 2 (P2), which has an ActionCV (A2):
P1 -> A1 -> P2 - A2
In this particular experiment, MyExp, only the top-level step exists so far.
PA1
To this method applyAction, I can pass the id for PA1, and the id for A2, and it will create the following structure:
PA1 -> AA1 -> PA2 -> AA2
Clear as mud?
pAppId
- the ProtocolApplication to add the Action tostartACVId
- the ActionCV
at the top of the tree from which to
start looking for the aCVId. This variable was included in case there were
several of the same ActionCV
s at the top of the protocol tree.aCVId
- the ActionCV that the ActionApplication should be created from
public java.util.Collection<LogEventMapping> loadSpots(java.util.Collection<java.lang.String> sourceBarcodes, long aAppId) throws QueryNotFoundException
ActionApplication
id.
sourceBarcodes
- barcodes that occur in the sourcePlatePosition of Spotting
aAppId
- the ActionApplication
id
QueryNotFoundException
- if the Barcode
s or ActionApplication
cannot be foundpublic java.util.Map<java.lang.String,java.lang.Exception> makeMasterplateSet(java.util.List<java.lang.String> barcodes, java.util.Map<java.lang.Integer,java.util.Set<MasterplatePosition>> mp, java.lang.String description, MasterplateLibraryCV mpcv, BackgroundMutationCV bmcv, PlateCV pcv)
MasterplateSet
based on the given parameters.
barcodes
- an ordered list of barcodes of the Masterplate
s in the setmp
- a map of the order number from the barcodes parameter to the set of MasterplatePosition
s on the
Masterplatedescription
- a description of the MasterplateSet
mpcv
- the MasterplateLibraryCV
termbmcv
- the BackgroundMutationCV
termpcv
- the PlateCV
public ActionApplication addInoculation(java.lang.Long actionApplicationId, java.util.Set<Inoculation> logs, java.util.Map<java.lang.String,java.lang.Exception> exceptionMap, java.util.Map<java.lang.String,java.lang.String> barcodeSubs)
actionApplicationId
- the primary key of the ActionApplicationlogs
- the set of Inoculation logs to add to the ActionApplicationexceptionMap
- a Map of Exceptions that occurred during this operationbarcodeSubs
- a list of barcodes keys to substitute with their given
values (used for no-reads and other barcode errors)
DAO#applyAction(long, long)
public ActionApplication addSpotting(java.lang.Long actionApplicationId, java.util.Collection<Spotting> logs, java.util.Map<java.lang.String,java.lang.Exception> exceptionMap, java.util.Map<java.lang.String,java.lang.String> barcodeSubs)
actionApplicationId
- the primary key of the ActionApplicationlogs
- the set of Spotting logs to add to the ActionApplicationexceptionMap
- a Map of Exceptions that occurred during this operationbarcodeSubs
- a list of barcodes keys to substitute with their given
values (used for no-reads and other barcode errors)
DAO#applyAction(long, long)
public java.util.Collection<java.lang.Exception> threadImageLogs(java.lang.Long actionApplicationId, java.util.Collection<Image> logs)
actionApplicationId
- the DB id of the ActionApplication
to
add the image logs tologs
- the images to add
public java.util.Map<java.lang.String,java.lang.Exception> pourPlates(java.util.Date datePoured, java.util.List<java.lang.String> barcodes, MediumCV medium, PlateCV plateCV)
datePoured
- the date that the plates were poured on (in the real world)barcodes
- a list of the barcodes of the platesmedium
- the medium on the platesplateCV
- the type of plate that was poured
public java.util.Map<java.lang.String,java.lang.Exception> exportImage(java.lang.Long repeatId, Image refImage, ResultPrinter srl)
repeatId
- the primary key of the RepeatrefImage
- the image whose results will be printedsrl
- the ResultPrinter that will print (export) the results to some kind of stream
public java.util.Collection<TreatmentCV> getTreatmentCVs() throws QueryNotFoundException
QueryNotFoundException
- if there are no TreatmentCVs to findpublic java.util.Collection<MediumCV> getMediumCVs() throws QueryNotFoundException
QueryNotFoundException
- if there are no MediumCVs to findpublic java.util.Collection<PlateCV> getPlateCVs() throws QueryNotFoundException
QueryNotFoundException
- if there are no PlateCVs to findpublic java.util.Collection<Experiment> getExperiments() throws QueryNotFoundException
QueryNotFoundException
- if there are no Experiments to findpublic java.util.Collection<MasterplateSet> getMasterplateSets() throws QueryNotFoundException
QueryNotFoundException
- if there are no TreatmentCVs to findpublic java.util.Collection<BackgroundMutationCV> getBackgroundMutationCVs() throws QueryNotFoundException
QueryNotFoundException
- if there are no BackgroundMutationCVs to findpublic java.util.Collection<MasterplateLibraryCV> getMasterplateLibraryCVs() throws QueryNotFoundException
QueryNotFoundException
- if there are no MasterplateLibraryCVs to findpublic java.util.Collection<Plate> getPlates() throws QueryNotFoundException
QueryNotFoundException
- if there are no Plates to findpublic java.util.Collection<ProtocolCV> getProtocols() throws QueryNotFoundException
QueryNotFoundException
- if there are no ProtocolCVs to findpublic void addDatabaseProgressListener(DatabaseProgressListener listener)
listener
- an interested classpublic void removeDatabaseProgressListener(DatabaseProgressListener listener)
listener
- an uninterested classpublic void reportProgressStatus(java.lang.String s)
DatabaseProgressListener
s what is happening currently with the database.
s
- an interesting status messagepublic void reportProgress(int progress)
DatabaseProgressListener
is interested.
progress
- the progress percent (from 0-99).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |