From 03c3d73aa9819255785b915888f3d1c3f6b106fd Mon Sep 17 00:00:00 2001
From: PeterNiblett <pdn3270@gmail.com>
Date: Wed, 7 Jan 2015 13:14:46 +0000
Subject: [PATCH] StatsCollect/Config, EventConfig and ServiceSubscribedNode

---
 CDT-commonTypes-v0_8_0.xsd           |  9 ++++
 CDT-eventConfig-v0_8_0.xsd           | 61 ++++++++++++++++++++++++++++
 CDT-serviceSubscribedNode-v0_8_0.xsd | 58 ++++++++++++++++++++++++++
 CDT-statsCollect-v0_8_0.xsd          | 58 ++++++++++++++++++++++++++
 CDT-statsConfig-v0_8_0.xsd           | 56 +++++++++++++++++++++++++
 5 files changed, 242 insertions(+)
 create mode 100644 CDT-eventConfig-v0_8_0.xsd
 create mode 100644 CDT-serviceSubscribedNode-v0_8_0.xsd
 create mode 100644 CDT-statsCollect-v0_8_0.xsd
 create mode 100644 CDT-statsConfig-v0_8_0.xsd

diff --git a/CDT-commonTypes-v0_8_0.xsd b/CDT-commonTypes-v0_8_0.xsd
index ce2d6ac..38f053e 100644
--- a/CDT-commonTypes-v0_8_0.xsd
+++ b/CDT-commonTypes-v0_8_0.xsd
@@ -56,6 +56,14 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
         </xs:restriction>
     </xs:simpleType>
 
+    <!-- TODO: should this allow lower case hex ? -->
+	<xs:simpleType name="deviceID">
+		<xs:restriction base="xs:token">
+			<xs:pattern value="urn:((dev:ops:[\dABCDEF]{6}-[\w_%]+-[\w_%]+)|(dev:os:[\dABCDEF]{6}-[\w_%]+)|(imei:\d{15})|(esn:[\dABCDEF]{8})|(meid:[\dABCDEF]{14}))"></xs:pattern>
+		</xs:restriction>
+	</xs:simpleType>
+
+
 	<xs:simpleType name="requestID">
 		<xs:restriction base="xs:token">
 		</xs:restriction>
@@ -65,6 +73,7 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
 		<xs:restriction base="xs:anyURI" />
 	</xs:simpleType>
 
+    <!-- TODO: why is it declared as a ref to a global element like this? -->
 	<xs:complexType name="acpType">
 		<xs:sequence>
 			<xs:element ref="m2m:accessControlPolicyID" minOccurs="0" maxOccurs="unbounded" />
diff --git a/CDT-eventConfig-v0_8_0.xsd b/CDT-eventConfig-v0_8_0.xsd
new file mode 100644
index 0000000..e3487af
--- /dev/null
+++ b/CDT-eventConfig-v0_8_0.xsd
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+Copyright Notification
+
+The oneM2M Partners authorize you to copy this document, provided that you retain all copyright and other proprietary notices 
+contained in the original materials on any copies of the materials and that you comply strictly with these terms. 
+This copyright permission does not constitute an endorsement of the products or services, nor does it encompass the granting of 
+any patent rights. The oneM2M Partners assume no responsibility for errors or omissions in this document. 
+© 2014, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TTA, TTC). All rights reserved.
+
+Notice of Disclaimer & Limitation of Liability 
+
+The information provided in this document is directed solely to professionals who have the appropriate degree of experience to understand 
+and interpret its contents in accordance with generally accepted engineering or other professional standards and applicable regulations. 
+No recommendation as to products or vendors is made or should be implied. 
+
+NO REPRESENTATION OR WARRANTY IS MADE THAT THE INFORMATION IS TECHNICALLY ACCURATE OR SUFFICIENT OR CONFORMS TO ANY STATUTE, 
+GOVERNMENTAL RULE OR REGULATION, AND FURTHER, NO REPRESENTATION OR WARRANTY IS MADE OF MERCHANTABILITY OR FITNESS FOR ANY 
+PARTICULAR PURPOSE OR AGAINST INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS. 
+NO oneM2M PARTNER TYPE 1 SHALL BE LIABLE, BEYOND THE AMOUNT OF ANY SUM RECEIVED IN PAYMENT BY THAT PARTNER FOR THIS DOCUMENT, WITH RESPECT TO 
+ANY CLAIM, AND IN NO EVENT SHALL oneM2M BE LIABLE FOR LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES. 
+oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PROVIDED IN THIS DOCUMENT IS AT THE RISK OF THE USER.
+
+-->
+<xs:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.onem2m.org/xml/protocols"
+	xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	elementFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+	<xs:include schemaLocation="CDT-commonTypes-v0_8_0.xsd" />
+	<xs:include schemaLocation="CDT-subscription-v0_8_0.xsd" />
+
+	<xs:element name="eventConfig">
+		<xs:complexType>
+			<xs:complexContent>
+				<!-- Inherit common attributes -->
+				<xs:extension base="m2m:regularResource">
+					<xs:sequence>
+						<!-- Resource Specific Attributes -->
+						<xs:element name="creator" type="m2m:ID" />
+						<xs:element name="eventID" type="xs:string" />
+						<xs:element name="eventType" type="m2m:eventType" />
+						<xs:element name="eventStart" type="xs:dateTime" minOccurs="0" />
+						<xs:element name="eventEnd" type="xs:dateTime" minOccurs="0" />
+						<xs:element name="operationType" minOccurs="0">
+							<xs:simpleType>
+								<xs:list itemType="m2m:operation" />
+							</xs:simpleType>
+						</xs:element>
+						<xs:element name="dataSize" type="xs:nonNegativeInteger" minOccurs="0" />
+
+						<!-- Child Resources -->
+						<xs:choice minOccurs="0" maxOccurs="1">
+							<xs:element name="childResource" type="m2m:childResourceRef" maxOccurs="unbounded" />
+							<xs:element ref="m2m:subscription" maxOccurs="unbounded" />
+						</xs:choice>
+					</xs:sequence>
+				</xs:extension>
+			</xs:complexContent>
+		</xs:complexType>
+	</xs:element>
+</xs:schema>
diff --git a/CDT-serviceSubscribedNode-v0_8_0.xsd b/CDT-serviceSubscribedNode-v0_8_0.xsd
new file mode 100644
index 0000000..2c50cc1
--- /dev/null
+++ b/CDT-serviceSubscribedNode-v0_8_0.xsd
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+Copyright Notification
+
+The oneM2M Partners authorize you to copy this document, provided that you retain all copyright and other proprietary notices 
+contained in the original materials on any copies of the materials and that you comply strictly with these terms. 
+This copyright permission does not constitute an endorsement of the products or services, nor does it encompass the granting of 
+any patent rights. The oneM2M Partners assume no responsibility for errors or omissions in this document. 
+© 2014, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TTA, TTC). All rights reserved.
+
+Notice of Disclaimer & Limitation of Liability 
+
+The information provided in this document is directed solely to professionals who have the appropriate degree of experience to understand 
+and interpret its contents in accordance with generally accepted engineering or other professional standards and applicable regulations. 
+No recommendation as to products or vendors is made or should be implied. 
+
+NO REPRESENTATION OR WARRANTY IS MADE THAT THE INFORMATION IS TECHNICALLY ACCURATE OR SUFFICIENT OR CONFORMS TO ANY STATUTE, 
+GOVERNMENTAL RULE OR REGULATION, AND FURTHER, NO REPRESENTATION OR WARRANTY IS MADE OF MERCHANTABILITY OR FITNESS FOR ANY 
+PARTICULAR PURPOSE OR AGAINST INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS. 
+NO oneM2M PARTNER TYPE 1 SHALL BE LIABLE, BEYOND THE AMOUNT OF ANY SUM RECEIVED IN PAYMENT BY THAT PARTNER FOR THIS DOCUMENT, WITH RESPECT TO 
+ANY CLAIM, AND IN NO EVENT SHALL oneM2M BE LIABLE FOR LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES. 
+oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PROVIDED IN THIS DOCUMENT IS AT THE RISK OF THE USER.
+
+-->
+<xs:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.onem2m.org/xml/protocols"
+	xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	elementFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+	<xs:include schemaLocation="CDT-commonTypes-v0_8_0.xsd" />
+	<xs:include schemaLocation="CDT-subscription-v0_8_0.xsd" />
+
+	<xs:element name="serviceSubscribedNode">
+		<xs:complexType>
+			<xs:complexContent>
+				<!-- Inherit common attributes -->
+				<xs:extension base="m2m:regularResource">
+					<xs:sequence>
+						<!-- Resource Specific Attributes -->
+						<xs:element name="nodeID" type="m2m:nodeID" />
+						<xs:element name="CSE-ID" type="m2m:ID" minOccurs="0" />
+						<xs:element name="deviceIdentifier" minOccurs="0">
+							<xs:simpleType>
+								<xs:list itemType="m2m:deviceID" />
+							</xs:simpleType>
+						</xs:element>
+                        <xs:element name="ruleLinks" type="m2m:listOfURIs" minOccurs="0" />
+
+						<!-- Child Resources -->
+						<xs:choice minOccurs="0" maxOccurs="1">
+							<xs:element name="childResource" type="m2m:childResourceRef" maxOccurs="unbounded" />
+							<xs:element ref="m2m:subscription" maxOccurs="unbounded" />
+						</xs:choice>
+					</xs:sequence>
+				</xs:extension>
+			</xs:complexContent>
+		</xs:complexType>
+	</xs:element>
+</xs:schema>
diff --git a/CDT-statsCollect-v0_8_0.xsd b/CDT-statsCollect-v0_8_0.xsd
new file mode 100644
index 0000000..6977432
--- /dev/null
+++ b/CDT-statsCollect-v0_8_0.xsd
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+Copyright Notification
+
+The oneM2M Partners authorize you to copy this document, provided that you retain all copyright and other proprietary notices 
+contained in the original materials on any copies of the materials and that you comply strictly with these terms. 
+This copyright permission does not constitute an endorsement of the products or services, nor does it encompass the granting of 
+any patent rights. The oneM2M Partners assume no responsibility for errors or omissions in this document. 
+© 2014, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TTA, TTC). All rights reserved.
+
+Notice of Disclaimer & Limitation of Liability 
+
+The information provided in this document is directed solely to professionals who have the appropriate degree of experience to understand 
+and interpret its contents in accordance with generally accepted engineering or other professional standards and applicable regulations. 
+No recommendation as to products or vendors is made or should be implied. 
+
+NO REPRESENTATION OR WARRANTY IS MADE THAT THE INFORMATION IS TECHNICALLY ACCURATE OR SUFFICIENT OR CONFORMS TO ANY STATUTE, 
+GOVERNMENTAL RULE OR REGULATION, AND FURTHER, NO REPRESENTATION OR WARRANTY IS MADE OF MERCHANTABILITY OR FITNESS FOR ANY 
+PARTICULAR PURPOSE OR AGAINST INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS. 
+NO oneM2M PARTNER TYPE 1 SHALL BE LIABLE, BEYOND THE AMOUNT OF ANY SUM RECEIVED IN PAYMENT BY THAT PARTNER FOR THIS DOCUMENT, WITH RESPECT TO 
+ANY CLAIM, AND IN NO EVENT SHALL oneM2M BE LIABLE FOR LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES. 
+oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PROVIDED IN THIS DOCUMENT IS AT THE RISK OF THE USER.
+
+-->
+<xs:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.onem2m.org/xml/protocols"
+	xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	elementFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+	<xs:include schemaLocation="CDT-commonTypes-v0_8_0.xsd" />
+	<xs:include schemaLocation="CDT-subscription-v0_8_0.xsd" />
+
+	<xs:element name="statsCollect">
+		<xs:complexType>
+			<xs:complexContent>
+				<!-- Inherit common attributes -->
+				<xs:extension base="m2m:regularResource">
+					<xs:sequence>
+						<!-- Resource Specific Attributes -->
+						<xs:element name="creator" type="m2m:ID" />
+						<xs:element name="statsCollectID" type="xs:string" />
+						<xs:element name="collectingEntityID" type="m2m:ID" />
+                        <xs:element name="collectedEntityID" type="m2m:ID" />						
+						<xs:element name="statsRuleStatus" type="m2m:statsRuleStatusType" />
+						<xs:element name="statModel" type="m2m:statModelType" />
+						<xs:element name="collectPeriod" type="m2m:extendedCrontab" minOccurs="0" />
+                        <xs:element name="eventID" type="xs:string" minOccurs="0" />
+                        
+						<!-- Child Resources -->
+						<xs:choice minOccurs="0" maxOccurs="1">
+							<xs:element name="childResource" type="m2m:childResourceRef" maxOccurs="unbounded" />
+							<xs:element ref="m2m:subscription" maxOccurs="unbounded" />
+						</xs:choice>
+					</xs:sequence>
+				</xs:extension>
+			</xs:complexContent>
+		</xs:complexType>
+	</xs:element>
+</xs:schema>
diff --git a/CDT-statsConfig-v0_8_0.xsd b/CDT-statsConfig-v0_8_0.xsd
new file mode 100644
index 0000000..16eb9e5
--- /dev/null
+++ b/CDT-statsConfig-v0_8_0.xsd
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+Copyright Notification
+
+The oneM2M Partners authorize you to copy this document, provided that you retain all copyright and other proprietary notices 
+contained in the original materials on any copies of the materials and that you comply strictly with these terms. 
+This copyright permission does not constitute an endorsement of the products or services, nor does it encompass the granting of 
+any patent rights. The oneM2M Partners assume no responsibility for errors or omissions in this document. 
+© 2014, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TTA, TTC). All rights reserved.
+
+Notice of Disclaimer & Limitation of Liability 
+
+The information provided in this document is directed solely to professionals who have the appropriate degree of experience to understand 
+and interpret its contents in accordance with generally accepted engineering or other professional standards and applicable regulations. 
+No recommendation as to products or vendors is made or should be implied. 
+
+NO REPRESENTATION OR WARRANTY IS MADE THAT THE INFORMATION IS TECHNICALLY ACCURATE OR SUFFICIENT OR CONFORMS TO ANY STATUTE, 
+GOVERNMENTAL RULE OR REGULATION, AND FURTHER, NO REPRESENTATION OR WARRANTY IS MADE OF MERCHANTABILITY OR FITNESS FOR ANY 
+PARTICULAR PURPOSE OR AGAINST INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS. 
+NO oneM2M PARTNER TYPE 1 SHALL BE LIABLE, BEYOND THE AMOUNT OF ANY SUM RECEIVED IN PAYMENT BY THAT PARTNER FOR THIS DOCUMENT, WITH RESPECT TO 
+ANY CLAIM, AND IN NO EVENT SHALL oneM2M BE LIABLE FOR LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES. 
+oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PROVIDED IN THIS DOCUMENT IS AT THE RISK OF THE USER.
+
+-->
+<xs:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.onem2m.org/xml/protocols"
+	xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	elementFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+	<xs:include schemaLocation="CDT-commonTypes-v0_8_0.xsd" />
+
+	<xs:include schemaLocation="CDT-eventConfig-v0_8_0.xsd" />
+	<xs:include schemaLocation="CDT-subscription-v0_8_0.xsd" />
+
+	<xs:element name="statsConfig">
+		<xs:complexType>
+			<xs:complexContent>
+				<!-- Inherit common attributes -->
+				<xs:extension base="m2m:regularResource">
+					<xs:sequence>
+						<!-- Resource Specific Attributes -->
+						<xs:element name="creator" type="m2m:ID" />
+
+						<!-- Child Resources -->
+						<xs:choice minOccurs="0" maxOccurs="1">
+							<xs:element name="childResource" type="m2m:childResourceRef" minOccurs="1" maxOccurs="unbounded" />
+							<xs:choice minOccurs="1" maxOccurs="unbounded">
+								<xs:element ref="m2m:eventConfig" />
+								<xs:element ref="m2m:subscription" />
+							</xs:choice>
+						</xs:choice>
+					</xs:sequence>
+				</xs:extension>
+			</xs:complexContent>
+		</xs:complexType>
+	</xs:element>
+</xs:schema>
-- 
GitLab