gov.nih.nci.caarray.services.protocol
Class SoftwareManagerDB

java.lang.Object
  extended by gov.nih.nci.caarray.services.util.db.ManagerDB
      extended by gov.nih.nci.caarray.services.protocol.SoftwareManagerDB

public final class SoftwareManagerDB
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
SoftwareManagerDB()
          Default Constructor
 
Method Summary
 void addHardwareToSoftware(long softwareId, long hardwareId)
          Associates a software with a hardware.
 long addParameter(long softwareId, Parameter param)
          Add the new parameter to the specified software.
 long addSoftware(Software software)
          Add a new software.
 void addSoftwareToSoftware(long softwareId, long theOtherSoftwareId)
          Associates a software with another software.
 void checkSoftwareInUse(long id)
           
 void close()
          Close database connection.
 void deleteParameterFromSoftware(long softwareId, long paramId)
          Remove the parameter from the software and also delete the parameter from the persistence store.
 boolean deleteSoftware(long softwareId)
          Deletes the specified software from the persistence store.
 Software getSoftware(long id)
          Retrieve the Software that has the specified ID.
 Organization[] getSoftwareManufacturers()
           
 Software[] getSoftwares(SoftwareSearchCriteria criteria)
          Get available softwares.
 void removeHardwareFromSoftware(long softwareId)
          Disassociates a hardware from a software.
 void removeSoftwareFromSoftware(long softwareId, long theOtherSoftwareId)
          Removes a software from another software.
 boolean updateSoftware(Software software)
          Update an existing software.
 
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

SoftwareManagerDB

public SoftwareManagerDB()
Default Constructor

Method Detail

getSoftwares

public Software[] getSoftwares(SoftwareSearchCriteria criteria)
                        throws java.lang.Exception
Get available softwares.

Returns:
Throws:
java.lang.Exception

getSoftware

public Software getSoftware(long id)
                     throws java.lang.Exception
Retrieve the Software that has the specified ID.

Parameters:
id -
Returns:
Throws:
java.lang.Exception

addSoftware

public long addSoftware(Software software)
                 throws java.lang.Exception
Add a new software. The software type can be a new or an existing vocabulary whereas nanufacturer(s) must be an existing Organization.

Parameters:
software -
Throws:
InsertObjectException - - If the specified software is NULL or any database exception occurs.
java.lang.Exception

updateSoftware

public boolean updateSoftware(Software software)
                       throws java.lang.Exception
Update an existing software. The software type can be a new or an existing vocabulary whereas nanufacturer(s) must be an existing Organization.

Parameters:
software -
Throws:
InsertObjectException - - If the specified software is NULL or any database exception occurs.
java.lang.Exception

addParameter

public long addParameter(long softwareId,
                         Parameter param)
                  throws java.lang.Exception
Add the new parameter to the specified software.

Parameters:
softwareId -
param -
Throws:
ObjectNotExistException
GeneralException
java.lang.Exception

deleteParameterFromSoftware

public void deleteParameterFromSoftware(long softwareId,
                                        long paramId)
                                 throws java.lang.Exception
Remove the parameter from the software and also delete the parameter from the persistence store.

Parameters:
softwareId -
paramId -
Throws:
ObjectNotExistException
GeneralException
java.lang.Exception

addHardwareToSoftware

public void addHardwareToSoftware(long softwareId,
                                  long hardwareId)
                           throws java.lang.Exception
Associates a software with a hardware. A software has only one hardware.

Parameters:
softwareId -
hardwareId -
Throws:
ObjectNotExistException
GeneralException
java.lang.Exception

removeHardwareFromSoftware

public void removeHardwareFromSoftware(long softwareId)
                                throws java.lang.Exception
Disassociates a hardware from a software. Since a software has only hardware the disassociating just removes the association without having to know which hardware it is.

Parameters:
softwareId -
Throws:
ObjectNotExistException
DBException
java.lang.Exception

addSoftwareToSoftware

public void addSoftwareToSoftware(long softwareId,
                                  long theOtherSoftwareId)
                           throws java.lang.Exception
Associates a software with another software.

Parameters:
hardwareId -
theOtherSoftwareId -
Throws:
ObjectNotExistException
DBException
java.lang.Exception

removeSoftwareFromSoftware

public void removeSoftwareFromSoftware(long softwareId,
                                       long theOtherSoftwareId)
                                throws java.lang.Exception
Removes a software from another software.

Parameters:
softwareId -
theOtherSoftwareId -
Throws:
ObjectNotExistException
DBException
java.lang.Exception

deleteSoftware

public boolean deleteSoftware(long softwareId)
                       throws java.lang.Exception
Deletes the specified software from the persistence store.

Parameters:
softwareId -
Returns:
Throws:
ObjectInUseException
DBException
java.lang.Exception

getSoftwareManufacturers

public Organization[] getSoftwareManufacturers()
                                        throws java.lang.Exception
Throws:
java.lang.Exception

close

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

Overrides:
close in class ManagerDB

checkSoftwareInUse

public void checkSoftwareInUse(long id)
                        throws java.lang.Exception
Throws:
java.lang.Exception