public class Factories extends Object
| Modifier and Type | Method and Description |
|---|---|
static ConfigProfile |
copyProfile(ConfigProfile toBeCopied,
String newName,
String newUserName,
int newLevel,
boolean toEngineering)
to be used to create a copy of configuration with different name , tag, etc.
|
static ConfigProfile |
copyProfileForRegistration(ConfigProfile toBeCopied,
String newName,
String userName,
int newLevel,
boolean getRidOfStaticParameters)
Copies a configuration profile and removes parameter configurations that
act on static data.
|
static ConfigProfile |
createConfigProfile(SubsystemDescription subsystemDesc,
String userName,
int level,
String categoryName,
String configName)
Creates a ConfigProfile with ParameterConfiguration where values
are just copied from the Description default value.
|
static ParameterConfiguration |
createParameterConfiguration(ParameterDescription description)
factory method to create a ParameterConfiguration object.
|
static ParameterConfiguration |
createParameterConfiguration(ParameterDescription description,
String value)
Factory method to create a ParameterConfiguration object.
|
static ParameterDescription |
createParameterDescription(ParameterBase parameterBase,
String description,
String simpleName,
String constraints,
String category,
int level)
factory method to create a new ParameterDescription.
|
static ParameterDescription |
createParameterDescription(ParameterDescription other)
Factory method to create a new ParameterDescription from another one.
|
static ConfigProfile |
createRawConfigProfile(SubsystemDescription subsystemDesc,
String userName,
int level,
String category,
String configName)
Creates an empty ConfigProfile.
|
static SubsystemDescription |
createRawSubsystemDescription(String subsystemName,
String tag,
String user,
String version,
Serializable configurationData,
DataFlavour dataFlavour)
Creates a new
SubsystemDescription object without any ParameterDescription list creation. |
static SubsystemDescription |
createSubsystemDescription(String subsystemName,
String tag,
String user,
String version,
Serializable configurationData,
DataFlavour dataFlavour,
ParameterFilter filter)
creates a new
SubsystemDescription populated with "empty" ParameterDescriptions. |
static SubsystemDescription |
createSubsystemDescriptionCopy(SubsystemDescription desc)
creates a new SubsystemDescription from another.
|
static ConfigProfile |
repair(ConfigProfile oldProfile,
SubsystemDescription newDescription,
ConfigurationMismatchListener mismatchListener)
tries to create a new ConfigProfile from an old one.
|
static void |
tryCopyParameters(SubsystemDescription newDescription,
SubsystemDescription model,
DescriptionMismatchListener mismatchListener)
tries to copy ParameterDescription from a model to a new subsystem description.
|
public static SubsystemDescription createRawSubsystemDescription(String subsystemName, String tag, String user, String version, Serializable configurationData, DataFlavour dataFlavour)
SubsystemDescription object without any ParameterDescription list creation.
The object is not registered in the database since it is to be populated by ParameterDescription objects.
To populate the descriptions get the base descriptions from the Subsystemdescription by calling a version
of getBaseParameters or getParameterDescriptions and generate the descriptions from these bases.subsystemName - tag - user - version - configurationData - dataFlavour - SubsystemDescription object without parameter descriptionspublic static SubsystemDescription createSubsystemDescription(String subsystemName, String tag, String user, String version, Serializable configurationData, DataFlavour dataFlavour, ParameterFilter filter)
SubsystemDescription populated with "empty" ParameterDescriptions.
The object is not in the database since the list of descriptions should be modified first.subsystemName - tag - user - version - configurationData - dataFlavour - filter - SubsystemDescription object containing the description of the parameters
as described in configurationData.public static SubsystemDescription createSubsystemDescriptionCopy(SubsystemDescription desc)
desc - public static ParameterDescription createParameterDescription(ParameterBase parameterBase, String description, String simpleName, String constraints, String category, int level)
parameterBase - description - simpleName - constraints - category - level - ParameterDescription object built out of the issued
argumentspublic static ParameterDescription createParameterDescription(ParameterDescription other)
other - public static void tryCopyParameters(SubsystemDescription newDescription, SubsystemDescription model, DescriptionMismatchListener mismatchListener)
newDescription - a subsystem description without any ParameterDescriptionmodel - mismatchListener - optional code that will be warned when inconsistencies occurpublic static ConfigProfile createRawConfigProfile(SubsystemDescription subsystemDesc, String userName, int level, String category, String configName)
ParameterConfiguration list.subsystemDesc - should be read from the databaseuserName - level - category - configName - ConfigProfileIllegalArgumentException - if subsystemdescription not in databasepublic static ConfigProfile createConfigProfile(SubsystemDescription subsystemDesc, String userName, int level, String categoryName, String configName)
subsystemDesc - should be already in the databaseuserName - level - categoryName - configName - IllegalArgumentException - if subsystemdescription not in databasepublic static ConfigProfile copyProfile(ConfigProfile toBeCopied, String newName, String newUserName, int newLevel, boolean toEngineering)
toBeCopied - for the moment should be an "active" ConfigProfile (not a deprecated one)newName - newUserName - newLevel - toEngineering - public static ConfigProfile copyProfileForRegistration(ConfigProfile toBeCopied, String newName, String userName, int newLevel, boolean getRidOfStaticParameters)
toBeCopied - newName - userName - newLevel - getRidOfStaticParameters - public static ParameterConfiguration createParameterConfiguration(ParameterDescription description, String value)
description parameter description and
attempts to assign a new configured value to it.
This factory method is to be used statically exclusively (ie not when a
subsystem is running).description - value - descriptionpublic static ParameterConfiguration createParameterConfiguration(ParameterDescription description)
description - public static ConfigProfile repair(ConfigProfile oldProfile, SubsystemDescription newDescription, ConfigurationMismatchListener mismatchListener)
oldProfile - newDescription - an active subsystemDescription already registered in the databsemismatchListener - Copyright © 2015 LSST. All rights reserved.