<?xml version="1.0" encoding="UTF-8"?>
<!--
  Device:2 Root Data Model: Common Object definitions [USPService]

  Copyright (c) 2021-2023, Broadband Forum

  Redistribution and use in source and binary forms, with or
  without modification, are permitted provided that the following
  conditions are met:

  1. Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above
     copyright notice, this list of conditions and the following
     disclaimer in the documentation and/or other materials
     provided with the distribution.

  3. Neither the name of the copyright holder nor the names of its
     contributors may be used to endorse or promote products
     derived from this software without specific prior written
     permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

  The above license is used as a license under copyright only.
  Please reference the Forum IPR Policy for patent licensing terms
  <https://www.broadband-forum.org/ipr-policy>.

  Any moral rights which are necessary to exercise under the above
  license grant are also deemed granted under this license.

  Comments or questions about this Broadband Forum data model should be
  directed to <info@broadband-forum.org>.
-->

<dm:document
    xmlns:dm="urn:broadband-forum-org:cwmp:datamodel-1-10"
    xmlns:dmr="urn:broadband-forum-org:cwmp:datamodel-report-1-0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
      urn:broadband-forum-org:cwmp:datamodel-1-10
        https://www.broadband-forum.org/cwmp/cwmp-datamodel-1-10.xsd
      urn:broadband-forum-org:cwmp:datamodel-report-1-0
        https://www.broadband-forum.org/cwmp/cwmp-datamodel-report-1-0.xsd"
    spec="urn:broadband-forum-org:tr-181-2-21-0-uspservices"
    file="tr-181-2-21-0-uspservices.xml">

  <import file="tr-069-biblio.xml" spec="urn:broadband-forum-org:tr-069"/>


  <import file="tr-181-2-root.xml"
      spec="urn:broadband-forum-org:tr-181-2-21-root">
    <component name="Root"/>
  </import>

  <component name="USPServices">
    <object name="Device.USPServices." access="readOnly" minEntries="1"
        maxEntries="1" version="2.16">
      <description>
        This object contains information related to installed USP Services.
      </description>

      <parameter name="TrustNumberOfEntries" access="readOnly" version="2.19">
        <description>
          {{numentries}}
        </description>
        <syntax>
          <unsignedInt/>
        </syntax>
      </parameter>

      <parameter name="USPServiceNumberOfEntries" access="readOnly">
        <description>
          {{numentries}}
        </description>
        <syntax>
          <unsignedInt/>
        </syntax>
      </parameter>
    </object>

    <object name="Device.USPServices.Trust.{i}." access="readWrite"
        numEntriesParameter="TrustNumberOfEntries" minEntries="0"
        maxEntries="unbounded" version="2.19">
      <description>
        This object contains permissions associated with the set of data model paths that a USP Agent within a USP Service is allowed to Register.
        If a USP Service's USP Agent is not present in this table then there are no permissions associated for that USP Service and it is not allowed to register any data model paths.
      </description>
      <uniqueKey functional="false">
        <parameter ref="EndpointID"/>
      </uniqueKey>

      <parameter name="EndpointID" access="readWrite">
        <description>
          The unique USP identifier for the USP Agent associated with these permissions.
        </description>
        <syntax>
          <string/>
        </syntax>
      </parameter>

      <parameter name="TargetPaths" access="readWrite">
        <description>
          Each entry in the list is an Object Path, Command Path, Event Path, or Parameter Path that determines the 
          element(s) of the data model that the USP Service has permission to register.
          {{empty}} indicates that the USP Agent has no permissions.
        </description>
        <syntax>
          <list maxItems="1024"/>
          <string/>
        </syntax>
      </parameter>
    </object>

    <object name="Device.USPServices.USPService.{i}." access="readOnly"
        numEntriesParameter="USPServiceNumberOfEntries" minEntries="0"
        maxEntries="unbounded" version="2.16">
      <description>
        This object contains parameters relating to a USPService configuration.
      </description>
      <uniqueKey functional="true">
        <parameter ref="EndpointID"/>
      </uniqueKey>

      <parameter name="EndpointID" access="readOnly">
        <description>
          The unique USP identifier for this USP Agent.
        </description>
        <syntax>
          <string/>
        </syntax>
      </parameter>

      <parameter name="Protocol" access="readOnly">
        <description>
          The Message Transfer Protocol (MTP) to be used for communications by
          a USP Endpoint.
          Note: This parameter was demoted to readOnly in the Device:2.17 version.
        </description>
        <syntax>
          <string>
            <enumeration value="WebSocket">
              <description>See {{bibref|RFC6455}}</description>
            </enumeration>
            <enumeration value="STOMP">
              <description>See {{bibref|STOMP1.2}}</description>
            </enumeration>
            <enumeration value="MQTT">
              <description>
                See {{bibref|MQTT311}} and {{bibref|MQTT50}}
              </description>
            </enumeration>
            <enumeration value="UDS">
              <description>See {{bibref|TR-369}}</description>
            </enumeration>
          </string>
        </syntax>
      </parameter>

      <parameter name="DataModelPaths" access="readOnly">
        <description>
          Registered data model paths.
        </description>
        <syntax>
          <list minItems="1" maxItems="1024"/>
          <string/>
        </syntax>
      </parameter>

      <parameter name="DeploymentUnitRef" access="readOnly">
        <description>
          {{reference|the {{object|##.SoftwareModules.DeploymentUnit.}} object
          instance that this USP Service is part of.}}

          {{empty}} means that USP service doesn't have a corresponding
          software module.
        </description>
        <syntax>
          <list/>
          <string>
            <pathRef refType="strong"
                targetParent="##.SoftwareModules.DeploymentUnit."
                targetType="row"/>
          </string>
        </syntax>
      </parameter>

      <parameter name="ExecutionUnitRef" access="readOnly" version="2.18">
        <description>
          {{reference|the {{object|##.SoftwareModules.ExecutionUnit.}} object
          instance that this USP Service is part of.}}

          {{empty}} means that USP service doesn't have a corresponding
          software module.
        </description>
        <syntax>
          <list/>
          <string>
            <pathRef refType="strong"
                targetParent="##.SoftwareModules.ExecutionUnit."
                targetType="row"/>
          </string>
        </syntax>
      </parameter>

      <parameter name="HasController" access="readOnly">
        <description>
          The USP service has controller functionality next to the standard USP
          Agent functionality.
        </description>
        <syntax>
          <boolean/>
        </syntax>
      </parameter>
    </object>
  </component>

  <model name="USPService:2.21">
    <component ref="Root"/>
    <component ref="USPServices"/>
  </model>
</dm:document>
