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

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

public final class HardwareManagerDB
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
HardwareManagerDB()
          Default Constructor
 
Method Summary
 long addHardware(Hardware hardware)
          Add a new hardware.
 long addParameter(long hardwareId, Parameter param)
          Add a new parameter to an existing hardware.
 void addSoftwareToHardware(long hardwareId, long softwareId)
          Associates a hardware with a software.
 void checkHardwareInUse(long id)
           
 void close()
          Close persistence resources.
 boolean deleteHardware(long hardwareId)
          Remove the specified hardware from the persistence store.
 void deleteParameterFromHardware(long hardwareId, long paramId)
          Remove the specified parameter from the specified hardware and also delete the parameter from the persistence store.
 Hardware getHardware(long id)
          Retrieve the Hardware that has the specified ID.
 Organization[] getHardwareManufacturers()
          Retrieves all the Organization's that are currently associated with one or more hardware as manufacturers.
 Hardware[] getHardwares(HardwareSearchCriteria criteria)
          Get available hardwares.
 void removeSoftwareFromHardware(long hardwareId, long softwareId)
          Disassociates a software from a hardware.
 boolean updateHardware(Hardware hardware)
          Update an existing hardware.
 
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

HardwareManagerDB

public HardwareManagerDB()
Default Constructor

Method Detail

getHardwares

public Hardware[] getHardwares(HardwareSearchCriteria criteria)
Get available hardwares.

Returns:

getHardware

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

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

addHardware

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

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

updateHardware

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

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

addParameter

public long addParameter(long hardwareId,
                         Parameter param)
                  throws java.lang.Exception
Add a new parameter to an existing hardware.

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

deleteParameterFromHardware

public void deleteParameterFromHardware(long hardwareId,
                                        long paramId)
                                 throws java.lang.Exception
Remove the specified parameter from the specified hardware and also delete the parameter from the persistence store.

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

addSoftwareToHardware

public void addSoftwareToHardware(long hardwareId,
                                  long softwareId)
                           throws java.lang.Exception
Associates a hardware with a software.

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

removeSoftwareFromHardware

public void removeSoftwareFromHardware(long hardwareId,
                                       long softwareId)
                                throws java.lang.Exception
Disassociates a software from a hardware.

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

deleteHardware

public boolean deleteHardware(long hardwareId)
                       throws java.lang.Exception
Remove the specified hardware from the persistence store.

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

getHardwareManufacturers

public Organization[] getHardwareManufacturers()
                                        throws java.lang.Exception
Retrieves all the Organization's that are currently associated with one or more hardware as manufacturers.

Returns:
Throws:
DBException
java.lang.Exception

close

public void close()
Close persistence resources.

Overrides:
close in class ManagerDB

checkHardwareInUse

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