Command.xid.xml 5.01 KB
<?xml version="1.0" encoding="UTF-8" ?>

<!--
  Copyright (c) 2017, TeleCommunication Systems, Inc.,
  a wholly-owned subsidiary of Comtech Telecommunications Corp.
  and/or affiliates of TeleCommunication Systems, Inc.
  All rights reserved.
  TeleCommunication Systems, Inc. PROPRIETARY/CONFIDENTIAL.
  Use is subject to license terms included in the distribution.
-->

<specification xmlns="https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd"
               xmlns:xid="https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd XtensibleInterfaceDefinition.xsd"
               identity="Command.xid.xml">
    <title>Tensor Command</title>
    <comment></comment>
    <artifact></artifact>

    <import ref="https://xid.location.studio/Tensor/V1.0.0/Common.xid.xml" local="Common.xid.xml" />

    <namespace name="Tensor">
      
      <!--
      ************************************
      * Command API Implementation
      ************************************
      -->
      <struct name="Command">
        <comment>A TPF command structure compatible with the TPF Framework Commander Component.</comment>
        <elem name="name" type="Tensor.string" multiplicity="1" ord="64">
          <comment>The command name including scope specifiers.  Convention is to use a '.' as a scope separator
          such as[component name].[command name].</comment>
        </elem>

        <elem name="etid" type="Tensor.string" multiplicity="0..1" ord="65">
          <comment>
            Optional external transaction identifier for the caller to uniquely identify and track
            the command and corresponding results.
          </comment>
        </elem>

        <elem name="argument" type="NameValue" multiplicity="0..*" ord="66">
          <comment>
            Each command may have zero or more arguments.  
            They may be name/value or oridinal/value arguments. 
            Both name and value are required.
          </comment>
        </elem>
      </struct>

      <struct name="CommandResponse">
        <comment>
          The command response structure containing information resulting from executing the 
          command (success or failure).   Check the result code for details on status of executing the 
          command a value of 1 means success, value of 0 is undefined, See ResultCode for other standard
          result codes.  Each operation may define additional codes.
        </comment>
        <elem name="name" type="Tensor.string" multiplicity="1" ord="64">
          <comment>
            The command name including scope specifiers.  Convention is to use a '.' as a scope separator
            such as[component name].[command name].
          </comment>
        </elem>

        <elem name="etid" type="Tensor.string" multiplicity="0..1" ord="65">
          <comment>
            Optional external transaction identifier for the caller to uniquely identify and track
            the command and corresponding results.
          </comment>
        </elem>

        <elem name="result" type="Tensor.int8" multiplicity="1" ord="66">
          <comment>The processing result code. 1 is success, 0 is undefined, -1 is a failure.</comment>
        </elem>

        <elem name="output" type="Tensor.string" multiplicity="0..1" ord="67">
          <comment>
            Optional command output stored as a string.  Interpeting the output data is dependent upon the
            command function executed and what data formats are as an encodded string.
          </comment>
        </elem>
      </struct>

      <interface name="CommandApi">
        <comment>Interface executing commands inside TPF Containers.</comment>

        <operation name="Execute">
          <comment>
            Executes the specified command elements. Can specify whether to return responses (default true) or not using wantresponses.
          </comment>
          <input name="input" sid="0x0100">
            <elem name="commands" multiplicity="1..*" type="Command" ord="64"/>
            <elem name="wantresponses" multiplicity="1" type="Tensor.bool"  ord="65" default="true"/>
          </input>
          <output name="output" sid="0x0101">
            <elem name="lastcommand" type="Tensor.int8" multiplicity="1" ord="64">
              <comment>The index of the last command executed. If this is less than the total number of commands a failure occurred.</comment>
            </elem>
            <elem name="lastresult" type="Tensor.int8" multiplicity="1" ord="65">
              <comment>The last processing result code. 1 is success, 0 is undefined, -1 is a failure.</comment>
            </elem>
            <elem name="responses" type="CommandResponse" multiplicity="1..*" ord="66">
              <comment>A command response for each command executed.</comment>
            </elem>
          </output>
        </operation>
      </interface>
    </namespace>
</specification>