org.lsst.ccs.config
Class FIleBasedDAO

java.lang.Object
  extended by org.lsst.ccs.config.FIleBasedDAO
All Implemented Interfaces:
DBInterface
Direct Known Subclasses:
MemoryDAO

public class FIleBasedDAO
extends Object
implements DBInterface

Creates a dummy file-based Configuration database. all history operations are unsupported (as are SQL requests). The numbering scheme for ID are negative values and so can be detected

Author:
bamade

Constructor Summary
FIleBasedDAO()
           
FIleBasedDAO(boolean notFromFile)
          dummy constructor used by MemoryDAO
 
Method Summary
 void begin()
          starts a transaction
 void close()
          claose all
 void deleteActiveConfigProfile(org.lsst.ccs.config.AConfigProfile oldProfile)
          delectes the active profile from DB
 void deleteActiveSubsystemDescription(org.lsst.ccs.config.ASubsystemDescription oldDescription)
          deletes an active description
 void end()
          end a transaction
 void fail()
          failure: must close transaction
 void fail(Throwable th)
          same as fail but a Throwable can be used to log.
 org.lsst.ccs.config.AConfigProfile getActiveConfigProfile(String name, String tag)
          get configProfile with name and tag
 Collection<org.lsst.ccs.config.AConfigProfile> getActiveProfilesForSubsystem(org.lsst.ccs.config.ASubsystemDescription description)
          gets the active configProfiles that references an active SubsystemDescription
 org.lsst.ccs.config.ASubsystemDescription getActiveSubsystemDescription(long id)
          gets a subsystem descirption by it"s id
 org.lsst.ccs.config.ASubsystemDescription getActiveSubsystemDescription(String name, String tag)
          gets a SubsystemDescription in the corresponding active object table.
 org.lsst.ccs.config.GhostSubsystemDescription getGhostDescription(long id)
          returns ghost with corresponding id
 MachineConfiguration getMachineConfiguration(String macAddress)
          get a machine configuration..
 PreparedConfiguration getPreparedConfiguration(String subsystemName, String configName, String tag)
          returns a prepared Configuration
 Collection<org.lsst.ccs.config.PastConfigProfile> getProfilesForSubsystem(org.lsst.ccs.config.GhostSubsystemDescription description)
          get the deprecated ConfigProfile that referenced a subsystemDescription (active or deprecated)
 void modifyParmConfig(org.lsst.ccs.config.AParameterConfiguration config)
          registers a modified parameter
 void saveConfigProfile(org.lsst.ccs.config.AConfigProfile newProfile)
          saves the new argument: ID is modified and argument becomes immutable.
 void saveGhostDescriptions(org.lsst.ccs.config.GhostSubsystemDescription ghosts)
          saves the argument
 void saveMachineConfiguration(MachineConfiguration machineConfiguration)
          saves a machine configuration
 void savePastProfile(org.lsst.ccs.config.PastConfigProfile deprecatedProfile)
          saves argument
 void savePreparedConfiguration(PreparedConfiguration preparedConfiguration)
          saves a preparedConfiguration
 void saveRun(RunHistory runHistory)
          saves a run history
 void saveSubsystemDescription(org.lsst.ccs.config.ASubsystemDescription newDescription)
          saves the argument: which must now becomes immutable and be numbered (with an ID)
 List<?> simpleHQLRequest(String hqlString)
          execut simple request (read only: select of From)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FIleBasedDAO

public FIleBasedDAO()

FIleBasedDAO

public FIleBasedDAO(boolean notFromFile)
dummy constructor used by MemoryDAO

Parameters:
notFromFile -
Method Detail

begin

public void begin()
Description copied from interface: DBInterface
starts a transaction

Specified by:
begin in interface DBInterface

end

public void end()
Description copied from interface: DBInterface
end a transaction

Specified by:
end in interface DBInterface

fail

public void fail()
Description copied from interface: DBInterface
failure: must close transaction

Specified by:
fail in interface DBInterface

fail

public void fail(Throwable th)
Description copied from interface: DBInterface
same as fail but a Throwable can be used to log.

Specified by:
fail in interface DBInterface

saveSubsystemDescription

public void saveSubsystemDescription(org.lsst.ccs.config.ASubsystemDescription newDescription)
Description copied from interface: DBInterface
saves the argument: which must now becomes immutable and be numbered (with an ID)

Specified by:
saveSubsystemDescription in interface DBInterface

saveGhostDescriptions

public void saveGhostDescriptions(org.lsst.ccs.config.GhostSubsystemDescription ghosts)
Description copied from interface: DBInterface
saves the argument

Specified by:
saveGhostDescriptions in interface DBInterface

getActiveSubsystemDescription

public org.lsst.ccs.config.ASubsystemDescription getActiveSubsystemDescription(String name,
                                                                               String tag)
Description copied from interface: DBInterface
gets a SubsystemDescription in the corresponding active object table.

Specified by:
getActiveSubsystemDescription in interface DBInterface
Returns:
null if not found

getActiveSubsystemDescription

public org.lsst.ccs.config.ASubsystemDescription getActiveSubsystemDescription(long id)
Description copied from interface: DBInterface
gets a subsystem descirption by it"s id

Specified by:
getActiveSubsystemDescription in interface DBInterface
Returns:

getGhostDescription

public org.lsst.ccs.config.GhostSubsystemDescription getGhostDescription(long id)
Description copied from interface: DBInterface
returns ghost with corresponding id

Specified by:
getGhostDescription in interface DBInterface
Returns:
null if not found

deleteActiveSubsystemDescription

public void deleteActiveSubsystemDescription(org.lsst.ccs.config.ASubsystemDescription oldDescription)
Description copied from interface: DBInterface
deletes an active description

Specified by:
deleteActiveSubsystemDescription in interface DBInterface

saveConfigProfile

public void saveConfigProfile(org.lsst.ccs.config.AConfigProfile newProfile)
Description copied from interface: DBInterface
saves the new argument: ID is modified and argument becomes immutable.

Specified by:
saveConfigProfile in interface DBInterface

savePastProfile

public void savePastProfile(org.lsst.ccs.config.PastConfigProfile deprecatedProfile)
Description copied from interface: DBInterface
saves argument

Specified by:
savePastProfile in interface DBInterface

getActiveConfigProfile

public org.lsst.ccs.config.AConfigProfile getActiveConfigProfile(String name,
                                                                 String tag)
Description copied from interface: DBInterface
get configProfile with name and tag

Specified by:
getActiveConfigProfile in interface DBInterface
Returns:
null if not found

deleteActiveConfigProfile

public void deleteActiveConfigProfile(org.lsst.ccs.config.AConfigProfile oldProfile)
Description copied from interface: DBInterface
delectes the active profile from DB

Specified by:
deleteActiveConfigProfile in interface DBInterface

modifyParmConfig

public void modifyParmConfig(org.lsst.ccs.config.AParameterConfiguration config)
Description copied from interface: DBInterface
registers a modified parameter

Specified by:
modifyParmConfig in interface DBInterface

getActiveProfilesForSubsystem

public Collection<org.lsst.ccs.config.AConfigProfile> getActiveProfilesForSubsystem(org.lsst.ccs.config.ASubsystemDescription description)
Description copied from interface: DBInterface
gets the active configProfiles that references an active SubsystemDescription

Specified by:
getActiveProfilesForSubsystem in interface DBInterface
Returns:

getProfilesForSubsystem

public Collection<org.lsst.ccs.config.PastConfigProfile> getProfilesForSubsystem(org.lsst.ccs.config.GhostSubsystemDescription description)
Description copied from interface: DBInterface
get the deprecated ConfigProfile that referenced a subsystemDescription (active or deprecated)

Specified by:
getProfilesForSubsystem in interface DBInterface
Returns:

saveRun

public void saveRun(RunHistory runHistory)
Description copied from interface: DBInterface
saves a run history

Specified by:
saveRun in interface DBInterface

savePreparedConfiguration

public void savePreparedConfiguration(PreparedConfiguration preparedConfiguration)
Description copied from interface: DBInterface
saves a preparedConfiguration

Specified by:
savePreparedConfiguration in interface DBInterface

getPreparedConfiguration

public PreparedConfiguration getPreparedConfiguration(String subsystemName,
                                                      String configName,
                                                      String tag)
Description copied from interface: DBInterface
returns a prepared Configuration

Specified by:
getPreparedConfiguration in interface DBInterface
Returns:
null if not found

saveMachineConfiguration

public void saveMachineConfiguration(MachineConfiguration machineConfiguration)
Description copied from interface: DBInterface
saves a machine configuration

Specified by:
saveMachineConfiguration in interface DBInterface

getMachineConfiguration

public MachineConfiguration getMachineConfiguration(String macAddress)
Description copied from interface: DBInterface
get a machine configuration..

Specified by:
getMachineConfiguration in interface DBInterface
Returns:
null if not found

simpleHQLRequest

public List<?> simpleHQLRequest(String hqlString)
Description copied from interface: DBInterface
execut simple request (read only: select of From)

Specified by:
simpleHQLRequest in interface DBInterface
Returns:

close

public void close()
Description copied from interface: DBInterface
claose all

Specified by:
close in interface DBInterface


Copyright © 2013 LSST. All Rights Reserved.