gov.nih.nci.caarray.services.arraydesign
Class ArrayDesignManagerDB

java.lang.Object
  extended by gov.nih.nci.caarray.services.util.db.ManagerDB
      extended by gov.nih.nci.caarray.services.arraydesign.ArrayDesignManagerDB

public final class ArrayDesignManagerDB
extends ManagerDB

Author:
TranP

Field Summary
 
Fields inherited from class gov.nih.nci.caarray.services.util.db.ManagerDB
CASCADE_LINK, CASCADE_NONE, CASCADE_OBJECT, ID_UNSET
 
Constructor Summary
ArrayDesignManagerDB()
          Default Constructor
 
Method Summary
 long addArrayDesign(PhysicalArrayDesign arrayDesign)
          Adds the specified ArrayDesign to the persistence store
 void addCompositeGroup(long arrayDesignId, long compositeGroupId)
          Add the specified CompositeGroup to the specified ArrayDesign.
 void addCompositeSequence(CompositeGroup compositeGroup, CompositeSequence compositeSequence)
           
 void addDesignProviderRole(long arrayDesignId, DesignProviderRole designProviderRole)
          Associate specified provider that has a role with the specified array design
 void addFeatureGroup(long arrayDesignId, long featureGroupId)
          Add the specified FeatureGroup to the specified ArrayDesign.
 long addProtocolApplication(long arrayDesignId, ProtocolApplication protApp)
           
 void addReporterGroup(long arrayDesignId, long reporterGroupId)
          Add the specified ReporterGroup to the specified ArrayDesign.
 void close()
          Close database connection.
 void deleteArrayDesign(long arrayDesignId)
          Attempts to physically delete the specified ArrayDesign if it contains no Features, Reporters and CompositeSequences.
 void deletePotocolApplicationFromArrayDesign(long arrayDesignId, long protAppId)
           
 void disableIndexesAndConstraints()
           
 void enableIndexesAndConstraints()
           
 PhysicalArrayDesign getArrayDesign(long id)
           
 PhysicalArrayDesign getArrayDesign(java.lang.String identifier)
           
 ArrayDesignFileUploadEntry getArrayDesignFileUploadEntry(PhysicalArrayDesign design)
           
 PhysicalArrayDesign[] getArrayDesigns(ArrayDesignSearchCriteria searchCriteria)
          Get an array of ArrayDesign that match the specified Criteria and that the array design is NOT marked as deleted.
 ArrayDesignUploadedFileData getArrayDesignUploadedFileData(long id)
           
 java.sql.Connection getConnection()
           
 boolean isArrayDesignProvidedByAffymetrix(long id)
           
 void removeCompositeGroup(long arrayDesignId, long compositeGroupId)
          Remove the specified CompositeGroup from the specified ArrayDesign.
 void removeDesignProvider(long arrayDesignId, long providerId)
           
 void removeExistingDesignElements(PhysicalArrayDesign arrayDesign)
           
 void removeFeatureGroup(long arrayDesignId, long featureGroupId)
          Remove the specified FeatureGroup from the specified ArrayDesign.
 void removeReporterGroup(long arrayDesignId, long reporterGroupId)
          Remove the specified ReporterGroup from the specified ArrayDesign.
 void saveArrayDesign(PhysicalArrayDesign arrayDesign)
          Alternate (to addArrayDesign) method for saving an array design -- assumes that the associated OntologyEntries are correct and stores all associated objects automatically.
 DesignElementRetrievalSettings setEfficientDesignElementRetrieval()
           
 void setNormalDesignElementRetrieval(DesignElementRetrievalSettings originalSettings)
           
 void updateArrayDesign(PhysicalArrayDesign arrayDesign)
           
 void updateTopLevelOnly(PhysicalArrayDesign arrayDesign)
           
 
Methods inherited from class gov.nih.nci.caarray.services.util.db.ManagerDB
clearCache, countObjects, countObjects, deleteByQuery, deleteMtoNRelation, deleteObject, deleteObject, deleteObject, deleteObjectByQuery, exists, getIdentifiable, getObject, getObject, getObject, getObject, getObject, getObject, getObjectIterator, getObjectIterator, getObjects, getObjects, getObjects, getPersistenceBroker, getSqlInLimit, insertMtoNRelation, insertMtoNRelation, insertObject, insertObject, link, link, removeFromCache, retrieveReference, retrieveReferences, setCascadeDelete, setCascadeRetrieve, setCascadeStore, storeObject, storeObject, unlink, unlink, updateObject, updateObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayDesignManagerDB

public ArrayDesignManagerDB()
Default Constructor

Method Detail

addArrayDesign

public long addArrayDesign(PhysicalArrayDesign arrayDesign)
                    throws java.lang.Exception
Adds the specified ArrayDesign to the persistence store

Returns:
- An object representing the ID of the ArrayDesign being inserted or null otherwise.
Throws:
ObjectNotExistException - - When the associated substrate type, technology type, strand type, attachment type and species are not existing OntologyEntry.
InsertObjectException - - For any reasons, the array design cannot be inserted.
java.lang.Exception

updateArrayDesign

public void updateArrayDesign(PhysicalArrayDesign arrayDesign)
                       throws java.lang.Exception
Throws:
java.lang.Exception

getArrayDesignUploadedFileData

public ArrayDesignUploadedFileData getArrayDesignUploadedFileData(long id)
                                                           throws java.lang.Exception
Throws:
java.lang.Exception

deleteArrayDesign

public void deleteArrayDesign(long arrayDesignId)
                       throws java.lang.Exception
Attempts to physically delete the specified ArrayDesign if it contains no Features, Reporters and CompositeSequences. Otherwise, just marks the ArrayDesign as deleted. ArrayDesign's with failed insertion of those Features, Reporters and CompositeSequences from processes such as asynchronous parsing of GAL files are usually small and don't take much time to be physically deleted.

Parameters:
arrayDesignId -
Throws:
ObjectNotExistException
ObjectInUseException
DBException
java.lang.Exception

getArrayDesign

public PhysicalArrayDesign getArrayDesign(java.lang.String identifier)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

getArrayDesign

public PhysicalArrayDesign getArrayDesign(long id)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

isArrayDesignProvidedByAffymetrix

public boolean isArrayDesignProvidedByAffymetrix(long id)
                                          throws java.lang.Exception
Throws:
java.lang.Exception

getArrayDesigns

public PhysicalArrayDesign[] getArrayDesigns(ArrayDesignSearchCriteria searchCriteria)
                                      throws java.lang.Exception
Get an array of ArrayDesign that match the specified Criteria and that the array design is NOT marked as deleted.

Parameters:
criteria - - An ArrayDesignSearchCriteria that specifies the criteria for ArrayDesign to be searched.
Returns:
- An array of ArrayDesign if there's at least one match or a zero-length array otherwise.
Throws:
java.lang.Exception

addDesignProviderRole

public void addDesignProviderRole(long arrayDesignId,
                                  DesignProviderRole designProviderRole)
                           throws java.lang.Exception
Associate specified provider that has a role with the specified array design

Parameters:
arrayDesignId -
designProviderRole - - An association object that associates a provider with an array design.
Throws:
java.lang.Exception

removeDesignProvider

public void removeDesignProvider(long arrayDesignId,
                                 long providerId)
                          throws java.lang.Exception
Parameters:
arrayDesignId -
providerId -
Throws:
java.lang.Exception

addProtocolApplication

public long addProtocolApplication(long arrayDesignId,
                                   ProtocolApplication protApp)
                            throws java.lang.Exception
Throws:
java.lang.Exception

deletePotocolApplicationFromArrayDesign

public void deletePotocolApplicationFromArrayDesign(long arrayDesignId,
                                                    long protAppId)
                                             throws java.lang.Exception
Throws:
java.lang.Exception

addCompositeGroup

public void addCompositeGroup(long arrayDesignId,
                              long compositeGroupId)
                       throws java.lang.Exception
Add the specified CompositeGroup to the specified ArrayDesign.

Parameters:
arraydesignId - - The ID of the ArrayDesign to add the CompositeGroup to.
hardwareId - - The ID of the CompositeGroup to add to the ArrayDesign.
Throws:
ObjectNotExistException - - If either the ArrayDesign or CompositeGroup does not exist.
GeneralException - -
java.lang.Exception

removeCompositeGroup

public void removeCompositeGroup(long arrayDesignId,
                                 long compositeGroupId)
                          throws java.lang.Exception
Remove the specified CompositeGroup from the specified ArrayDesign.

Parameters:
arrayDesignId - - The ID of the ArrayDesign to remove the CompositeGroup from.
compositeGroupId - - The ID of the CompositeGroup to remove from the ArrayDesign.
Throws:
ObjectNotExistException - - If either the ArrayDesign or CompositeGroup does not exist.
GeneralException - -
java.lang.Exception

addFeatureGroup

public void addFeatureGroup(long arrayDesignId,
                            long featureGroupId)
                     throws java.lang.Exception
Add the specified FeatureGroup to the specified ArrayDesign.

Parameters:
arraydesignId - - The ID of the ArrayDesign to add the FeatureGroup to.
hardwareId - - The ID of the FeatureGroup to add to the ArrayDesign.
Throws:
ObjectNotExistException - - If either the ArrayDesign or FeatureGroup does not exist.
GeneralException - -
java.lang.Exception

removeFeatureGroup

public void removeFeatureGroup(long arrayDesignId,
                               long featureGroupId)
                        throws java.lang.Exception
Remove the specified FeatureGroup from the specified ArrayDesign.

Parameters:
arrayDesignId - - The ID of the ArrayDesign to remove the FeatureGroup from.
featureGroupId - - The ID of the FeatureGroup to remove from the ArrayDesign.
Throws:
ObjectNotExistException - - If either the ArrayDesign or FeatureGroup does not exist.
GeneralException - -
java.lang.Exception

addReporterGroup

public void addReporterGroup(long arrayDesignId,
                             long reporterGroupId)
                      throws java.lang.Exception
Add the specified ReporterGroup to the specified ArrayDesign.

Parameters:
arraydesignId - - The ID of the ArrayDesign to add the ReporterGroup to.
hardwareId - - The ID of the ReporterGroup to add to the ArrayDesign.
Throws:
ObjectNotExistException - - If either the ArrayDesign or ReporterGroup does not exist.
GeneralException - -
java.lang.Exception

removeReporterGroup

public void removeReporterGroup(long arrayDesignId,
                                long reporterGroupId)
                         throws java.lang.Exception
Remove the specified ReporterGroup from the specified ArrayDesign.

Parameters:
arrayDesignId - - The ID of the ArrayDesign to remove the ReporterGroup from.
reporterGroupId - - The ID of the ReporterGroup to remove from the ArrayDesign.
Throws:
ObjectNotExistException - - If either the ArrayDesign or ReporterGroup does not exist.
GeneralException - -
java.lang.Exception

close

public void close()
Description copied from class: ManagerDB
Close database connection.

Overrides:
close in class ManagerDB

saveArrayDesign

public void saveArrayDesign(PhysicalArrayDesign arrayDesign)
                     throws java.lang.Exception
Alternate (to addArrayDesign) method for saving an array design -- assumes that the associated OntologyEntries are correct and stores all associated objects automatically.

Parameters:
arrayDesign -
Throws:
java.lang.Exception

getArrayDesignFileUploadEntry

public ArrayDesignFileUploadEntry getArrayDesignFileUploadEntry(PhysicalArrayDesign design)
                                                         throws java.lang.Exception
Throws:
java.lang.Exception

removeExistingDesignElements

public void removeExistingDesignElements(PhysicalArrayDesign arrayDesign)
                                  throws java.lang.Exception
Parameters:
arrayDesign -
Throws:
java.lang.Exception

disableIndexesAndConstraints

public void disableIndexesAndConstraints()
                                  throws org.apache.ojb.broker.accesslayer.LookupException,
                                         java.sql.SQLException
Throws:
org.apache.ojb.broker.accesslayer.LookupException
java.sql.SQLException

enableIndexesAndConstraints

public void enableIndexesAndConstraints()
                                 throws org.apache.ojb.broker.accesslayer.LookupException,
                                        java.sql.SQLException
Throws:
org.apache.ojb.broker.accesslayer.LookupException
java.sql.SQLException

setEfficientDesignElementRetrieval

public DesignElementRetrievalSettings setEfficientDesignElementRetrieval()

setNormalDesignElementRetrieval

public void setNormalDesignElementRetrieval(DesignElementRetrievalSettings originalSettings)

updateTopLevelOnly

public void updateTopLevelOnly(PhysicalArrayDesign arrayDesign)
                        throws java.lang.Exception
Throws:
java.lang.Exception

getConnection

public java.sql.Connection getConnection()
                                  throws org.apache.ojb.broker.accesslayer.LookupException
Throws:
org.apache.ojb.broker.accesslayer.LookupException

addCompositeSequence

public void addCompositeSequence(CompositeGroup compositeGroup,
                                 CompositeSequence compositeSequence)