C.7 PubSub (Analog of Eventing)
C.7.1 Creating the UCCD PubSub structure
A UCCD with evented state variables, before creating a PubSub collection for events, shall first identify the PubSub service availability by sending an <iq> stanza request to its UCS as described in the following template. The UCCD should verify that the PubSub supports the UPnP configuration by verifying the inclusion of the "ownerUPnP" affiliation in the access model options returned in an initial pubsub/protocol/#owner response.
<iq
id="vendor defined value"
from="localpart@domainpart/resourcepart of UCCD conforming to section C.5.4"
to="PubSubName of UCS supporting UCA (see footnote in section C.6.6.3)" type="get"
<query xmlns="http://jabber.org/protocol/disco#info"/> </iq>
@to
Required. Shall be implemented according to [RFC-6120]. Shall have a value of the
name of the PubSub service supporting UCA ("PubSubName") as determined by
previous disco#items and disco#info queries. Case sensitive.
@type
Required. Shall be implemented according to [RFC-6120]. Shall have a value of "get".
<query>
Required. Shall have “http://jabber.org/protocol/disco#info” as the
value for the xmlns attribute (see schema in [XEP-0030]). Case sensitive.
A UCS shall respond to the above <iq> stanza request with the included xml <query> child element indicating support for the PubSub service conforming to [XEP-0060], that is it includes
<identity category="pubsub" type="service"/>
<feature var="http://jabber.org/protocol/pubsub"/> <feature var="http://upnp.org/protocol/cloud/1.0"/>
The UCCD MediaServer:4 verifies the PubSub infrastructure is supported. UCCD:[email protected]/urn:schemas-upnp- org:device:MediaServer:4:uuid:e70e9d0e-d9eb-4748-b163-636a323e7950 <iq id="check-for-pubsub" to="pubsub.mycloud.org" type="get"> <query xmlns="http://jabber.org/protocol/disco#info"/> </iq>
P-USC:pubsub.mycloud.org (PubSub service affiliated with UCS
mycloud.org) <iq id="check-for-pubsub" to="[email protected]/urn:schemas-upnp-org:device: MediaServer:4:uuid:e70e9d0e-d9eb-4748-b163-636a323e7950" type="result"> <query xmlns="http://jabber.org/protocol/disco#info"/> . . .
<identity category="pubsub" type="service"/>
<feature var="http://jabber.org/protocol/pubsub"/> <feature var="http://upnp.org/protocol/cloud/1.0"/> . . .
</query> </iq>
C.7.1.1 Verifying an existing UCCD PubSub Hierarchy
Upon confirmation of the PubSub service existence that supports UCA, as indicated above, a UCCD with evented state variables shall confirm there is an existing, current PubSub collection hierarchy for the specific UCCD by sending an <iq> stanza as described in the following template.
<iq
id="vendor defined value"
from="localpart@domainpart/resourcepart of UCCD conforming to section C.5.4"
to="PubSubName of UCS supporting UCA (see footnote in section C.6.6.3)" type="get"
<query xmlns="http://jabber.org/protocol/disco#info" node="resourcepart"/>
</iq>
<iq>, iq@id, iq@from, iq@to. Required. See equivalent in previous template for <iq>
attributes. @type
Required. Shall be implemented according to [RFC-6120]. Shall have a value of
"get". <query>
Required. Shall have “http/::jabber.org/protocol/disco#info” as the
value for the xmlns attribute (see schema in [XEP-0060] section 5.3 Discover Node
Information). Case sensitive. @node
Required. Type is xsd:string. Shall have a value the same as resourcepart of
the requesting UCCD.
A UCCD shall inspect the UCS response <iq> stanza for the inclusion of a <query:identity> sub-element associated with the resourcepart described above where the @catergory attribute shall have a value of "pubsub" and the @node attribute shall have a value of "collection". If the described matches are confirmed, the UCCD shall next confirm the current configuration (configIDCloud leaf node), otherwise, it shall create a collection node hierarchy as described in section C.7.1.
Upon confirmation of the existing UCCD level collection node, a UCCD shall confirm that the configured PubSub device collection node hierarchy configIdCloud item value matches the current UCCD configIdCloud element value by sending an <iq> stanza as described in the following template.
<iq
id="vendor defined value"
from="localpart@domainpart/resourcepart of UCCD conforming to section C.5.4"
to="PubSubName of UCS supporting UCA (see footnote in section C.6.6.3)" type="get">
<pubsub xmlns="http://jabber.org/protocol/pubsub">
<items node="value of UCCD PubSub configIdCloud node"/> </iq>
<iq>, iq@id, iq@from, iq@to. Required. See equivalent in previous template for <iq> attributes.
@type
Required. Shall be implemented according to [RFC-6120]. Shall have a value of "get".
<pubsub>
Required. Shall be implemented according to [XEP-0030].
Shall have “http://jabber.org/protocol/pubsub” as the value for the xmlns
attribute. Case sensitive. <items>
Required. Shall contain an <items> element with an @node attribute
whose value is the expected, configured UCCD level collection node.
Case sensitive.
The returned item(s) list should contain the configIdCloud leaf node and a collection node for each service identified in the UCCD DDD.