Package org.yamcs.mdb

Class Mdb

java.lang.Object
org.yamcs.xtce.XtceDb
org.yamcs.mdb.Mdb
All Implemented Interfaces:
Serializable

public class Mdb extends org.yamcs.xtce.XtceDb
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

    Constructors
    Constructor
    Description
    Mdb(org.yamcs.xtce.SpaceSystem spaceSystem, Map<String,SpaceSystemWriter> susbsystemWriters)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addParameter(org.yamcs.xtce.Parameter p, boolean addSpaceSystem, boolean addParameterType)
     
    void
    addParameters(List<org.yamcs.xtce.Parameter> parameters, boolean createSpaceSystems, boolean createParameterTypes)
    Adds parameters to the MDB after which it persist the corresponding subtree to the file
    void
    addParameterType(org.yamcs.xtce.ParameterType ptype, boolean createSpaceSystem)
     
    void
    addParameterTypes(List<org.yamcs.xtce.ParameterType> ptypeList, boolean createSpaceSystem)
     
    org.yamcs.xtce.ParameterType
    addSystemParameterType(org.yamcs.xtce.ParameterType ptype)
    Adds a parameter type to the MDB.
    org.yamcs.xtce.SystemParameter
    createSystemParameter(String parameterQualifiedNamed, org.yamcs.xtce.ParameterType ptype, String shortDescription)
    Creates and returns a system parameter with the given qualified name.
    org.yamcs.xtce.ArgumentType
    getOrCreateBasicArgumentType(String namespace, org.yamcs.protobuf.Yamcs.Value.Type type, org.yamcs.xtce.UnitType unit)
    Creates if it does not exist and returns a basic argument type corresponding to the value.
    org.yamcs.xtce.ParameterType
    getOrCreateBasicParameterType(String namespace, org.yamcs.protobuf.Yamcs.Value.Type type, org.yamcs.xtce.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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • addParameter

      public void addParameter(org.yamcs.xtce.Parameter p, boolean addSpaceSystem, boolean addParameterType) throws IOException
      Throws:
      IOException
    • addParameters

      public void addParameters(List<org.yamcs.xtce.Parameter> parameters, boolean createSpaceSystems, boolean createParameterTypes) throws IOException
      Adds parameters to the MDB after which it persist the corresponding subtree to the file

      If any of spacesystems of the parameters are not writable, an IllegalArgumentException will be thrown and no parameter will be added

      Throws:
      IOException
    • addParameterType

      public void addParameterType(org.yamcs.xtce.ParameterType ptype, boolean createSpaceSystem) throws IOException
      Throws:
      IOException
    • addParameterTypes

      public void addParameterTypes(List<org.yamcs.xtce.ParameterType> ptypeList, boolean createSpaceSystem) throws IOException
      Throws:
      IOException
    • createSystemParameter

      public org.yamcs.xtce.SystemParameter createSystemParameter(String parameterQualifiedNamed, org.yamcs.xtce.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 with XtceDb.YAMCS_SPACESYSTEM_NAME
      ptype -
      Returns:
      the parameter created or already existing.
      Throws:
      IllegalArgumentException - if the parameterQualifiedNamed does not start with XtceDb.YAMCS_SPACESYSTEM_NAME
    • addSystemParameterType

      public org.yamcs.xtce.ParameterType addSystemParameterType(org.yamcs.xtce.ParameterType ptype)
      Adds a parameter type to the MDB. The type has to have the qualified name set and start with XtceDb.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 org.yamcs.xtce.ParameterType getOrCreateBasicParameterType(String namespace, org.yamcs.protobuf.Yamcs.Value.Type type, org.yamcs.xtce.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 org.yamcs.xtce.ArgumentType getOrCreateBasicArgumentType(String namespace, org.yamcs.protobuf.Yamcs.Value.Type type, org.yamcs.xtce.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