org.lsst.ccs.config
Class ConfigProfile

java.lang.Object
  extended by org.lsst.ccs.config.ConfigProfile
All Implemented Interfaces:
Serializable

@MappedSuperclass
public abstract class ConfigProfile
extends Object
implements Serializable

This class represents a set of parameter that have been modified for a given subsystem.

Important notice : for the moment an active configuration profile has a name and a tag. This combination is unique amongst active profile. BUT this is not the case once data of this type has been "pushed in history" :

So these naming strategies should be re-evaluated after some experimental uses.

Author:
bamade
See Also:
Serialized Form

Constructor Summary
protected ConfigProfile()
           
protected ConfigProfile(String name, String tag, String userName, int level)
           
 
Method Summary
abstract  void addParameterConfigurations(ParameterConfiguration... parameterConfigurations)
          registers a list of parameter configurations
 boolean equals(Object o)
           
 ParameterConfiguration fetch(PathObject path)
           
 void generateConfigProperties(PrintWriter printer)
          prints to a property file a template that represents this ConfigProfile
 long getEndTimestamp()
           
protected abstract  long getId()
           
 int getLevel()
           
abstract  org.lsst.gruth.jutils.ComponentNode getModifiedConfigurationData()
          prepares a new executable configuration data with these modified parameters.
abstract  Set<? extends ParameterConfiguration> getModifiedParameters()
           
 String getName()
           
 long getPreviousConfigID()
          may return the id of a previous ConfigProfile (0L if none)
 String getRemarks()
           
 long getStartTimestamp()
           
abstract  SubsystemDescription getSubsystemDescription()
           
 String getSubsystemName()
           
 String getTag()
           
 String getUserName()
           
 String getValueAt(String parameterPath, long date)
          gives the value of a given parameter at a given date on a ConfigProfile object.
 int hashCode()
           
 boolean isBeenInEngineeringMode()
           
 boolean isReadOnly()
           
abstract  void mergeProperties(Properties props)
          populates this configProfile with values extracted from a Properties object.
abstract  void removeParameterConfigurations(ParameterConfiguration... parameterConfigurations)
          removes a list of parameter configurations
protected abstract  void setId(long id)
           
 void setRemarks(String remarks)
          no influence on behaviour.
protected  void setStartTimestamp(long startTimestamp)
           
abstract  void temporaryChangeConfigurationValue(ParameterConfiguration parameter, long time, String value)
           
abstract  ParameterConfiguration temporaryChangeConfigurationValue(String parameterPath, long time, String value)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConfigProfile

protected ConfigProfile()

ConfigProfile

protected ConfigProfile(String name,
                        String tag,
                        String userName,
                        int level)
Method Detail

getId

protected abstract long getId()

setId

protected abstract void setId(long id)

getSubsystemDescription

public abstract SubsystemDescription getSubsystemDescription()

getModifiedParameters

public abstract Set<? extends ParameterConfiguration> getModifiedParameters()

temporaryChangeConfigurationValue

public abstract void temporaryChangeConfigurationValue(ParameterConfiguration parameter,
                                                       long time,
                                                       String value)

temporaryChangeConfigurationValue

public abstract ParameterConfiguration temporaryChangeConfigurationValue(String parameterPath,
                                                                         long time,
                                                                         String value)

isReadOnly

public boolean isReadOnly()

isBeenInEngineeringMode

public boolean isBeenInEngineeringMode()

getName

public String getName()

getSubsystemName

public String getSubsystemName()

getTag

public String getTag()

getStartTimestamp

public long getStartTimestamp()

setStartTimestamp

protected void setStartTimestamp(long startTimestamp)

getEndTimestamp

public long getEndTimestamp()

getUserName

public String getUserName()

getLevel

public int getLevel()

getRemarks

public String getRemarks()

setRemarks

public void setRemarks(String remarks)
no influence on behaviour.

Parameters:
remarks -

getPreviousConfigID

public long getPreviousConfigID()
may return the id of a previous ConfigProfile (0L if none)

Returns:

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

fetch

public ParameterConfiguration fetch(PathObject path)

generateConfigProperties

public void generateConfigProperties(PrintWriter printer)
prints to a property file a template that represents this ConfigProfile

Parameters:
printer -

mergeProperties

public abstract void mergeProperties(Properties props)
populates this configProfile with values extracted from a Properties object.

Parameters:
props -
Throws:
IllegalArgumentException - if this profile is read only or if a value is illegal

addParameterConfigurations

public abstract void addParameterConfigurations(ParameterConfiguration... parameterConfigurations)
registers a list of parameter configurations

Parameters:
parameterConfigurations -
Throws:
ImmutableStateException - if the object is already registered in database
IllegalArgumentException - if levels are incompatibles
IllegalArgumentException - if the corresponding parameter descriptions are not alive in the current subsystem description

removeParameterConfigurations

public abstract void removeParameterConfigurations(ParameterConfiguration... parameterConfigurations)
removes a list of parameter configurations

Parameters:
parameterConfigurations -
Throws:
ImmutableStateException - if operated on an object registered to the database

getModifiedConfigurationData

public abstract org.lsst.gruth.jutils.ComponentNode getModifiedConfigurationData()
prepares a new executable configuration data with these modified parameters. used by PreparedConfiguration objects.

Returns:

getValueAt

public String getValueAt(String parameterPath,
                         long date)
gives the value of a given parameter at a given date on a ConfigProfile object. beware : the main goal of this method is to fetch a transient parameter set during an engineering mode session. Otherwise it just returns the value of the parameter without any time stamp check (it is supposed that the ConfigProfile object was the one active at this date.

Parameters:
parameterPath -
date -
Returns:


Copyright © 2013 LSST. All Rights Reserved.