Package org.yamcs.mdb
Class Mdb
java.lang.Object
org.yamcs.xtce.XtceDb
org.yamcs.mdb.Mdb
- All Implemented Interfaces:
Serializable
Wraps an
XtceDb
object.
Offers persistence capabilities for selected subtrees.
- See Also:
-
Field Summary
Fields inherited from class org.yamcs.xtce.XtceDb
algorithms, argumentTypes, commands, parameters, parameterTypes, sequenceContainers, spaceSystems, YAMCS_CMD_SPACESYSTEM_NAME, YAMCS_CMDARG_SPACESYSTEM_NAME, YAMCS_CMDHIST_SPACESYSTEM_NAME, YAMCS_SPACESYSTEM_NAME
-
Constructor Summary
ConstructorsConstructorDescriptionMdb
(SpaceSystem spaceSystem, Map<String, SpaceSystemWriter> susbsystemWriters) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addParameter
(Parameter p, boolean addSpaceSystem, boolean addParameterType) void
addParameters
(List<Parameter> parameters, boolean createSpaceSystems, boolean createParameterTypes) Adds parameters to the MDB after which it persist the corresponding subtree to the filevoid
addParameterType
(ParameterType ptype, boolean createSpaceSystem) void
addParameterTypes
(List<ParameterType> ptypeList, boolean createSpaceSystem) Adds a parameter type to the MDB.createSystemParameter
(String parameterQualifiedNamed, ParameterType ptype, String shortDescription) Creates and returns a system parameter with the given qualified name.getOrCreateBasicArgumentType
(String namespace, Yamcs.Value.Type type, UnitType unit) Creates if it does not exist and returns a basic argument type corresponding to the value.getOrCreateBasicParameterType
(String namespace, Yamcs.Value.Type type, UnitType unit) Creates if it does not exist and returns a basic parameter type corresponding to the value.Methods inherited from class org.yamcs.xtce.XtceDb
addMetaCommand, addMetaCommand, addSpaceSystem, buildIndexMaps, containsNamespace, doAddArgumentType, doAddParameter, doAddParameters, doAddParameterType, getAlgorithm, getAlgorithm, getAlgorithm, getAlgorithms, getArgumentType, getContainerEntries, getIndirectParameterRefEntries, getInheritingContainers, getMetaCommand, getMetaCommand, getMetaCommand, getMetaCommands, getNamespaces, getNonStandardData, getNonStandardDataOfType, getParameter, getParameter, getParameter, getParameterEntries, getParameterNames, getParameters, getParameterType, getParameterType, getParameterType, getParameterTypes, getRootSequenceContainer, getRootSpaceSystem, getSequenceContainer, getSequenceContainer, getSequenceContainer, getSequenceContainers, getSpaceSystem, getSpaceSystem, getSpaceSystem, getSpaceSystems, isSystemParameter, isSystemParameter, print, setRootSequenceContainer, toNamedObjectId
-
Constructor Details
-
Mdb
-
-
Method Details
-
addParameter
public void addParameter(Parameter p, boolean addSpaceSystem, boolean addParameterType) throws IOException - Throws:
IOException
-
addParameters
public void addParameters(List<Parameter> parameters, boolean createSpaceSystems, boolean createParameterTypes) throws IOException Adds parameters to the MDB after which it persist the corresponding subtree to the fileIf any of spacesystems of the parameters are not writable, an IllegalArgumentException will be thrown and no parameter will be added
- Throws:
IOException
-
addParameterType
- Throws:
IOException
-
addParameterTypes
public void addParameterTypes(List<ParameterType> ptypeList, boolean createSpaceSystem) throws IOException - Throws:
IOException
-
createSystemParameter
public SystemParameter createSystemParameter(String parameterQualifiedNamed, ParameterType ptype, String shortDescription) Creates and returns a system parameter with the given qualified name. If the parameter already exists it is returned.- Parameters:
parameterQualifiedNamed
- - the name of the parmaeter to be created. It must start withXtceDb.YAMCS_SPACESYSTEM_NAME
ptype
-- Returns:
- the parameter created or already existing.
- Throws:
IllegalArgumentException
- if theparameterQualifiedNamed
does not start withXtceDb.YAMCS_SPACESYSTEM_NAME
-
addSystemParameterType
Adds a parameter type to the MDB. The type has to have the qualified name set and start withXtceDb.YAMCS_SPACESYSTEM_NAME
.If a type with the same name already exists, it is returned instead. No check is performed that the existing type and the new type are the same or even compatible.
- Parameters:
ptype
-- Returns:
-
getOrCreateBasicParameterType
public ParameterType getOrCreateBasicParameterType(String namespace, Yamcs.Value.Type type, UnitType unit) throws IOException Creates if it does not exist and returns a basic parameter type corresponding to the value.The namespace has to be writable otherwise an IllegalArgumentException will be thrown
- Throws:
IOException
-
getOrCreateBasicArgumentType
public ArgumentType getOrCreateBasicArgumentType(String namespace, Yamcs.Value.Type type, UnitType unit) throws IOException Creates if it does not exist and returns a basic argument type corresponding to the value.The namespace has to be writable otherwise an IllegalArgumentException will be thrown
- Throws:
IOException
-