Class XtceDb

  • All Implemented Interfaces:
    Serializable

    public class XtceDb
    extends Object
    implements Serializable
    XtceDB database It contains a SpaceSystem as defined in the Xtce schema and has lots of hashes to help find things quickly
    See Also:
    Serialized Form
    • Constructor Detail

    • Method Detail

      • setRootSequenceContainer

        public void setRootSequenceContainer​(SequenceContainer sc)
      • containsNamespace

        public boolean containsNamespace​(String namespace)
      • getNamespaces

        public Set<String> getNamespaces()
      • getMetaCommand

        public MetaCommand getMetaCommand​(String qualifiedName)
        Returns a meta command by fully qualified name.
        Parameters:
        qualifiedName - - fully qualified name of the command to be returned.
        Returns:
        the meta command having the given qualified name. If no such command exists, null is returned.
      • getMetaCommand

        public MetaCommand getMetaCommand​(String namespace,
                                          String name)
        Returns a command based on a name in a namespace
        Parameters:
        namespace -
        name -
        Returns:
        the meta command having the given name in the given namespace. If no such meta command exists, null is returned.
      • getMetaCommands

        public Collection<MetaCommand> getMetaCommands()
        Returns the list of MetaCommmands in the XTCE database
        Returns:
      • getRootSpaceSystem

        public SpaceSystem getRootSpaceSystem()
      • getParameterEntries

        public List<ParameterEntry> getParameterEntries​(Parameter p)
        Returns:
        list of ParameterEntry corresponding to a given parameter or null if no such entry exists.
      • getContainerEntries

        public List<ContainerEntry> getContainerEntries​(SequenceContainer sc)
        Returns:
        list of ContainerEntry corresponding to a given sequence container or null if no such entry exists.
      • getNonStandardDataOfType

        public <T extends NonStandardData<T>> T getNonStandardDataOfType​(Class<T> clazz)
      • buildIndexMaps

        public void buildIndexMaps()
        Called after the database has been populated to build the maps for quickly finding things
      • addParameter

        public void addParameter​(Parameter p,
                                 boolean createSpaceSystem)
        Adds a new parameter to the XTCE db. If the SpaceSystem where this parameter belongs does not exist, and createSpaceSystem is false, throws an IllegalArgumentException If the SpaceSystem where this parameter belongs exists and already contains an parameter by this name, throws and IllegalArgumentException If the SpaceSystem where this parameter belongs does not exist, and createSpaceSystem is true, the whole SpaceSystem hierarchy is created. Note that this method is used to create parameters on the fly. The parameters are not saved anywhere and they will not be available when this object is created by the XtceDbFactory.
        Parameters:
        p -
        createSpaceSystem - - if true, create all the necessary space systems
      • createSystemParameter

        public SystemParameter createSystemParameter​(String parameterQualifiedNamed)
        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 YAMCS_SPACESYSTEM_NAME
        Returns:
        the parameter created or already existing.
        Throws:
        IllegalArgumentException - if the parameterQualifiedNamed does not start with YAMCS_SPACESYSTEM_NAME
      • addMetaCommand

        public void addMetaCommand​(MetaCommand c)
        Adds a new command definition to the XTCE db.

        Note that this method is used to create commands on the fly.
        The commands are not saved anywhere and they will not be available when this object is created with the XtceDbFactory.

      • addSpaceSystem

        public void addSpaceSystem​(SpaceSystem system)
        Adds a new SpaceSystem to the XTCE database. It throws an IllegalArgumentException in the following circumstances: This method also sets the parent of the passed spacesystem to its parent object. Note that this method is used to create SpaceSystems on the fly. The SpaceSystems are not saved anywhere and they will not be available when this object is created by the XtceDbFactory.
        Parameters:
        system - - the space system to be added.
      • isSystemParameter

        public static boolean isSystemParameter​(Yamcs.NamedObjectId id)
        Checks if the named object refers to a system parameter:
        Parameters:
        id -
        Returns:
      • isSystemParameter

        public static boolean isSystemParameter​(String fqn)
        Checks if a fully qualified name is the name of a system parameter. That is if fqn starts with YAMCS_SPACESYSTEM_NAME
        Parameters:
        fqn -
        Returns:
      • getSpaceSystems

        public Collection<SpaceSystem> getSpaceSystems()
        Returns a collection of all the SpaceSystem objects in the XTCE database.
        Returns:
        the collection of space systems.
      • getIndirectParameterRefEntries

        public Collection<IndirectParameterRefEntry> getIndirectParameterRefEntries​(String namespace)
        Retrieve the list of IndirectParameterRefEntry for a given alias namespace.
        Parameters:
        namespace - - the namespace for which the indirect parameter reference entries should be retrieved. Can be null to return the entries without a namespace.
        Returns:
        the list of indirect parameter reference entries whose alias namespace is equal to the given namespace. If no such entry exists, null is returned.