org.lsst.ccs.config.remote
Class ConfigurationServiceImpl

java.lang.Object
  extended by org.lsst.ccs.config.remote.ConfigurationServiceImpl
All Implemented Interfaces:
Remote, ConfigurationService

public class ConfigurationServiceImpl
extends Object
implements ConfigurationService

A raw implementation of Configuration Service that delegates to a ConfigurationFacade object.

Author:
bamade

Field Summary
static ConfigurationServiceImpl ON_HIBERNATE
           
static ConfigurationServiceImpl ON_LOCAL_FILES
           
 
Constructor Summary
ConfigurationServiceImpl(ConfigurationFacade facade)
           
 
Method Summary
 void createPreparedConfiguration(String subsystemName, String configName, String tag, String user)
          generates in the database a special entry with a merge of description and configuration
 ProfileResult deprecateConfigProfile(String name, String tag)
          Deprecates a valid Configuration Profile.
 DescriptionResult deprecateSubsystemDescription(String subsystemName, String tag)
          Deprecates a registered subsystem.
 ConfigProfile getActiveConfigProfile(String name, String tag)
          gets an active ConfigProfile with anme and tag
 SubsystemDescription getActiveSubsystemDescription(String name, String tag)
          fetch the active Description with name and tag
 String getActiveValueAt(String subsystemName, String parameterPath, long date)
          gets the value of a parameter for a subsystem which was active at a moment in time.
 ConfigProfile getConfigRunningAt(String subsystemName, long date)
          Returns the Configuration which was running for a given subsystem at a moment in time
 ConfigProfile getConfigValidAt(String name, String tag, long date)
          Gets a ConfigProfile which was (or is) valid at a precise moment.
 ConfigurationFacade getFacade()
           
 MachineConfiguration getMachineConfiguration(String macAddress)
          get the machine configuration for a specific machine
 ConfigProfile getNext(ConfigProfile current)
          Gets a (deprecated or "alive") ConfigProfile with same name and tag as the argument
 ConfigProfile getPrevious(ConfigProfile current)
          gets a (deprecated) ConfigProfile with same name and tag as the argument.
 SubsystemDescription getPrevious(SubsystemDescription current)
          Gets the (deprecated) SubsystemDescription with same characteritics as the argument
 String getValueValidAt(String profileName, String profileTag, String parameterPath, long date)
          Gets the value of a Parameter which was valid at a moment in time.
 ParameterConfiguration modifyParmConf(ParameterConfiguration engineeringModeParm)
          Registers a modification to a ParameterConfiguration operated through ConfigProfile.temporaryChangeConfigurationValue
 ProfileResult registerConfigProfile(ConfigProfile newProfile)
          Registers a new ConfigProfile in the configuration service.
 ProfileResult registerConfiguration(String subsystemName, String configurationName, String tag, String user, int level, Properties props)
          typical remote service: a local properties structure is base for creating a new ConfigProfile
 void registerMachineConfiguration(MachineConfiguration machineConfiguration)
          registers in the database a machineConfiguration entry
 DescriptionResult registerSubsystemDescription(SubsystemDescription newDescription)
          Registers in the configuration service a new subsystem description (created through Factories code.
 List<?> simpleHQLRequest(String hqlString)
          can send a simple HQL request to the underlying Database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ON_HIBERNATE

public static ConfigurationServiceImpl ON_HIBERNATE

ON_LOCAL_FILES

public static ConfigurationServiceImpl ON_LOCAL_FILES
Constructor Detail

ConfigurationServiceImpl

public ConfigurationServiceImpl(ConfigurationFacade facade)
Method Detail

getFacade

public ConfigurationFacade getFacade()

registerSubsystemDescription

public DescriptionResult registerSubsystemDescription(SubsystemDescription newDescription)
                                               throws RemoteException
Description copied from interface: ConfigurationService
Registers in the configuration service a new subsystem description (created through Factories code.

Specified by:
registerSubsystemDescription in interface ConfigurationService
Parameters:
newDescription - do not use this object any more after the call
Returns:
a data structure containing a reference to an immutable registered subsystem (use getResult()) a possible deprecated subsystem which has been replaced by the newDescription and a list of possible deprecated ConfigProfile that were referencing the obsolete subsystem
Throws:
RemoteException

deprecateSubsystemDescription

public DescriptionResult deprecateSubsystemDescription(String subsystemName,
                                                       String tag)
                                                throws RemoteException
Description copied from interface: ConfigurationService
Deprecates a registered subsystem.

Specified by:
deprecateSubsystemDescription in interface ConfigurationService
Returns:
a data structure with the deprecated subsystem (or null if not found) and a list of ConfigProfile that may have been deprecated
Throws:
RemoteException

getActiveSubsystemDescription

public SubsystemDescription getActiveSubsystemDescription(String name,
                                                          String tag)
                                                   throws RemoteException
Description copied from interface: ConfigurationService
fetch the active Description with name and tag

Specified by:
getActiveSubsystemDescription in interface ConfigurationService
Returns:
Throws:
RemoteException

registerConfigProfile

public ProfileResult registerConfigProfile(ConfigProfile newProfile)
                                    throws RemoteException
Description copied from interface: ConfigurationService
Registers a new ConfigProfile in the configuration service. The object must have been created with Factories using a registered valid SubsystemDescription

Specified by:
registerConfigProfile in interface ConfigurationService
Parameters:
newProfile - do not use this object any more after the call
Returns:
a data structure containing an immutable registered Objecta (use getResult()) and possibly a deprecated profile it replaces.
Throws:
RemoteException

registerConfiguration

public ProfileResult registerConfiguration(String subsystemName,
                                           String configurationName,
                                           String tag,
                                           String user,
                                           int level,
                                           Properties props)
                                    throws RemoteException
Description copied from interface: ConfigurationService
typical remote service: a local properties structure is base for creating a new ConfigProfile

Specified by:
registerConfiguration in interface ConfigurationService
Returns:
Throws:
RemoteException

deprecateConfigProfile

public ProfileResult deprecateConfigProfile(String name,
                                            String tag)
                                     throws RemoteException
Description copied from interface: ConfigurationService
Deprecates a valid Configuration Profile.

Specified by:
deprecateConfigProfile in interface ConfigurationService
Parameters:
name - configuration name
Returns:
a data structure containing the deprecated object (or null if not found)
Throws:
RemoteException

getActiveConfigProfile

public ConfigProfile getActiveConfigProfile(String name,
                                            String tag)
                                     throws RemoteException
Description copied from interface: ConfigurationService
gets an active ConfigProfile with anme and tag

Specified by:
getActiveConfigProfile in interface ConfigurationService
Returns:
null if no such configuration
Throws:
RemoteException

modifyParmConf

public ParameterConfiguration modifyParmConf(ParameterConfiguration engineeringModeParm)
                                      throws RemoteException
Description copied from interface: ConfigurationService
Registers a modification to a ParameterConfiguration operated through ConfigProfile.temporaryChangeConfigurationValue

Specified by:
modifyParmConf in interface ConfigurationService
Parameters:
engineeringModeParm - a ParameterConfiguration object which is registered in a registered ConfigProfile object in engineering mode (see Factories.copyProfile and register the resulting profile before calling this method)
Returns:
its argument (can be reused for other calls of temporaryChange)
Throws:
RemoteException

getConfigRunningAt

public ConfigProfile getConfigRunningAt(String subsystemName,
                                        long date)
                                 throws RemoteException
Description copied from interface: ConfigurationService
Returns the Configuration which was running for a given subsystem at a moment in time

NOTE: this method will not work on "dummy local services"

Specified by:
getConfigRunningAt in interface ConfigurationService
Returns:
Throws:
RemoteException

getActiveValueAt

public String getActiveValueAt(String subsystemName,
                               String parameterPath,
                               long date)
                        throws RemoteException
Description copied from interface: ConfigurationService
gets the value of a parameter for a subsystem which was active at a moment in time.

NOTE: this method will not work on "dummy local services"

Specified by:
getActiveValueAt in interface ConfigurationService
Returns:
Throws:
RemoteException

getConfigValidAt

public ConfigProfile getConfigValidAt(String name,
                                      String tag,
                                      long date)
                               throws RemoteException
Description copied from interface: ConfigurationService
Gets a ConfigProfile which was (or is) valid at a precise moment.

NOTE: this method will not work on "dummy local services"

Specified by:
getConfigValidAt in interface ConfigurationService
Returns:
null if not found
Throws:
RemoteException

getValueValidAt

public String getValueValidAt(String profileName,
                              String profileTag,
                              String parameterPath,
                              long date)
                       throws RemoteException
Description copied from interface: ConfigurationService
Gets the value of a Parameter which was valid at a moment in time.

NOTE: this method will not work on "dummy local services"

there is no need for a susbsystem name since at a moment in time there is only one subsystem known to a combintaiton of config name and tag.

Specified by:
getValueValidAt in interface ConfigurationService
Returns:
Throws:
RemoteException

getPrevious

public ConfigProfile getPrevious(ConfigProfile current)
                          throws RemoteException
Description copied from interface: ConfigurationService
gets a (deprecated) ConfigProfile with same name and tag as the argument.

Specified by:
getPrevious in interface ConfigurationService
Returns:
Throws:
RemoteException

getNext

public ConfigProfile getNext(ConfigProfile current)
                      throws RemoteException
Description copied from interface: ConfigurationService
Gets a (deprecated or "alive") ConfigProfile with same name and tag as the argument

Specified by:
getNext in interface ConfigurationService
Returns:
Throws:
RemoteException

getPrevious

public SubsystemDescription getPrevious(SubsystemDescription current)
                                 throws RemoteException
Description copied from interface: ConfigurationService
Gets the (deprecated) SubsystemDescription with same characteritics as the argument

Specified by:
getPrevious in interface ConfigurationService
Returns:
Throws:
RemoteException

createPreparedConfiguration

public void createPreparedConfiguration(String subsystemName,
                                        String configName,
                                        String tag,
                                        String user)
                                 throws RemoteException
Description copied from interface: ConfigurationService
generates in the database a special entry with a merge of description and configuration

Specified by:
createPreparedConfiguration in interface ConfigurationService
Throws:
RemoteException

registerMachineConfiguration

public void registerMachineConfiguration(MachineConfiguration machineConfiguration)
                                  throws RemoteException
Description copied from interface: ConfigurationService
registers in the database a machineConfiguration entry

Specified by:
registerMachineConfiguration in interface ConfigurationService
Throws:
RemoteException

getMachineConfiguration

public MachineConfiguration getMachineConfiguration(String macAddress)
                                             throws RemoteException
Description copied from interface: ConfigurationService
get the machine configuration for a specific machine

Specified by:
getMachineConfiguration in interface ConfigurationService
Returns:
Throws:
RemoteException

simpleHQLRequest

public List<?> simpleHQLRequest(String hqlString)
                         throws RemoteException
Description copied from interface: ConfigurationService
can send a simple HQL request to the underlying Database. It is assumed that the request is only a "read" (a SELECT equivalent) -though this is not checked-

NOTE: this method will not work on "dummy local services"

Specified by:
simpleHQLRequest in interface ConfigurationService
Returns:
Throws:
RemoteException


Copyright © 2013 LSST. All Rights Reserved.