Class XTCESpaceSystem

  • All Implemented Interfaces:
    Comparable

    public class XTCESpaceSystem
    extends XTCENamedObject
    The XTCESpaceSystem class represents the SpaceSystems elements in the XTCE data model and provides convenient accessors that abstract some of the XTCE processing rules from the application developer.
    Author:
    David Overeem
    • Method Detail

      • getReference

        public final SpaceSystemType getReference()
        Retrieve a reference to the JAXB object that represents this SpaceSystem element in the XTCE data model.
        Returns:
        SpaceSystemType object for this Space System.
      • getWarningsFromLastOperation

        public final List<String> getWarningsFromLastOperation()
        Retrieve the warnings created from the last operation invoked.
        Returns:
        List of Strings containing the warnings.
      • getShortDescription

        public final String getShortDescription()
        Retrieve the short description attribute of this Space System.
        Returns:
        String containing the short description or an empty string. This accessor, unlike the underlying JAXB reference, can never be null.
      • setShortDescription

        public final void setShortDescription​(String text)
        Sets the short description attribute of this Space System. Changing the short description of the Space System should be done using this setter instead of the underlying JAXB object so that the null can be handled automatically and the changed flag can be set for user applications to know whether the underlying model has changed. This is used for later saving the changes.
        Parameters:
        text - String containing the short description text, which can be empty or null, in which case it nulls the underlying short description attribute of the JAXB object.
      • getLongDescription

        public final String getLongDescription()
        Retrieve the long description element content of this Space System.
        Returns:
        String containing the long description or an empty string. This value, unlike the underlying JAXB reference, can never be null.
      • setLongDescription

        public final void setLongDescription​(String text)
        Sets the long description attribute of this Space System. Changing the long description of the Space System should be done using this setter instead of the underlying JAXB object so that the null can be handled automatically and the changed flag can be set for user applications to know whether the underlying model has changed. This is used for later saving the changes.
        Parameters:
        text - String containing the long description text, which can be empty or null, in which case it nulls the underlying long description element of the JAXB object.
      • getOperationalStatus

        public final String getOperationalStatus()
        Retrieve the operationalStatus attribute from the SpaceSystem element attributes list.
        Returns:
        String containing the attribute text or an empty string. The value will never be null.
      • setOperationalStatus

        public final void setOperationalStatus​(String text)
        Sets the operationalStatus attribute on the SpaceSystem element or removes it if the content is empty.
        Parameters:
        text - String containing the operational status or empty in which case the attribute will be removed for brevity on the XML document.
      • getMetrics

        public final XTCESpaceSystemMetrics getMetrics()
        Retrieve the metrics for the Space System represented by this object. The metrics returned are shallow to this Space System in the XTCE data model. Metrics for an entire XTCE document can be obtained using the getMetrics() method on the XTCEDatabase class.
        Returns:
        XTCESpaceSystemMetrics object containing a variety of counts.
      • setHeaderAttributes

        public void setHeaderAttributes​(String version,
                                        String date,
                                        String classification,
                                        String instructions,
                                        String validation)
        Sets the basic Header element attributes for this Space System element. Attributes on the Header element are generally associated with the document itself when it is a Space System root element. Otherwise they are associated with the child subsystem that the Space System element represents. Arguments passed to this functions may be null or empty strings, in which case the function will remove an existing attribute and if all of them are empty, then it will clear the Header element from the Space System. Attributes which are optional may be passed null or an empty string. When this state exists, this function will remove the attribute from the document instead of leaving an empty value. This aids in document compression. If a default value exists, the value will be checked against the passed value and if they match, the attribute will also be removed as the default will be retrieved by the getter in the event that the attribute is not present.
        Parameters:
        version - String containing the document or Space System element version. XTCE models this field as a plain string, so no special restrictions exist.
        date - String containing the date to associate with the document or Space System element. XTCE models this field as a plain string, so any date format is accepted.
        classification - String containing a classification description. The XTCE data model supplies a default of "NotClassified" here if the user provides no value.
        instructions - String containing a description of the classification instructions.
        validation - String containing the validation status, which is a mandatory attribute if the Header element does exist. If not supplied here, the value "Unknown" will be set, but only if the Header element needs to exist.
      • isTelemetryParameter

        public boolean isTelemetryParameter​(String name)
        Check whether or not a named TM Parameter exists in this Space System. This method first checks a hash table of parameter names in the Space System for high speed access. This hash table is "lazy loaded", so the very first request to any of the parameter checks/gets on this Space System will be slower than subsequent calls to the same functions.
        Parameters:
        name - String containing the Parameter element name attribute.
        Returns:
        boolean indicating if a Parameter by the requested name is contained in this Space System.
        See Also:
        getTelemetryParameter(java.lang.String), getParameters()
      • isTelecommandParameter

        public boolean isTelecommandParameter​(String name)
        Check whether or not a named TC Parameter exists in this Space System. This method first checks a hash table of parameter names in the Space System for high speed access. This hash table is "lazy loaded", so the very first request to any of the parameter checks/gets on this Space System will be slower than subsequent calls to the same functions.
        Parameters:
        name - String containing the Parameter element name attribute.
        Returns:
        boolean indicating if a Parameter by the requested name is contained in this Space System.
        See Also:
        getTelecommandParameter(java.lang.String), getParameters()
      • getTelemetryParameter

        public XTCEParameter getTelemetryParameter​(String name)
                                            throws XTCEDatabaseException
        Retrieves a named TM Parameter from this Space System. This method first checks a hash table of parameter names in the Space System for high speed access. This hash table is "lazy loaded", so the very first request to any of the parameter checks/gets on this Space System will be slower than subsequent calls to the same functions.
        Parameters:
        name - String containing the Parameter element name attribute.
        Returns:
        XTCEParameter object that contains the toolkit model for the TM Parameter and related elements in the XTCE data model.
        Throws:
        XTCEDatabaseException - when the TM Parameter does not exist in this Space System. The exception can be avoided by using the method isTelemetryParameter() when the presence is in question.
        See Also:
        isTelemetryParameter(java.lang.String), getParameters()
      • getTelecommandParameter

        public XTCEParameter getTelecommandParameter​(String name)
                                              throws XTCEDatabaseException
        Retrieves a named TC Parameter from this Space System. This method first checks a hash table of parameter names in the Space System for high speed access. This hash table is "lazy loaded", so the very first request to any of the parameter checks/gets on this Space System will be slower than subsequent calls to the same functions.
        Parameters:
        name - String containing the Parameter element name attribute.
        Returns:
        XTCEParameter object that contains the toolkit model for the TC Parameter and related elements in the XTCE data model.
        Throws:
        XTCEDatabaseException - when the TC Parameter does not exist in this Space System. The exception can be avoided by using the method isTelecommandParameter() when the presence is in question.
        See Also:
        isTelecommandParameter(java.lang.String), getParameters()
      • getTelemetryParameters

        public List<XTCEParameter> getTelemetryParameters()
        Retrieves a List of all TM Parameters modeled by this Space System object. This method does not use the hash lookup because it is a linear grab of all the Parameters in order. Aggregate Parameters have Members modeled using C style notation, so XTCEParameter objects will be returned for Aggregate Members where their name is in the form A.B, where A is the Parameter Aggregate and B is the name attribute of the Aggregate Member element. This makes it very easy for the caller to iterate through the resulting List without needing to resolve the internal relationships of the XTCE data model.
        Returns:
        List of XTCEParameter objects or an empty list if there are no Parameters modeled within this particular Space System.
      • getTelecommandParameters

        public List<XTCEParameter> getTelecommandParameters()
        Retrieves a List of all TC Parameters modeled by this Space System object. This method does not use the hash lookup because it is a linear grab of all the Parameters in order. Aggregate Parameters have Members modeled using C style notation, so XTCEParameter objects will be returned for Aggregate Members where their name is in the form A.B, where A is the Parameter Aggregate and B is the name attribute of the Aggregate Member element. This makes it very easy for the caller to iterate through the resulting List without needing to resolve the internal relationships of the XTCE data model.
        Returns:
        List of XTCEParameter objects or an empty list if there are no Parameters modeled within this particular Space System.
      • getParameters

        public List<XTCEParameter> getParameters()
        Retrieves a List of all Parameters modeled by this Space System object. This method does not use the hash lookup because it is a linear grab of all the Parameters in order. Aggregate Parameters have Members modeled using C style notation, so XTCEParameter objects will be returned for Aggregate Members where their name is in the form A.B, where A is the Parameter Aggregate and B is the name attribute of the Aggregate Member element. This makes it very easy for the caller to iterate through the resulting List without needing to resolve the internal relationships of the XTCE data model.
        Returns:
        List of XTCEParameter objects or an empty list if there are no Parameters modeled within this particular Space System.
      • getContainer

        public XTCETMContainer getContainer​(String nameOrPath)
                                     throws XTCEDatabaseException
        Retrieve a named SequenceContainer as a toolkit modeled XTCETMContainer object from this Space System object.
        Parameters:
        nameOrPath - String containing the local name or a path to the name. The path will be ignored as this method is intended to only find in the local Space System element.
        Returns:
        XTCETMContainer object representing the named SequenceContainer element.
        Throws:
        XTCEDatabaseException - in the event that the named SequenceContainer does not exist in this Space System element.
      • getContainers

        public List<XTCETMContainer> getContainers​(String nameGlob)
        Retrieve a List of SequenceContainers that match a user provided string glob, modeled as XTCETMContainer objects.
        Parameters:
        nameGlob - String containing a glob style matching pattern to match against the container names.
        Returns:
        List of XTCETMContainer objects representing the containers that match the provided glob or an empty list if there are no matches.
      • getInheritingContainers

        public List<XTCETMContainer> getInheritingContainers​(String parentPath)
        Retrieve all containers that inherit from the container inheritance path provided. Note to the implementer to be sure that it is understood that a container inheritance path is not the same as the Space System path used by XTCE documents. This is a path that is defined by the base containers in a container inheritance structure.
        Parameters:
        parentPath - String containing a base inheritance to search for children of.
        Returns:
        List of XTCETMContainer objects in this SpaceSystem that inherit from the parent path provided.
      • getContainers

        public List<XTCETMContainer> getContainers()
        Retrieve a List of SequenceContainers that are locally defined in this Space System, modeled as XTCETMContainer objects.
        Returns:
        List of XTCETMContainer objects representing the containers that are modeled by this Space System or an empty list if the Space System does not locally define any SequenceContainer elements.
      • getStreams

        public List<XTCETMStream> getStreams()
        Retrieve a List of Streams that are locally defined in this Space System, modeled as XTCETMStream objects. Note that Custom Stream elements are not yet supported and will not be included in the final list.
        Returns:
        List of XTCETMStream objects representing the streams that are modeled by this Space System or an empty list if the Space System does not locally define any elements in a StreamSet.
      • getTelecommand

        public XTCETelecommand getTelecommand​(String nameOrPath)
                                       throws XTCEDatabaseException
        Retrieves a named Telecommand from this Space System as an XTCETelecommand object. At present, the element must be a MetaCommand or a BlockMetaCommand. The MetaCommandRef element is not supported in the MetaCommandSet element and this class behaves as if it does not exist, so requests for the name will result in the name being reported as not being found in the subsequent exception described for this method.
        Parameters:
        nameOrPath - String containing the MetaCommand or BlockMetaCommand name attribute from the XTCE data model. Similar to the getContainer() method, this accepts a sloppy name or path. It ignores the path and extracts only the name for searching in the local Space System.
        Returns:
        XTCETelecommand object that contains the toolkit model for the MetaCommand or BlockMetaCommand and related elements in the XTCE data model.
        Throws:
        XTCEDatabaseException - when the Telecommand does not exist in this Space System.
        See Also:
        getTelecommands()
      • getTelecommands

        public List<XTCETelecommand> getTelecommands()
        Retrieve a List of MetaCommand or BlockMetaCommand elements that are locally defined in this Space System, modeled as XTCETelecommand objects. TODO: Figure out the rest of the error handling model for this.
        Returns:
        List of XTCETelecommand objects representing the commands that are modeled by this Space System or an empty list if the Space System does not locally define any MetaCommand or BlockMetaCommand elements.
      • getTelecommands

        public List<XTCETelecommand> getTelecommands​(String nameGlob)
        Retrieve a List of Telecommands that match a user provided string glob, modeled as XTCETelecommand objects.
        Parameters:
        nameGlob - String containing a glob style matching pattern to match against the container names.
        Returns:
        List of XTCETelecommand objects representing the telecommands that match the provided glob or an empty list if there are no matches.
      • getTMParameterTypeReference

        public NameDescriptionType getTMParameterTypeReference​(String typeName)
        Retrieve a Parameter Type Element from this SpaceSystem element if it exists. This function should generally not be needed. If it is necessary to use this function, then there is probably a missing abstraction in this API that needs to be added to be more complete an implementation for your use case.
        Parameters:
        typeName - String name of the type element to find.
        Returns:
        NameDescriptionType base class of the XTCE data model elements or a null pointer if it is not found.
      • getTCParameterTypeReference

        public NameDescriptionType getTCParameterTypeReference​(String typeName)
        Retrieve a Parameter Type Element from this SpaceSystem element if it exists. This function should generally not be needed. If it is necessary to use this function, then there is probably a missing abstraction in this API that needs to be added to be more complete an implementation for your use case.
        Parameters:
        typeName - String name of the type element to find.
        Returns:
        NameDescriptionType base class of the XTCE data model elements or a null pointer if it is not found.
      • getArgumentTypeReference

        public NameDescriptionType getArgumentTypeReference​(String typeName)
        Retrieve an Argument Type Element from this SpaceSystem element if it exists. This function should generally not be needed. If it is necessary to use this function, then there is probably a missing abstraction in this API that needs to be added to be more complete an implementation for your use case.
        Parameters:
        typeName - String name of the type element to find.
        Returns:
        NameDescriptionType base class of the XTCE data model elements or a null pointer if it is not found.