gov.nih.nci.caarray.services.biomaterial.ejb
Class BioMaterialManagerEJB

java.lang.Object
  extended by gov.nih.nci.caarray.services.util.AbstractSessionBean
      extended by gov.nih.nci.caarray.services.biomaterial.ejb.BioMaterialManagerEJB
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean

public class BioMaterialManagerEJB
extends AbstractSessionBean
implements javax.ejb.SessionBean

BioMaterialManagerEJB

Author:
TranP, MujuS
See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.nih.nci.caarray.services.util.AbstractSessionBean
logger_, sessionCtx_
 
Constructor Summary
BioMaterialManagerEJB()
           
 
Method Summary
 long addBioSample(BioSampleData bioSampleData)
          Adds the specified Biosample to the persistence store
 long addBioSource(BioSourceData bioSourceData, VocabData[] characteristics)
          Adds the specified BioSource to the persistence store
 long addTreatmentToBioSample(long bioSampleId, TreatmentData treatmentData)
           
 long addTreatmentToLabeledExtract(long labeledExtractId, TreatmentData treatmentData)
           
 long copyLabeledExtract(long labeledExtractId, java.lang.String newLabeledExtractName)
          Makes a copy of the given biomaterial including all the associated parent objects and treatments recursively.
 void deleteBioSample(long id)
          Deletes a BioSample
 void deleteBioSource(long id)
          Deletes a BioSource
 void deleteLabeledExtract(long id)
          Deletes a LabeledExtract
 void deleteTreatmentFromBioMaterial(long bioMaterialId, long treatmentId)
          Deletes a treatment from a biomaterial
 long duplicateBioSample(long sourceBioSampleId, java.lang.String newBioSampleName)
          Makes a copy of the given biomaterial.
 long duplicateBioSource(long sourceBioSourceId, java.lang.String newBioSourceName)
          Applies the specified treatment to produce the specified output Makes a copy of the given biomaterial.
 long duplicateLabeledExtract(long labeledExtractId, java.lang.String newLabeledExtractName)
          Makes a copy of the given biomaterial.
 void ejbCreate()
           
 void ejbRemove()
          called when remove method is called.
 BioMaterialData getBioMaterial(long id)
          Retrieve BioMaterial
 BioSampleData getBioSample(long id)
          Retrieves the BioSampleData object from the persistence store.
 BioSampleView getBioSampleView(long id)
          Retrieves the BioSampleData object from the persistence store.
 BioSourceData getBioSource(long id)
          Retrieves the BioSourceData object from the persistence store.
 BioSourceView getBioSourceView(long id)
          Retrieves the BioSourceView object from the persistence store.
 LabeledExtractData getLabeledExtract(long id)
           
 LabeledExtractView getLabeledExtractView(long id)
          Retrieves the LabeledExtractView object from the persistence store.
 TreatmentData getTreatment(long id)
          Retrieves the TreatmentData object from the persistence store.
 TreatmentData[] getTreatments(long bioMaterialId)
           
 long labelBioSample(TreatmentData labelingTreatment, LabeledExtractData extractData)
          Labels a BioMaterial to create a LabeledExtract.
 long poolBioSamples(TreatmentData poolingTreatment, BioSampleData outputBioSample)
          Pools bioMaterials into a single biomaterial
 BioMaterialDesc[] searchBioMaterials(BioMaterialSearchCriteria criteria)
          Searches BioMaterials
 BioSampleDesc[] searchBioSamples(BioMaterialSearchCriteria criteria)
          Searches BioSamples
 BioSampleDesc[] searchBioSamples(BioMaterialSearchCriteria criteria, boolean ownerOnly)
          Searches BioSamples
 BioSampleDesc[] searchBioSamples(BioMaterialSearchCriteria criteria, int pageSize, int pageNum)
          Searches BioSamples
 BioSampleDesc[] searchBioSamples(BioMaterialSearchCriteria criteria, int pageSize, int pageNum, boolean ownerOnly)
          Searches BioSamples
 BioSampleDesc[] searchBioSamplesShallow(BioMaterialSearchCriteria criteria)
          Shallow search for BioSamples
 BioSampleDesc[] searchBioSamplesShallow(BioMaterialSearchCriteria criteria, boolean ownerOnly)
          Shallow search for BioSamples
 BioSourceDesc[] searchBioSources(BioMaterialSearchCriteria criteria)
          Searches BioSources
 BioSourceDesc[] searchBioSources(BioMaterialSearchCriteria criteria, boolean ownerOnly)
          Searches BioSources
 BioSourceDesc[] searchBioSources(BioMaterialSearchCriteria criteria, int pageSize, int pageNum)
          Searches BioSources
 BioSourceDesc[] searchBioSources(BioMaterialSearchCriteria criteria, int pageSize, int pageNum, boolean ownerOnly)
          Searches BioSources
 BioSourceDesc[] searchBioSourcesShallow(BioMaterialSearchCriteria criteria)
          Shallow search for BioSources
 BioSourceDesc[] searchBioSourcesShallow(BioMaterialSearchCriteria criteria, boolean ownerOnly)
          Shallow search for BioSources
 LabeledExtractDesc[] searchLabeledExtracts(BioMaterialSearchCriteria criteria)
          Search Label Extract
 LabeledExtractDesc[] searchLabeledExtracts(BioMaterialSearchCriteria criteria, int pageSize, int pageNum)
          Search Label Extract
 LabeledExtractDesc[] searchLabeledExtractsShallow(BioMaterialSearchCriteria criteria)
          Shallow search for Label Extract
 long[] splitBioSample(TreatmentData splittingTreatment, SplitBioSampleData[] splitBioSamples)
          Splits a given bio sample to produce new bio samples represented by the specified output bio samples.
 long treatBioMaterial(TreatmentData[] treatmentData, BioMaterialData outputBioMaterialData)
          Applies the specified series of treatments to produce the specified output biomaterial.
 long treatBioMaterial(TreatmentData treatmentData, BioMaterialData outputBioMaterialData)
          Applies the specified treatment to produce the specified output biomaterial.
 void updateBioMaterialCharacteristics(long bioSourceId, VocabData[] characteristics)
          Performs the following: Update the characteristics with the new data if they exist (ID > 0) and are currently associated with the specified BioMaterial.
 void updateBioSample(BioSampleData bioSampleData)
          Updates BioSample
 void updateBioSource(BioSourceData bioSourceData)
          Updates BioSource
 void updateLabeledExtract(TreatmentData labelingTreatment, LabeledExtractData extractData)
          Updates LabeledExtract
 void updateTreatment(TreatmentData treatmentData)
          Updates Treatment
 
Methods inherited from class gov.nih.nci.caarray.services.util.AbstractSessionBean
disableAndRememberPreviousValueForCollectionDescriptorCascadeRetrieve, disableAndRememberPreviousValueForObjectDescriptorCascadeRetrieve, ejbActivate, ejbPassivate, getUserTransaction, resetCollectionDescriptorCascadeToPreviousValue, resetObjectDescriptorCascadeToPreviousValue, setSessionContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.ejb.SessionBean
ejbActivate, ejbPassivate, setSessionContext
 

Constructor Detail

BioMaterialManagerEJB

public BioMaterialManagerEJB()
Method Detail

ejbCreate

public void ejbCreate()
               throws java.rmi.RemoteException,
                      javax.ejb.CreateException
Overrides:
ejbCreate in class AbstractSessionBean
Throws:
javax.ejb.CreateException
java.rmi.RemoteException

ejbRemove

public void ejbRemove()
               throws javax.ejb.EJBException,
                      java.rmi.RemoteException
called when remove method is called.

Specified by:
ejbRemove in interface javax.ejb.SessionBean
Overrides:
ejbRemove in class AbstractSessionBean
Throws:
javax.ejb.EJBException
java.rmi.RemoteException

getBioSourceView

public BioSourceView getBioSourceView(long id)
                               throws java.lang.Exception
Retrieves the BioSourceView object from the persistence store.

Returns:
- An BioSourceView object which ID matches the specified ID or null otherwise.
Throws:
java.lang.Exception

getBioMaterial

public BioMaterialData getBioMaterial(long id)
                               throws java.lang.Exception
Retrieve BioMaterial

Throws:
java.lang.Exception

getBioSource

public BioSourceData getBioSource(long id)
                           throws java.lang.Exception
Retrieves the BioSourceData object from the persistence store.

Returns:
- An BioSourceData object which ID matches the specified ID or null otherwise.
Throws:
java.lang.Exception

getBioSampleView

public BioSampleView getBioSampleView(long id)
                               throws java.lang.Exception
Retrieves the BioSampleData object from the persistence store.

Returns:
- An BioSampleData object which ID matches the specified ID or null otherwise.
Throws:
java.lang.Exception

getBioSample

public BioSampleData getBioSample(long id)
                           throws java.lang.Exception
Retrieves the BioSampleData object from the persistence store.

Returns:
- An BioSampleData object which ID matches the specified ID or null otherwise.
Throws:
java.lang.Exception

getTreatment

public TreatmentData getTreatment(long id)
                           throws java.lang.Exception
Retrieves the TreatmentData object from the persistence store.

Returns:
- An TreatmentData object which ID matches the specified ID or null otherwise.
Throws:
java.lang.Exception

getLabeledExtractView

public LabeledExtractView getLabeledExtractView(long id)
                                         throws java.lang.Exception
Retrieves the LabeledExtractView object from the persistence store.

Returns:
- An LabeledExtractView object which ID matches the specified ID or null otherwise.
Throws:
java.lang.Exception

getLabeledExtract

public LabeledExtractData getLabeledExtract(long id)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

updateBioSource

public void updateBioSource(BioSourceData bioSourceData)
                     throws java.lang.Exception
Updates BioSource

Throws:
java.lang.Exception

updateBioSample

public void updateBioSample(BioSampleData bioSampleData)
                     throws java.lang.Exception
Updates BioSample

Throws:
java.lang.Exception

updateTreatment

public void updateTreatment(TreatmentData treatmentData)
                     throws java.lang.Exception
Updates Treatment

Throws:
java.lang.Exception

updateLabeledExtract

public void updateLabeledExtract(TreatmentData labelingTreatment,
                                 LabeledExtractData extractData)
                          throws java.lang.Exception
Updates LabeledExtract

Parameters:
extractData - - The labeled extract to be updated
labelingData - - The labeling treatment that is associated with the specified labeled extract to be updated as well
Throws:
AccessDeniedException - - If the current user is not authorized to access the specified objects
ObjectNotExistException - - If either the extract or treatment is null or its ID is invalid.
GeneralException - - When network communication or database error occurs.
java.lang.Exception

addBioSource

public long addBioSource(BioSourceData bioSourceData,
                         VocabData[] characteristics)
                  throws java.lang.Exception
Adds the specified BioSource to the persistence store

Returns:
- An object representing the ID of the BioSource being inserted or null otherwise.
Throws:
java.lang.Exception

addBioSample

public long addBioSample(BioSampleData bioSampleData)
                  throws java.lang.Exception
Adds the specified Biosample to the persistence store

Returns:
- An object representing the ID of the Biosample being inserted or null otherwise.
Throws:
java.lang.Exception

duplicateBioSource

public long duplicateBioSource(long sourceBioSourceId,
                               java.lang.String newBioSourceName)
                        throws java.lang.Exception
Applies the specified treatment to produce the specified output Makes a copy of the given biomaterial.

Throws:
java.lang.Exception

duplicateBioSample

public long duplicateBioSample(long sourceBioSampleId,
                               java.lang.String newBioSampleName)
                        throws java.lang.Exception
Makes a copy of the given biomaterial.

Throws:
java.lang.Exception

duplicateLabeledExtract

public long duplicateLabeledExtract(long labeledExtractId,
                                    java.lang.String newLabeledExtractName)
                             throws java.lang.Exception
Makes a copy of the given biomaterial.

Throws:
java.lang.Exception

copyLabeledExtract

public long copyLabeledExtract(long labeledExtractId,
                               java.lang.String newLabeledExtractName)
                        throws java.lang.Exception
Makes a copy of the given biomaterial including all the associated parent objects and treatments recursively.

Throws:
java.lang.Exception

getTreatments

public TreatmentData[] getTreatments(long bioMaterialId)
                              throws java.lang.Exception
Throws:
java.lang.Exception

treatBioMaterial

public long treatBioMaterial(TreatmentData treatmentData,
                             BioMaterialData outputBioMaterialData)
                      throws java.lang.Exception
Applies the specified treatment to produce the specified output biomaterial. The output biomaterial must contain at least one parent that is an existing biomaterial to which the treatment is applied.

Returns:
- The ID of the output biomaterial being produced or a negative number otherwise.
Throws:
java.lang.Exception

treatBioMaterial

public long treatBioMaterial(TreatmentData[] treatmentData,
                             BioMaterialData outputBioMaterialData)
                      throws java.lang.Exception
Applies the specified series of treatments to produce the specified output biomaterial. The output biomaterial must contain at least one parent that is an existing bioMaterial to which the treatment is applied.

Returns:
- The ID of the output biomaterial being produced or a negative number otherwise.
Throws:
java.lang.Exception

addTreatmentToBioSample

public long addTreatmentToBioSample(long bioSampleId,
                                    TreatmentData treatmentData)
                             throws java.lang.Exception
Throws:
java.lang.Exception

addTreatmentToLabeledExtract

public long addTreatmentToLabeledExtract(long labeledExtractId,
                                         TreatmentData treatmentData)
                                  throws java.lang.Exception
Throws:
java.lang.Exception

splitBioSample

public long[] splitBioSample(TreatmentData splittingTreatment,
                             SplitBioSampleData[] splitBioSamples)
                      throws java.lang.Exception
Splits a given bio sample to produce new bio samples represented by the specified output bio samples. The output BioSampleData's may contain name, description and measurement.

Parameters:
splittingTreatment - - The treatment representing the splitting action.
splitBioSamples - - An array of new SplitBioSampleData's produced by the splitting treatment. The individual SplitBioSampleData must contain at least name, description, measurement, and the parent BioMaterial's ID.
Returns:
- An array of output/product BioSamples that would be populated with identifying information when this method returns.
Throws:
java.lang.Exception

poolBioSamples

public long poolBioSamples(TreatmentData poolingTreatment,
                           BioSampleData outputBioSample)
                    throws java.lang.Exception
Pools bioMaterials into a single biomaterial

Throws:
java.lang.Exception

labelBioSample

public long labelBioSample(TreatmentData labelingTreatment,
                           LabeledExtractData extractData)
                    throws java.lang.Exception
Labels a BioMaterial to create a LabeledExtract.

Parameters:
extractData - - The labeled extract to be added
labelingData - - The labeling treatment associated with the labeled
Throws:
java.lang.Exception

searchBioMaterials

public BioMaterialDesc[] searchBioMaterials(BioMaterialSearchCriteria criteria)
                                     throws java.lang.Exception
Searches BioMaterials

Throws:
java.lang.Exception

searchBioSources

public BioSourceDesc[] searchBioSources(BioMaterialSearchCriteria criteria,
                                        boolean ownerOnly)
                                 throws java.lang.Exception
Searches BioSources

Throws:
java.lang.Exception

searchBioSourcesShallow

public BioSourceDesc[] searchBioSourcesShallow(BioMaterialSearchCriteria criteria)
                                        throws java.lang.Exception
Shallow search for BioSources

Throws:
java.lang.Exception

searchBioSourcesShallow

public BioSourceDesc[] searchBioSourcesShallow(BioMaterialSearchCriteria criteria,
                                               boolean ownerOnly)
                                        throws java.lang.Exception
Shallow search for BioSources

Throws:
java.lang.Exception

searchBioSources

public BioSourceDesc[] searchBioSources(BioMaterialSearchCriteria criteria)
                                 throws java.lang.Exception
Searches BioSources

Throws:
java.lang.Exception

searchBioSources

public BioSourceDesc[] searchBioSources(BioMaterialSearchCriteria criteria,
                                        int pageSize,
                                        int pageNum)
                                 throws java.lang.Exception
Searches BioSources

Throws:
java.lang.Exception

searchBioSources

public BioSourceDesc[] searchBioSources(BioMaterialSearchCriteria criteria,
                                        int pageSize,
                                        int pageNum,
                                        boolean ownerOnly)
                                 throws java.lang.Exception
Searches BioSources

Throws:
java.lang.Exception

searchBioSamplesShallow

public BioSampleDesc[] searchBioSamplesShallow(BioMaterialSearchCriteria criteria)
                                        throws java.lang.Exception
Shallow search for BioSamples

Throws:
java.lang.Exception

searchBioSamplesShallow

public BioSampleDesc[] searchBioSamplesShallow(BioMaterialSearchCriteria criteria,
                                               boolean ownerOnly)
                                        throws java.lang.Exception
Shallow search for BioSamples

Throws:
java.lang.Exception

searchBioSamples

public BioSampleDesc[] searchBioSamples(BioMaterialSearchCriteria criteria)
                                 throws java.lang.Exception
Searches BioSamples

Throws:
java.lang.Exception

searchBioSamples

public BioSampleDesc[] searchBioSamples(BioMaterialSearchCriteria criteria,
                                        boolean ownerOnly)
                                 throws java.lang.Exception
Searches BioSamples

Throws:
java.lang.Exception

searchBioSamples

public BioSampleDesc[] searchBioSamples(BioMaterialSearchCriteria criteria,
                                        int pageSize,
                                        int pageNum)
                                 throws java.lang.Exception
Searches BioSamples

Throws:
java.lang.Exception

searchBioSamples

public BioSampleDesc[] searchBioSamples(BioMaterialSearchCriteria criteria,
                                        int pageSize,
                                        int pageNum,
                                        boolean ownerOnly)
                                 throws java.lang.Exception
Searches BioSamples

Throws:
java.lang.Exception

searchLabeledExtracts

public LabeledExtractDesc[] searchLabeledExtracts(BioMaterialSearchCriteria criteria,
                                                  int pageSize,
                                                  int pageNum)
                                           throws java.lang.Exception
Search Label Extract

Throws:
java.lang.Exception

searchLabeledExtracts

public LabeledExtractDesc[] searchLabeledExtracts(BioMaterialSearchCriteria criteria)
                                           throws java.lang.Exception
Search Label Extract

Throws:
java.lang.Exception

searchLabeledExtractsShallow

public LabeledExtractDesc[] searchLabeledExtractsShallow(BioMaterialSearchCriteria criteria)
                                                  throws java.lang.Exception
Shallow search for Label Extract

Throws:
java.lang.Exception

updateBioMaterialCharacteristics

public void updateBioMaterialCharacteristics(long bioSourceId,
                                             VocabData[] characteristics)
                                      throws java.lang.Exception
Performs the following:

Parameters:
bioSourceId - - The BioSource whose characteristics are to be updated
characteristics - - The characteristics to be updated.
Throws:
java.lang.Exception

deleteTreatmentFromBioMaterial

public void deleteTreatmentFromBioMaterial(long bioMaterialId,
                                           long treatmentId)
                                    throws java.lang.Exception
Deletes a treatment from a biomaterial

Throws:
java.lang.Exception

deleteBioSource

public void deleteBioSource(long id)
                     throws java.lang.Exception
Deletes a BioSource

Throws:
java.lang.Exception

deleteBioSample

public void deleteBioSample(long id)
                     throws java.lang.Exception
Deletes a BioSample

Throws:
java.lang.Exception

deleteLabeledExtract

public void deleteLabeledExtract(long id)
                          throws java.lang.Exception
Deletes a LabeledExtract

Throws:
java.lang.Exception