https://wiki.eclipse.org/api.php?action=feedcontributions&user=Guillaume.garzone.laas.fr&feedformat=atomEclipsepedia - User contributions [en]2024-03-29T14:30:12ZUser contributionsMediaWiki 1.26.4https://wiki.eclipse.org/index.php?title=OM2M/Download&diff=442351OM2M/Download2021-02-12T10:34:35Z<p>Garzone-eclipse.outlook.fr: /* Official Releases */</p>
<hr />
<div>__TOC__<br />
<br />
== Official Releases ==<br />
{|border="1" width="100%" class="wikitable"<br />
! Download<br />
! Date<br />
! Description<br />
! Release Notes<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.4.1/eclipse-om2m-v1-4-1.zip Eclipse OM2M v1.4.1] || February 15, 2021 || Bug fixing || [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.4.1_.28Feb._15.2C_2021.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.4.0/eclipse-om2m-v1-4-0.zip Eclipse OM2M v1.4.0] || August 5, 2020 || New Features || [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.4.0_.28Aug._05.2C_2020.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/eclipse-om2m-v1.3.0.zip Eclipse OM2M v1.3.0] || March 13, 2018 || Bug fixing and new features|| [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.3.0_.28March_13.2C_2018.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.2.0/eclipseom2m-v-1.2.0.zip Eclipse OM2M v1.2.0] || January 04, 2018 || Bug fixing || [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.2.0_.28January_04.2C_2018.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.1.0/eclipse-om2m-v1.1.0.zip Eclipse OM2M v1.1.0] || October 09, 2017 || oneM2M 2.0 support, new features, and bug fixing ||[https://wiki.eclipse.org/OM2M/Roadmap#Release_1.1.0_.28October_09.2C_2017.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.0.0/OM2M-1.0.0.zip Eclipse OM2M v1.0.0] || June 22, 2016 || oneM2M 1.0 support, new features, and bug fixing ||[https://wiki.eclipse.org/OM2M/Roadmap#Release_1.0.0_.28June_22.2C_2016.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/0.8.0/OM2M-0.8.0.zip Eclipse OM2M v0.8.0 ] || April 8, 2015 || smartM2M 1.0 support ||[https://wiki.eclipse.org/OM2M/Roadmap#Release_0.8.0_.28April_8.2C_2015.29 Release notes]<br />
|}<br />
<br />
== Dev releases ==<br />
<br />
{|border="1" width="100%" class="wikitable"<br />
! Download<br />
! Date<br />
! Description<br />
! Notes<br />
|-<br />
| [https://www.dropbox.com/s/062081xmpdoweqs/ECLIPSE-OM2M-DEV-202010.zip?dl=1 OM2M-DEV-27102020]<br />
|| October 27, 2020 || Bug fixing ||<br />
|-<br />
| [https://www.dropbox.com/s/nzgd57yxw1osyp4/OM2M-DEV-10072019.zip?dl=1 OM2M-DEV-10072019]<br />
|| July 10, 2019 || Bug fixing ||<br />
Fixed Bugs: <br><br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=540074 540074]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=543030 543030]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=531929 531929]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=543639 543639] <br><br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=544316 544316]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=529725 529725]<br />
|-<br />
| [https://www.dropbox.com/s/d7rwi26tkzokih7/OM2M-DEV-20112018.zip?dl=1 OM2M-DEV-20112018]<br />
|| November 20, 2018 || New features and bug fixing ||<br />
|-<br />
| [https://www.dropbox.com/s/n9pez3aw1l7jhb0/OM2M-DEV-13-11-2016.zip?dl=1 OM2M-DEV-13112016]<br />
|| November 13, 2016 || Bug fixing ||<br />
Fixed Bugs: <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=507443 507443]<br />
|-<br />
| [https://www.dropbox.com/s/uh20fepedxp1gkr/OM2M-DEV-30-07-2016.zip?dl=1 OM2M-DEV-30072016]<br />
|| July 30, 2016 || Bug fixing ||<br />
Fixed Bugs: <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=497579 497579]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=495606 495606]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=498911 498911] <br />
|-<br />
| [https://www.dropbox.com/s/r020j0p47vc5mup/OM2M-DEV-24-04-2016.zip?dl=1 OM2M-DEV-24042016]<br />
|| April 24, 2016 || Bug fixing ||<br />
Features and fixed Bugs: <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=491796 491796]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=491797 491797] <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=491791 491791]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=488769 488769] <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=488268 488268]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=488269 488269]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=484399 484399]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=473505 473505]<br />
|}<br />
<br />
== Source code ==<br />
Click [http://git.eclipse.org/c/om2m/org.eclipse.om2m.git here] to access OM2M source code repository.</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/Download&diff=442350OM2M/Download2021-02-12T10:34:13Z<p>Garzone-eclipse.outlook.fr: </p>
<hr />
<div>__TOC__<br />
<br />
== Official Releases ==<br />
{|border="1" width="100%" class="wikitable"<br />
! Download<br />
! Date<br />
! Description<br />
! Release Notes<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.4.1/eclipse-om2m-v1-4-1.zip Eclipse OM2M v1.4.1] || February 15, 2021 || Bug fixes || [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.4.1_.28Feb._15.2C_2021.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.4.0/eclipse-om2m-v1-4-0.zip Eclipse OM2M v1.4.0] || August 5, 2020 || New Features || [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.4.0_.28Aug._05.2C_2020.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/eclipse-om2m-v1.3.0.zip Eclipse OM2M v1.3.0] || March 13, 2018 || Bug fixing and new features|| [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.3.0_.28March_13.2C_2018.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.2.0/eclipseom2m-v-1.2.0.zip Eclipse OM2M v1.2.0] || January 04, 2018 || Bug fixing || [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.2.0_.28January_04.2C_2018.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.1.0/eclipse-om2m-v1.1.0.zip Eclipse OM2M v1.1.0] || October 09, 2017 || oneM2M 2.0 support, new features, and bug fixing ||[https://wiki.eclipse.org/OM2M/Roadmap#Release_1.1.0_.28October_09.2C_2017.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.0.0/OM2M-1.0.0.zip Eclipse OM2M v1.0.0] || June 22, 2016 || oneM2M 1.0 support, new features, and bug fixing ||[https://wiki.eclipse.org/OM2M/Roadmap#Release_1.0.0_.28June_22.2C_2016.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/0.8.0/OM2M-0.8.0.zip Eclipse OM2M v0.8.0 ] || April 8, 2015 || smartM2M 1.0 support ||[https://wiki.eclipse.org/OM2M/Roadmap#Release_0.8.0_.28April_8.2C_2015.29 Release notes]<br />
|}<br />
<br />
== Dev releases ==<br />
<br />
{|border="1" width="100%" class="wikitable"<br />
! Download<br />
! Date<br />
! Description<br />
! Notes<br />
|-<br />
| [https://www.dropbox.com/s/062081xmpdoweqs/ECLIPSE-OM2M-DEV-202010.zip?dl=1 OM2M-DEV-27102020]<br />
|| October 27, 2020 || Bug fixing ||<br />
|-<br />
| [https://www.dropbox.com/s/nzgd57yxw1osyp4/OM2M-DEV-10072019.zip?dl=1 OM2M-DEV-10072019]<br />
|| July 10, 2019 || Bug fixing ||<br />
Fixed Bugs: <br><br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=540074 540074]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=543030 543030]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=531929 531929]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=543639 543639] <br><br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=544316 544316]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=529725 529725]<br />
|-<br />
| [https://www.dropbox.com/s/d7rwi26tkzokih7/OM2M-DEV-20112018.zip?dl=1 OM2M-DEV-20112018]<br />
|| November 20, 2018 || New features and bug fixing ||<br />
|-<br />
| [https://www.dropbox.com/s/n9pez3aw1l7jhb0/OM2M-DEV-13-11-2016.zip?dl=1 OM2M-DEV-13112016]<br />
|| November 13, 2016 || Bug fixing ||<br />
Fixed Bugs: <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=507443 507443]<br />
|-<br />
| [https://www.dropbox.com/s/uh20fepedxp1gkr/OM2M-DEV-30-07-2016.zip?dl=1 OM2M-DEV-30072016]<br />
|| July 30, 2016 || Bug fixing ||<br />
Fixed Bugs: <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=497579 497579]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=495606 495606]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=498911 498911] <br />
|-<br />
| [https://www.dropbox.com/s/r020j0p47vc5mup/OM2M-DEV-24-04-2016.zip?dl=1 OM2M-DEV-24042016]<br />
|| April 24, 2016 || Bug fixing ||<br />
Features and fixed Bugs: <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=491796 491796]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=491797 491797] <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=491791 491791]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=488769 488769] <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=488268 488268]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=488269 488269]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=484399 484399]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=473505 473505]<br />
|}<br />
<br />
== Source code ==<br />
Click [http://git.eclipse.org/c/om2m/org.eclipse.om2m.git here] to access OM2M source code repository.</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/Roadmap&diff=442349OM2M/Roadmap2021-02-12T10:32:39Z<p>Garzone-eclipse.outlook.fr: </p>
<hr />
<div>This page describes the current plan for the upcoming features of the OM2M project.<br />
<br />
Please note that this roadmap is a moving target. Depending on priorities and community contribution, the roadmap can change any time, so do not take it for granted, but see it as a guidance of direction.<br />
<br />
<br />
== Release 1.4.1 (Feb. 15, 2021) ==<br />
=== Fixed bugs ===<br />
* Fix bug [https://bugs.eclipse.org/bugs/show_bug.cgi?id=540074 540074] (Notifier did not remove properly the uri of a subscription when deleted)<br />
* Fix bug [https://bugs.eclipse.org/bugs/show_bug.cgi?id=543030 543030] (Evict cache of CSE Base when deleting a child Remote CSE)<br />
* Fix bug [https://bugs.eclipse.org/bugs/show_bug.cgi?id=543639 543639] (Issues with Java 1.8 and Tycho)<br />
* Fix bug [https://bugs.eclipse.org/bugs/show_bug.cgi?id=531929 531929] (Issue in XML serialization of ACP resource)<br />
* Fix bug [https://bugs.eclipse.org/bugs/show_bug.cgi?id=544316 544316] (Update of nodelink attribute policy in AE resource)<br />
* Fix bug [https://bugs.eclipse.org/bugs/show_bug.cgi?id=529725 529725] (Fixes in ACP DAO and Utils)<br />
* Fix bug [https://bugs.eclipse.org/bugs/show_bug.cgi?id=568310 568310] (Fixes in webpage, added missing mandatory header in some requests)<br />
<br />
== Release 1.4.0 (Aug. 05, 2020) ==<br />
=== Features ===<br />
Eclipse OM2M 1.4.0 offers the following features:<br />
* Implementation of Dynamic Authorization features as defined to oneM2M standard.<br />
* Add SDT new modules and devices<br />
* SDT bug fixing<br />
* Memory usage enhancements<br />
* New unit tests<br />
=== Minor updates ===<br />
* Update to EPL 2.0<br />
<br />
== Release 1.3.0 (March 13, 2018)==<br />
<br />
=== Features ===<br />
This release provides the following updates and new features:<br />
* oneM2M java clients<br />
* oneM2M javascript clients<br />
* oneM2M arduino clients<br />
* ManagementObject :<br />
** Announcement<br />
** Persistence<br />
** Add new Management Object<br />
** Use DeviceInfo Management Object in SDT IPE<br />
<br />
=== Fixed bugs ===<br />
* FlexContainers<br />
** Remove unused XmlSeeAlso annotation into FlexContainers<br />
** Fix deviceSwitchButton device short name <br />
* Discovery with multiple labels<br />
<br />
== Release 1.2.0 (January 04, 2018) ==<br />
=== Features ===<br />
This release provides the following updates and new features:<br />
* android.dashboard: initial import<br />
* build MN-CSE & IN-CSE docker image<br />
* mocked sdt devices : add Thermometer, SwitchButton, NumberValue<br />
* sdt.app.homemonitoring:<br />
** disable switch button in case of readOnly SDT module<br />
** highlight values on notification<br />
<br />
=== Fixed bugs ===<br />
The following bugs are fixed:<br />
* all: <br />
** fix UTF8 character encoding issue<br />
** remove RequestPrimitive's targetId field<br />
* persistence.mongodb: <br />
** implement missing DAO<br />
** fix issue on Container persistence<br />
* announcement : fix issue regarding Container announcement<br />
* commons: fix announcement issue<br />
* datamapping.jaxb: log enhancement.<br />
* sdt.app.homemonitoring: fix authentication issue<br />
* sdt.home.netatmo : fix naming issue<br />
* sdt.app.comparator :fix rendering issue<br />
* Resource browser:Fix rendering issue <br />
* [Bug 526616] Update ol attribute of container correctly<br />
* Fix Bug 522099 on discovery with label filter<br />
<br />
== Release 1.1.0 (October 09, 2017) ==<br />
=== Features ===<br />
This release provides the following updates and new features: <br />
* oneM2M release 2 support<br />
* MQTT communication binding<br />
* NoSQL MongoDB storage<br />
* Smart Device Template (SDT)<br />
* FlexContainer resource<br />
* Dynamic Authorization<br />
* Resource Announcement<br />
* Enocean interworking<br />
* Hue interworking<br />
* Netatmo interworking<br />
* SmarterCoffee interworking<br />
* LIFX interworking<br />
* OSGi DAL (Device Abstraction Layer) interworking<br />
* Several test suites<br />
<br />
=== Tutorials ===<br />
Several tutorials already proposed to explain how to use the new features developed in this release:<br />
* How to use oneM2M MQTT binding<br />
* Develop oneM2M applications<br />
* Develop an Interworking Proxy Plugin<br />
* Develop an Interworking Proxy Application Entity (IPE) Plugin with SDT<br />
* Developing with FlexContainers<br />
* Change database config.<br />
* Integrate OSGi DAL devices into OM2M by using DAL IPE Plugin<br />
Check our wiki: https://wiki.eclipse.org/OM2M/one<br />
<br />
=== Fixed bugs ===<br />
The following bugs are fixed:<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=501266 Bug 501266] - ACP automatically created when an AE is created dosn't have ty=1<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=498911 Bug 498911] - Error in Access Right verification for PoA notification<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=498387 Bug 498387] - Smart Device Template (SDT) support<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=498374 Bug 498374] - FlexContainer feature support<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=497579 Bug 497579] - Unwanted deletion of AEs having the name of the wanted deleted AE as a prefix<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=495606 Bug 495606] - Error on creating ContentInstance with maxNumberOfInstance in Container<br />
<br />
== Release 1.0.0 (June 22, 2016) ==<br />
=== Features ===<br />
Implementation of the oneM2M standard. For more information see [http://www.onem2m.org/ oneM2M standard].<br />
<br />
Main supported features:<br />
<br />
* Nodes: IN-CSE, MN-CSE, ASN-CSE, and ADN.<br />
* Reference Points: MCA, and MCC.<br />
* Resource types: CSEBase, RemoteCSE, ACP, AE, Container, ContentInstance, Subscription, Group, Node, Request, PoA, etc.<br />
* Request primitives: Retrieve, Create, Update, Delete, and Notify.<br />
* Addressing formats: Structured and Unstructured. <br />
* Addressing modes: Absolute, SP-relative, and CSE-Relative.<br />
* Protocol Bindings: HTTP and CoAP.<br />
* Content Formats: XML and JSON.<br />
* Communication Modes: Blocking, Non Blocking Syhcnronous, and Non Blocking Asynchrnonous.<br />
* Multihop: retargeting via PoA.<br />
* Storage mode: SQL and NoSQL (SQL H2 by default)<br />
* Security: SSL/TLS<br />
<br />
=== Fixed bugs ===<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=494086 Bug 494086] - Top level node in JSON representation now with m2m: prefix<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=494911 Bug 494911] - Issues in CoAP binding<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=494090 Bug 494090] - Enable wildcard for AccessControl originators<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=494087 Bug 494087] - hange in some oneM2M Constants<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=492961 Bug 492961] - Missing Access check for Notify requests<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=491796 Bug 491796] - Support JSON content format<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=491797 Bug 491797] - Support of CoAP binding<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=491791 Bug 491791] - Enable resource name attribute in creation request<br />
<br />
== Release 0.8.0 (April 8, 2015) ==<br />
=== Features ===<br />
The first release of OM2M will include the following features:<br />
<br />
* Implement the SmartM2M standard. For more information see [http://www.etsi.org/technologies-clusters/technologies/m2m SmartM2M standard]<br />
* Provide a modular architecture running on top of an OSGi layer based on Eclipse Equinox. <br />
* Integrate Maven and Tycho to automate build process and RCP development.<br />
* Provide a protocol-independent CORE plugin to handle generic REST request.<br />
* Enable machine registration, application deployment, container management, resource discovery, access right authorization, subscription / notification, group management, and resource announcement.<br />
* Provide a HTTP communication binding plugin based on Jetty and Apache HTTP client libraries.<br />
* Provide a CoAP communication binding plugin based on the Californium library.<br />
* Provide a simple retargeting mechanism to connect HTTP and CoAP enabled devices.<br />
* Provide an interworking sample plugin with simulated devices to show how to connect legacy devices.<br />
* Provide a web interface plugin for browsing and debugging each machine resource structure.<br />
* Provide a DAO persistence layer based on EclipseLink JPA library to support different SQL and NOSQL database solutions.<br />
* Replace the DB4O database with the H2 database which provide better performance.<br />
* Introduce required persistence parameters to the "config.ini" file to simplify the JPA configuration.<br />
* Replace the XSD resource validation with a native validation mechanism that offers more flexibility.<br />
* Replace the OASIS OBIX library with a native encoder/decoder based on the JAXB library.<br />
* Improve the OM2M performance by optimizing the resource structure and database access.<br />
<br />
=== Fixed bugs ===<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=463673 Bug 463673] - Problem in starting the GUI of the IPU sample plugin in the GSCL<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=463778 Bug 463778] - Replace the native launcher with an independent single script <br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=453467 Bug 453467] - Can't access a malformed created application<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=463941 Bug 463941] - OM2M starting blocked on ObixMapper</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/Download&diff=442184OM2M/Download2021-01-14T08:35:03Z<p>Garzone-eclipse.outlook.fr: /* Official Releases */</p>
<hr />
<div>__TOC__<br />
<br />
== Official Releases ==<br />
{|border="1" width="100%" class="wikitable"<br />
! Download<br />
! Date<br />
! Description<br />
! Release Notes<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.4.0/eclipse-om2m-v1-4-0.zip Eclipse OM2M v1.4.0] || August 5, 2020 || New Features || [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.4.0_.28Aug._05.2C_2020.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/eclipse-om2m-v1.3.0.zip Eclipse OM2M v1.3.0] || March 13, 2018 || Bug fixing and new features|| [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.3.0_.28March_13.2C_2018.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.2.0/eclipseom2m-v-1.2.0.zip Eclipse OM2M v1.2.0] || January 04, 2018 || Bug fixing || [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.2.0_.28January_04.2C_2018.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.1.0/eclipse-om2m-v1.1.0.zip Eclipse OM2M v1.1.0] || October 09, 2017 || oneM2M 2.0 support, new features, and bug fixing ||[https://wiki.eclipse.org/OM2M/Roadmap#Release_1.1.0_.28October_09.2C_2017.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.0.0/OM2M-1.0.0.zip Eclipse OM2M v1.0.0] || June 22, 2016 || oneM2M 1.0 support, new features, and bug fixing ||[https://wiki.eclipse.org/OM2M/Roadmap#Release_1.0.0_.28June_22.2C_2016.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/0.8.0/OM2M-0.8.0.zip Eclipse OM2M v0.8.0 ] || April 8, 2015 || smartM2M 1.0 support ||[https://wiki.eclipse.org/OM2M/Roadmap#Release_0.8.0_.28April_8.2C_2015.29 Release notes]<br />
|}<br />
<br />
== Dev releases ==<br />
<br />
{|border="1" width="100%" class="wikitable"<br />
! Download<br />
! Date<br />
! Description<br />
! Notes<br />
|-<br />
| [https://www.dropbox.com/s/062081xmpdoweqs/ECLIPSE-OM2M-DEV-202010.zip?dl=1 OM2M-DEV-27102020]<br />
|| October 27, 2020 || Bug fixing ||<br />
|-<br />
| [https://www.dropbox.com/s/nzgd57yxw1osyp4/OM2M-DEV-10072019.zip?dl=1 OM2M-DEV-10072019]<br />
|| July 10, 2019 || Bug fixing ||<br />
Fixed Bugs: <br><br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=540074 540074]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=543030 543030]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=531929 531929]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=543639 543639] <br><br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=544316 544316]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=529725 529725]<br />
|-<br />
| [https://www.dropbox.com/s/d7rwi26tkzokih7/OM2M-DEV-20112018.zip?dl=1 OM2M-DEV-20112018]<br />
|| November 20, 2018 || New features and bug fixing ||<br />
|-<br />
| [https://www.dropbox.com/s/n9pez3aw1l7jhb0/OM2M-DEV-13-11-2016.zip?dl=1 OM2M-DEV-13112016]<br />
|| November 13, 2016 || Bug fixing ||<br />
Fixed Bugs: <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=507443 507443]<br />
|-<br />
| [https://www.dropbox.com/s/uh20fepedxp1gkr/OM2M-DEV-30-07-2016.zip?dl=1 OM2M-DEV-30072016]<br />
|| July 30, 2016 || Bug fixing ||<br />
Fixed Bugs: <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=497579 497579]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=495606 495606]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=498911 498911] <br />
|-<br />
| [https://www.dropbox.com/s/r020j0p47vc5mup/OM2M-DEV-24-04-2016.zip?dl=1 OM2M-DEV-24042016]<br />
|| April 24, 2016 || Bug fixing ||<br />
Features and fixed Bugs: <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=491796 491796]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=491797 491797] <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=491791 491791]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=488769 488769] <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=488268 488268]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=488269 488269]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=484399 484399]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=473505 473505]<br />
|}<br />
<br />
== Source code ==<br />
Click [http://git.eclipse.org/c/om2m/org.eclipse.om2m.git here] to access OM2M source code repository.</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/Download&diff=442173OM2M/Download2021-01-13T08:42:37Z<p>Garzone-eclipse.outlook.fr: /* Dev releases */</p>
<hr />
<div>__TOC__<br />
<br />
== Official Releases ==<br />
{|border="1" width="100%" class="wikitable"<br />
! Download<br />
! Date<br />
! Description<br />
! Release Notes<br />
|-<br />
| [https://www.dropbox.com/s/2ijfsbw8asp9scu/ECLIPSE-OM2M-v1-4-0.zip?dl=1 Eclipse OM2M v1.4.0] || August 5, 2020 || New Features || [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.4.0_.28Aug._05.2C_2020.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/eclipse-om2m-v1.3.0.zip Eclipse OM2M v1.3.0] || March 13, 2018 || Bug fixing and new features|| [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.3.0_.28March_13.2C_2018.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.2.0/eclipseom2m-v-1.2.0.zip Eclipse OM2M v1.2.0] || January 04, 2018 || Bug fixing || [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.2.0_.28January_04.2C_2018.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.1.0/eclipse-om2m-v1.1.0.zip Eclipse OM2M v1.1.0] || October 09, 2017 || oneM2M 2.0 support, new features, and bug fixing ||[https://wiki.eclipse.org/OM2M/Roadmap#Release_1.1.0_.28October_09.2C_2017.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.0.0/OM2M-1.0.0.zip Eclipse OM2M v1.0.0] || June 22, 2016 || oneM2M 1.0 support, new features, and bug fixing ||[https://wiki.eclipse.org/OM2M/Roadmap#Release_1.0.0_.28June_22.2C_2016.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/0.8.0/OM2M-0.8.0.zip Eclipse OM2M v0.8.0 ] || April 8, 2015 || smartM2M 1.0 support ||[https://wiki.eclipse.org/OM2M/Roadmap#Release_0.8.0_.28April_8.2C_2015.29 Release notes]<br />
|}<br />
<br />
== Dev releases ==<br />
<br />
{|border="1" width="100%" class="wikitable"<br />
! Download<br />
! Date<br />
! Description<br />
! Notes<br />
|-<br />
| [https://www.dropbox.com/s/062081xmpdoweqs/ECLIPSE-OM2M-DEV-202010.zip?dl=1 OM2M-DEV-27102020]<br />
|| October 27, 2020 || Bug fixing ||<br />
|-<br />
| [https://www.dropbox.com/s/nzgd57yxw1osyp4/OM2M-DEV-10072019.zip?dl=1 OM2M-DEV-10072019]<br />
|| July 10, 2019 || Bug fixing ||<br />
Fixed Bugs: <br><br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=540074 540074]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=543030 543030]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=531929 531929]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=543639 543639] <br><br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=544316 544316]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=529725 529725]<br />
|-<br />
| [https://www.dropbox.com/s/d7rwi26tkzokih7/OM2M-DEV-20112018.zip?dl=1 OM2M-DEV-20112018]<br />
|| November 20, 2018 || New features and bug fixing ||<br />
|-<br />
| [https://www.dropbox.com/s/n9pez3aw1l7jhb0/OM2M-DEV-13-11-2016.zip?dl=1 OM2M-DEV-13112016]<br />
|| November 13, 2016 || Bug fixing ||<br />
Fixed Bugs: <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=507443 507443]<br />
|-<br />
| [https://www.dropbox.com/s/uh20fepedxp1gkr/OM2M-DEV-30-07-2016.zip?dl=1 OM2M-DEV-30072016]<br />
|| July 30, 2016 || Bug fixing ||<br />
Fixed Bugs: <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=497579 497579]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=495606 495606]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=498911 498911] <br />
|-<br />
| [https://www.dropbox.com/s/r020j0p47vc5mup/OM2M-DEV-24-04-2016.zip?dl=1 OM2M-DEV-24042016]<br />
|| April 24, 2016 || Bug fixing ||<br />
Features and fixed Bugs: <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=491796 491796]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=491797 491797] <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=491791 491791]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=488769 488769] <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=488268 488268]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=488269 488269]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=484399 484399]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=473505 473505]<br />
|}<br />
<br />
== Source code ==<br />
Click [http://git.eclipse.org/c/om2m/org.eclipse.om2m.git here] to access OM2M source code repository.</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/Download&diff=442172OM2M/Download2021-01-13T08:26:22Z<p>Garzone-eclipse.outlook.fr: </p>
<hr />
<div>__TOC__<br />
<br />
== Official Releases ==<br />
{|border="1" width="100%" class="wikitable"<br />
! Download<br />
! Date<br />
! Description<br />
! Release Notes<br />
|-<br />
| [https://www.dropbox.com/s/2ijfsbw8asp9scu/ECLIPSE-OM2M-v1-4-0.zip?dl=1 Eclipse OM2M v1.4.0] || August 5, 2020 || New Features || [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.4.0_.28Aug._05.2C_2020.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/eclipse-om2m-v1.3.0.zip Eclipse OM2M v1.3.0] || March 13, 2018 || Bug fixing and new features|| [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.3.0_.28March_13.2C_2018.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.2.0/eclipseom2m-v-1.2.0.zip Eclipse OM2M v1.2.0] || January 04, 2018 || Bug fixing || [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.2.0_.28January_04.2C_2018.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.1.0/eclipse-om2m-v1.1.0.zip Eclipse OM2M v1.1.0] || October 09, 2017 || oneM2M 2.0 support, new features, and bug fixing ||[https://wiki.eclipse.org/OM2M/Roadmap#Release_1.1.0_.28October_09.2C_2017.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.0.0/OM2M-1.0.0.zip Eclipse OM2M v1.0.0] || June 22, 2016 || oneM2M 1.0 support, new features, and bug fixing ||[https://wiki.eclipse.org/OM2M/Roadmap#Release_1.0.0_.28June_22.2C_2016.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/0.8.0/OM2M-0.8.0.zip Eclipse OM2M v0.8.0 ] || April 8, 2015 || smartM2M 1.0 support ||[https://wiki.eclipse.org/OM2M/Roadmap#Release_0.8.0_.28April_8.2C_2015.29 Release notes]<br />
|}<br />
<br />
== Dev releases ==<br />
<br />
{|border="1" width="100%" class="wikitable"<br />
! Download<br />
! Date<br />
! Description<br />
! Notes<br />
|-<br />
| [https://www.dropbox.com/s/nzgd57yxw1osyp4/OM2M-DEV-10072019.zip?dl=1 OM2M-DEV-10072019]<br />
|| July 10, 2019 || Bug fixing ||<br />
Fixed Bugs: <br><br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=540074 540074]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=543030 543030]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=531929 531929]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=543639 543639] <br><br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=544316 544316]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=529725 529725]<br />
|-<br />
| [https://www.dropbox.com/s/d7rwi26tkzokih7/OM2M-DEV-20112018.zip?dl=1 OM2M-DEV-20112018]<br />
|| November 20, 2018 || New features and bug fixing ||<br />
|-<br />
| [https://www.dropbox.com/s/n9pez3aw1l7jhb0/OM2M-DEV-13-11-2016.zip?dl=1 OM2M-DEV-13112016]<br />
|| November 13, 2016 || Bug fixing ||<br />
Fixed Bugs: <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=507443 507443]<br />
|-<br />
| [https://www.dropbox.com/s/uh20fepedxp1gkr/OM2M-DEV-30-07-2016.zip?dl=1 OM2M-DEV-30072016]<br />
|| July 30, 2016 || Bug fixing ||<br />
Fixed Bugs: <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=497579 497579]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=495606 495606]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=498911 498911] <br />
|-<br />
| [https://www.dropbox.com/s/r020j0p47vc5mup/OM2M-DEV-24-04-2016.zip?dl=1 OM2M-DEV-24042016]<br />
|| April 24, 2016 || Bug fixing ||<br />
Features and fixed Bugs: <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=491796 491796]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=491797 491797] <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=491791 491791]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=488769 488769] <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=488268 488268]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=488269 488269]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=484399 484399]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=473505 473505]<br />
|}<br />
<br />
== Source code ==<br />
Click [http://git.eclipse.org/c/om2m/org.eclipse.om2m.git here] to access OM2M source code repository.</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/one/FlexContainers&diff=441352OM2M/one/FlexContainers2020-10-23T14:09:00Z<p>Garzone-eclipse.outlook.fr: </p>
<hr />
<div>== FlexContainer description ==<br />
A FlexContainer is a resource similar to a Container. The main difference is the capability of a Flexcontainer to have an extensible set of custom attributes.<br />
[[File:FlexContainerObject.png]]<br />
<br />
A FlexContainer has a containerDefinition attribute that defines the set of custom attributes a Flexcontainer holds. <br />
<br />
More information in section 9.6.35 of TS0001 version 2.10.0<br />
<br />
<br />
== FlexContainer creation ==<br />
=== Through HTTP binding ===<br />
==== Request ====<br />
{| class="wikitable"<br />
! HTTP method <br />
| POST<br />
|-<br />
! URL<br />
| http://<ip_cse>:<port_cse>/~/in-cse/in-name<br />
|-<br />
! Headers<br />
| <br />
{| class="wikitable"<br />
! Name<br />
! Value<br />
! Comments<br />
|-<br />
| X-M2M-Origin<br />
| admin:admin<br />
| Login:password<br />
|-<br />
| Content-Type<br />
| ty=28<br />
| Type of the resource to be created<br />
|- <br />
|}<br />
|-<br />
! Body<br />
| <br />
<pre><br />
<?xml version="1.0" encoding="UTF-8"?> <br />
<m2m:fcnt xmlns:m2m="http://www.onem2m.org/xml/protocols" ><br />
<rn>myFlexContainer</rn><br />
<!-- container Definition is mandatory --><br />
<cnd>org.eclipse.om2m.mydef</cnd><br />
<br />
<!-- some custom attributes --> <br />
<myStringCustomAttribute <br />
type="xs:string">stringValue</myStringCustomAttribute><br><br />
<myIntegerCustomAttribute <br />
type="xs:integer">123</myIntegerCustomAttribute><br><br />
</m2m:fcnt> <br />
</pre><br />
|}<br />
<br />
An example:<br />
<pre><br />
POST /~/in-cse/in-name HTTP/1.1<br />
Host: 127.0.0.1:8080<br />
X-M2M-Origin: admin:adminContent-Type: ty=28<br />
Cache-Control: no-cache<br />
Postman-Token: 965301cf-ade2-a4f2-2b4e-a7b2d8758dca<br />
<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:fcnt xmlns:m2m="http://www.onem2m.org/xml/protocols" ><br />
<rn>myFlexContainer</rn><br />
<cnd>org.eclipse.om2m.mydef</cnd><br />
<br />
</m2m:fcnt><br />
<br />
</pre><br />
<br />
==== Response ====<br />
<br />
{| class="wikitable"<br />
! HTTP response code<br />
| 201 CREATED<br />
|-<br />
! Response body<br />
|<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:fcnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="'''myFlexContainer'''"><br />
<!-- ty : resource type (28 = flexContainer) --><br />
<ty>28</ty><br />
<br />
<!-- ri = resource identifier --><br />
<ri>/in-cse/fcnt-953225660</ri> <br />
<br />
<!-- pi = parent identifier --><br />
<pi>/in-cse</pi><br />
<br />
<!-- ct = creation time --><br />
<ct>20161221T100447</ct><br />
<br />
<!-- lt = last modified time --><br />
<lt>20161221T100447</lt><br />
<br />
<!-- acpi = Access Control Policy identifiers --><br />
<acpi>/in-cse/acp-34501615</acpi><br />
<br />
<!-- et = expiration time --><br />
<et>20171221T100447</et><br />
<br />
<!--cntDef = container definition --><br />
<cnd>org.eclipse.om2m.mydef</cnd><br />
<br />
< !-- custom attributes --><br />
<myStringCustomAttribute <br />
type="xs:string">stringValue</myStringCustomAttribute><br />
<myIntegerCustomAttribute <br />
type="xs:integer">123</myIntegerCustomAttribute><br />
</m2m:fcnt><br />
|}<br />
<br />
<br />
=== Through CSEService OSGi service ===<br />
<br />
<source lang="java" enclose="div" line><br />
// create a FlexContainer object <br />
FlexContainer flexContainer = new FlexContainer();<br />
flexContainer.setContainerDefinition("org.eclipse.om2m.mydef");<br />
flexContainer.setCreator("Orange");<br />
<br />
// myStringCustomAttribute<br />
CustomAttribute myStringCustomAttribute = new CustomAttribute();<br />
myStringCustomAttribute.setCustomAttributeName("myStringCustomAttribute");<br />
myStringCustomAttribute.setCustomAttributeType("xs:string");<br />
myStringCustomAttribute.setCustomAttributeValue("stringValue");<br />
flexContainer.getCustomAttributes().add(myStringCustomAttribute);<br />
<br />
// myIntegerCustomAttribute<br />
CustomAttribute myIntegerCustomAttribute = new CustomAttribute();<br />
myIntegerCustomAttribute.setCustomAttributeName("myIntegerCustomAttribute");<br />
myIntegerCustomAttribute.setCustomAttributeType("xs:integer");<br />
myIntegerCustomAttribute.setCustomAttributeValue("123");<br />
flexContainer.getCustomAttributes().add(myIntegerCustomAttribute);<br />
<br />
// prepare request<br />
RequestPrimitive request = new RequestPrimitive();<br />
request.setContent(flexContainer);<br />
request.setFrom(“admin:admin”);<br />
request.setTargetId(“/in-cse/in-name”);<br />
request.setTo(“/in-cse/in-name”);<br />
request.setResourceType(ResourceType.FLEXCONTAINER);<br />
request.setRequestContentType(MimeMediaType.OBJ);<br />
request.setReturnContentType(MimeMediaType.OBJ);<br />
request.setName(“myFlexContainer”);<br />
request.setOperation(Operation.CREATE);<br />
<br />
// execute request<br />
// cseService is an OSGi service registered by the CSE<br />
// cseService implements org.eclipse.om2m.core.service.CseService<br />
ResponsePrimitive response = cseService.doRequest(request);<br />
<br />
// check response<br />
if (response.getResponseStatusCode().equals(ResponseStatusCode.CREATED)) {<br />
// OK<br />
FlexContainer responseCreatedFlexContainer = (FlexContainer) response.getContent();<br />
<br />
// use getters of FlexContainer to retrieve FlexContainer fields<br />
}<br />
</source><br />
<br />
<br />
== FlexContainer retrieving ==<br />
=== Through HTTP binding ===<br />
==== Request ====<br />
{| class="wikitable"<br />
! HTTP method <br />
| GET<br />
|-<br />
! URL<br />
| http://<ip_cse>:<port_cse>/~/in-cse/in-name/myFlexContainer <br/><br />
or <br/><br />
http://<ip_cse>:<port_cse>/~/in-cse/fcnt-953225660 <br />
|-<br />
! Headers<br />
| <br />
{| class="wikitable"<br />
! Name<br />
! Value<br />
! Comments<br />
|-<br />
| X-M2M-Origin<br />
| admin:admin<br />
| Login:password<br />
|}<br />
|}<br />
<br />
An example:<br />
<pre><br />
GET /~/in-cse/in-name/myFlexContainer HTTP/1.1<br />
Host: 127.0.0.1:8080<br />
X-M2M-Origin: admin:admin<br />
Cache-Control: no-cache<br />
Postman-Token: 51dc4ccf-72df-a479-880b-891118112665<br />
</pre><br />
<br />
==== Response ====<br />
<br />
{| class="wikitable"<br />
! HTTP response code<br />
| 200 OK<br />
|-<br />
! Response body<br />
|<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:fcnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="myFlexContainer"><br />
<br />
<!-- ty : resource type (28 = flexContainer) --><br />
<ty>28</ty><br />
<br />
<!-- ri = resource identifier --><br />
<ri>/in-cse/fcnt-491936033</ri><br />
<br />
<!-- pi = parent identifier --><br />
<pi>/in-cse</pi><br />
<br />
<!-- ct = creation time --><br />
<ct>20161221T102226</ct><br />
<br />
<!-- lt = last modified time --><br />
<lt>20161221T102226</lt><br />
<!-- acpi = Access Control Policy identifiers --><br />
<acpi>/in-cse/acp-34501615</acpi><br />
<br />
<!-- et = expiration time --><br />
<et>20171221T102226</et><br />
<br />
<!--cntDef = container definition --><br />
<cnd>org.eclipse.om2m.mydef</cnd><br />
<br />
<!-- custom attributes --><br />
<myStringCustomAttribute <br />
type="xs:string">stringValue</myStringCustomAttribute><br />
<myIntegerCustomAttribute <br />
type="xs:integer">123</myIntegerCustomAttribute><br />
</m2m:fcnt><br />
<br />
|}<br />
<br />
<br />
=== Through CSEService OSGi service ===<br />
<br />
<source lang="java" enclose="div" line><br />
// prepare request<br />
RequestPrimitive request = new RequestPrimitive();<br />
request.setFrom(“admin:admin”);<br />
<br />
request.setTargetId(“/in-cse/in-name/myFlexContainer”);<br />
// targetId could also be “/in-cse/fcnt-491936033”<br />
request.setTo(“/in-cse/in-name/myFlexContainer”););<br />
request.setRequestContentType(MimeMediaType.OBJ);<br />
request.setReturnContentType(MimeMediaType.OBJ);<br />
request.setOperation(Operation.RETRIEVE);<br />
<br />
// several ResultContent type possibles <br />
request.setResultContent(ResultContent.ATTRIBUTES_AND_CHILD_REF);<br />
<br />
// execute request<br />
ResponsePrimitive response = cseService.doRequest(request);<br />
<br />
if (response.getResponseStatusCode().equals(ResponseStatusCode.OK)) {<br />
// OK<br />
FlexContainer responseCreatedFlexContainer = (FlexContainer) response.getContent();<br />
<br />
// use getters of FlexContainer to retrieve FlexContainer fields<br />
responseCreatedFlexContainer.getName();<br />
responseCreatedFlexContainer.getContainerDefinition();<br />
…<br />
}<br />
<br />
</source><br />
<br />
<br />
<br />
== FlexContainer update ==<br />
=== Through HTTP binding ===<br />
==== Request ====<br />
{| class="wikitable"<br />
! HTTP method <br />
| PUT<br />
|-<br />
! URL<br />
| http://<ip_cse>:<port_cse>/~/in-cse/in-name/myFlexContainer <br/><br />
or <br/><br />
http://<ip_cse>:<port_cse>/~/in-cse/fcnt-953225660 <br />
|-<br />
! Headers<br />
| <br />
{| class="wikitable"<br />
! Name<br />
! Value<br />
! Comments<br />
|-<br />
| X-M2M-Origin<br />
| admin:admin<br />
| Login:password<br />
|}<br />
|-<br />
! Body<br />
| <br />
<pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:fcnt xmlns:m2m="http://www.onem2m.org/xml/protocols" ><br />
<br />
<!-- acpi field is updatable --><br />
<!-- other fields except custom attribute fields are not updatable --><br />
<br />
<!-- custom attribute fields are updatable --><br />
<myStringCustomAttribute <br />
type="xs:string">newStringValue</myStringCustomAttribute><br />
<myIntegerCustomAttribute <br />
type="xs:integer">1234567</myIntegerCustomAttribute><br />
</m2m:fcnt><br />
<br />
</pre><br />
|}<br />
<br />
An example:<br />
<pre><br />
PUT /~/in-cse/in-name/myFlexContainer HTTP/1.1<br />
Host: 127.0.0.1:8080<br />
X-M2M-Origin: admin:admin<br />
Cache-Control: no-cache<br />
Postman-Token: d05b77ed-f1bd-4edc-fc26-c79a49f9c7de<br />
<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:fcnt xmlns:m2m="http://www.onem2m.org/xml/protocols" ><br />
<!-- only custom attribute fields are updatable --><br />
<myStringCustomAttribute <br />
type="xs:string">newStringValue</myStringCustomAttribute><br />
<myIntegerCustomAttribute <br />
type="xs:integer">1234567</myIntegerCustomAttribute><br />
</m2m:fcnt><br />
<br />
</pre><br />
<br />
==== Response ====<br />
<br />
{| class="wikitable"<br />
! HTTP response code<br />
| 200 OK<br />
|-<br />
! Response body<br />
|<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:fcnt xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<br />
<!-- lt = last modified time --><br />
<lt>20161221T113042</lt><br />
<br />
<!-- custom Attributes --><br />
<myStringCustomAttribute <br />
type="xs:string">newStringValue</myStringCustomAttribute><br />
<myIntegerCustomAttribute <br />
type="xs:integer">1234567</myIntegerCustomAttribute><br />
<br />
</m2m:fcnt><br />
|}<br />
<br />
<br />
=== Through CSEService OSGi service ===<br />
<br />
<source lang="java" enclose="div" line><br />
// prepare FlexContainer object<br />
FlexContainer toBeUpdated = new FlexContainer();<br />
<br />
CustomAttribute myStringCustomAttribute = new CustomAttribute();<br />
myStringCustomAttribute.setCustomAttributeValue("newStringValue");<br />
myStringCustomAttribute.setCustomAttributeName("myStringCustomAttribute");<br />
myStringCustomAttribute.setCustomAttributeType("xs:string");<br />
toBeUpdated.getCustomAttributes().add(myStringCustomAttribute);<br />
<br />
CustomAttribute myIntegerCustomAttribute = new CustomAttribute();<br />
myIntegerCustomAttribute.setCustomAttributeName("myIntegerCustomAttribute");<br />
myIntegerCustomAttribute.setCustomAttributeType("xs:integer");<br />
myIntegerCustomAttribute.setCustomAttributeValue("1234567");<br />
toBeUpdated.getCustomAttributes().add(myIntegerCustomAttribute);<br />
<br />
// prepare request<br />
RequestPrimitive request = new RequestPrimitive();<br />
request.setContent(toBeUpdated);<br />
request.setFrom(“admin:admin”);<br />
request.setTargetId(“/in-cse/in-name/myFlexContainer”);<br />
// targetId & to parameter could also be “/in-cse/fcnt-953225660”<br />
request.setTo(“/in-cse/in-name/myFlexContainer”);<br />
request.setResourceType(ResourceType.FLEXCONTAINER);<br />
request.setRequestContentType(MimeMediaType.OBJ);<br />
request.setReturnContentType(MimeMediaType.OBJ);<br />
request.setOperation(Operation.UPDATE);<br />
<br />
// execute request<br />
// cseService is an OSGi service retrieved through the OSGi registry<br />
ResponsePrimitive response = cseService.doRequest(request);<br />
<br />
if (response.getResponseStatusCode().equals(ResponseStatusCode.UPDATED)) {<br />
// OK<br />
FlexContainer updatedFlexContainer = (FlexContainer) <br />
response.getContent();<br />
<br />
// use getters of FlexContainer to retrieve FlexContainer fields<br />
<br />
}<br />
<br />
</source><br />
<br />
<br />
<br />
== FlexContainer deletion ==<br />
=== Through HTTP binding ===<br />
==== Request ====<br />
{| class="wikitable"<br />
! HTTP method <br />
| DELETE<br />
|-<br />
! URL<br />
| http://<ip_cse>:<port_cse>/~/in-cse/in-name/myFlexContainer <br/><br />
or <br/><br />
http://<ip_cse>:<port_cse>/~/in-cse/fcnt-953225660 <br />
|-<br />
! Headers<br />
| <br />
{| class="wikitable"<br />
! Name<br />
! Value<br />
! Comments<br />
|-<br />
| X-M2M-Origin<br />
| admin:admin<br />
| Login:password<br />
|}<br />
|}<br />
<br />
An example:<br />
<pre><br />
DELETE /~/in-cse/in-name/myFlexContainer HTTP/1.1<br />
Host: 127.0.0.1:8080<br />
X-M2M-Origin: admin:admin<br />
Cache-Control: no-cache<br />
Postman-Token: 6ff80941-5b77-f0c3-5103-df064bc06b5d<br />
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW<br />
</pre><br />
<br />
==== Response ====<br />
<br />
{| class="wikitable"<br />
! HTTP response code<br />
| 200 OK<br />
|-<br />
! Response body<br />
| No body<br />
|}<br />
<br />
=== Through CSEService OSGi service ===<br />
<br />
<source lang="java" enclose="div" line><br />
// prepare request<br />
RequestPrimitive request = new RequestPrimitive();<br />
request.setTargetId(“/in-cse/in-name/myFlexContainer”);<br />
// targetId & to parameter could also be “/in-cse/fcnt-953225660”<br />
request.setTo(“/in-cse/in-name/myFlexContainer”);<br />
request.setRequestContentType(MimeMediaType.OBJ);<br />
request.setReturnContentType(MimeMediaType.OBJ);<br />
request.setOperation(Operation.DELETE);<br />
<br />
// execute request<br />
ResponsePrimitive response = cseService.doRequest(request);<br />
<br />
// check response<br />
if (response.getResponseStatusCode().equals(ResponseStatusCode.DELETED)) {<br />
// OK<br />
}<br />
</source><br />
<br />
== FlexContainerService ==<br />
A FlexContainerService is an OSGi service attached to a single FlexContainer resource. It is used to retrieve and set value of the custom attributes belonging to a particular FlexContainer.<br />
<br />
If a FlexContainer has no FlexContainerService instance, the customAttribute values are read and set in the database. <br />
<br />
A FlexContainerService has to be registered into the OSGi registry in order to be available to the CSE.<br />
<br />
Example:<br />
<source lang="java" enclose="div" line><br />
// create a flexContainerService<br />
FlexContainerService fcs = new FlexContainerService() {<br />
<br />
@Override<br />
public void setCustomAttributeValues(List<CustomAttribute> customAttributes, <br />
RequestPrimitive requestPrimitive<br />
) throws Om2mException {<br />
// this method is called when the FlexContainer <br />
// associated to this FlexContainerService <br />
// instance is updated.<br />
// put here the business code <br />
// that take into account the new customAttribute<br />
// values<br />
}<br />
<br />
@Override<br />
public String getFlexContainerLocation() {<br />
// this method MUST return the resourceId of the <br />
// attached FlexContainer <br />
return flexContainer.getResourceID();<br />
}<br />
<br />
@Override<br />
public String getCustomAttributeValue(String customAttributeName) throws Om2mException {<br />
// this method is called by the CSE when it <br />
// receive a RETRIEVE request for the attached<br />
// FlexContainer<br />
// this method has to return the value of the <br />
// customAttribute specified by <br />
// customAttributeName argument<br />
return customAttributeValue;<br />
}<br />
<br />
};<br />
<br />
// register FlexContainerService as an OSGi service<br />
flexContainerServiceRegistration = bundleContext.registerService(FlexContainerService.class, fcs, null);<br />
</source></div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/one/FlexContainers&diff=441351OM2M/one/FlexContainers2020-10-23T14:07:14Z<p>Garzone-eclipse.outlook.fr: </p>
<hr />
<div>== FlexContainer description ==<br />
A FlexContainer is a resource similar to a Container. The main difference is the capability of a Flexcontainer to have an extensible set of custom attributes.<br />
[[File:FlexContainerObject.png]]<br />
<br />
A FlexContainer has a containerDefinition attribute that defines the set of custom attributes a Flexcontainer holds. <br />
<br />
More information in section 9.6.35 of TS0001 version 2.10.0<br />
<br />
<br />
== FlexContainer creation ==<br />
=== Through HTTP binding ===<br />
==== Request ====<br />
{| class="wikitable"<br />
! HTTP method <br />
| POST<br />
|-<br />
! URL<br />
| http://<ip_cse>:<port_cse>/~/in-cse/in-name<br />
|-<br />
! Headers<br />
| <br />
{| class="wikitable"<br />
! Name<br />
! Value<br />
! Comments<br />
|-<br />
| X-M2M-Origin<br />
| admin:admin<br />
| Login:password<br />
|-<br />
| X-M2M-NM <br />
| myFlexContainer<br />
| Name of the to-be-created FlexContainer<br />
|-<br />
| Content-Type<br />
| ty=28<br />
| Type of the resource to be created<br />
|- <br />
|}<br />
|-<br />
! Body<br />
| <br />
<pre><br />
<?xml version="1.0" encoding="UTF-8"?> <br />
<m2m:fcnt xmlns:m2m="http://www.onem2m.org/xml/protocols" ><br />
<!-- container Definition is mandatory --><br />
<cnd>org.eclipse.om2m.mydef</cnd><br />
<br />
<!-- some custom attributes --> <br />
<myStringCustomAttribute <br />
type="xs:string">stringValue</myStringCustomAttribute><br><br />
<myIntegerCustomAttribute <br />
type="xs:integer">123</myIntegerCustomAttribute><br><br />
</m2m:fcnt> <br />
</pre><br />
|}<br />
<br />
An example:<br />
<pre><br />
POST /~/in-cse/in-name HTTP/1.1<br />
Host: 127.0.0.1:8080<br />
X-M2M-Origin: admin:admin<br />
X-M2M-NM: myFlexContainer<br />
Content-Type: ty=28<br />
Cache-Control: no-cache<br />
Postman-Token: 965301cf-ade2-a4f2-2b4e-a7b2d8758dca<br />
<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:fcnt xmlns:m2m="http://www.onem2m.org/xml/protocols" ><br />
<br />
<cnd>org.eclipse.om2m.mydef</cnd><br />
<br />
</m2m:fcnt><br />
<br />
</pre><br />
<br />
==== Response ====<br />
<br />
{| class="wikitable"<br />
! HTTP response code<br />
| 201 CREATED<br />
|-<br />
! Response body<br />
|<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:fcnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="'''myFlexContainer'''"><br />
<!-- ty : resource type (28 = flexContainer) --><br />
<ty>28</ty><br />
<br />
<!-- ri = resource identifier --><br />
<ri>/in-cse/fcnt-953225660</ri> <br />
<br />
<!-- pi = parent identifier --><br />
<pi>/in-cse</pi><br />
<br />
<!-- ct = creation time --><br />
<ct>20161221T100447</ct><br />
<br />
<!-- lt = last modified time --><br />
<lt>20161221T100447</lt><br />
<br />
<!-- acpi = Access Control Policy identifiers --><br />
<acpi>/in-cse/acp-34501615</acpi><br />
<br />
<!-- et = expiration time --><br />
<et>20171221T100447</et><br />
<br />
<!--cntDef = container definition --><br />
<cnd>org.eclipse.om2m.mydef</cnd><br />
<br />
< !-- custom attributes --><br />
<myStringCustomAttribute <br />
type="xs:string">stringValue</myStringCustomAttribute><br />
<myIntegerCustomAttribute <br />
type="xs:integer">123</myIntegerCustomAttribute><br />
</m2m:fcnt><br />
|}<br />
<br />
<br />
=== Through CSEService OSGi service ===<br />
<br />
<source lang="java" enclose="div" line><br />
// create a FlexContainer object <br />
FlexContainer flexContainer = new FlexContainer();<br />
flexContainer.setContainerDefinition("org.eclipse.om2m.mydef");<br />
flexContainer.setCreator("Orange");<br />
<br />
// myStringCustomAttribute<br />
CustomAttribute myStringCustomAttribute = new CustomAttribute();<br />
myStringCustomAttribute.setCustomAttributeName("myStringCustomAttribute");<br />
myStringCustomAttribute.setCustomAttributeType("xs:string");<br />
myStringCustomAttribute.setCustomAttributeValue("stringValue");<br />
flexContainer.getCustomAttributes().add(myStringCustomAttribute);<br />
<br />
// myIntegerCustomAttribute<br />
CustomAttribute myIntegerCustomAttribute = new CustomAttribute();<br />
myIntegerCustomAttribute.setCustomAttributeName("myIntegerCustomAttribute");<br />
myIntegerCustomAttribute.setCustomAttributeType("xs:integer");<br />
myIntegerCustomAttribute.setCustomAttributeValue("123");<br />
flexContainer.getCustomAttributes().add(myIntegerCustomAttribute);<br />
<br />
// prepare request<br />
RequestPrimitive request = new RequestPrimitive();<br />
request.setContent(flexContainer);<br />
request.setFrom(“admin:admin”);<br />
request.setTargetId(“/in-cse/in-name”);<br />
request.setTo(“/in-cse/in-name”);<br />
request.setResourceType(ResourceType.FLEXCONTAINER);<br />
request.setRequestContentType(MimeMediaType.OBJ);<br />
request.setReturnContentType(MimeMediaType.OBJ);<br />
request.setName(“myFlexContainer”);<br />
request.setOperation(Operation.CREATE);<br />
<br />
// execute request<br />
// cseService is an OSGi service registered by the CSE<br />
// cseService implements org.eclipse.om2m.core.service.CseService<br />
ResponsePrimitive response = cseService.doRequest(request);<br />
<br />
// check response<br />
if (response.getResponseStatusCode().equals(ResponseStatusCode.CREATED)) {<br />
// OK<br />
FlexContainer responseCreatedFlexContainer = (FlexContainer) response.getContent();<br />
<br />
// use getters of FlexContainer to retrieve FlexContainer fields<br />
}<br />
</source><br />
<br />
<br />
== FlexContainer retrieving ==<br />
=== Through HTTP binding ===<br />
==== Request ====<br />
{| class="wikitable"<br />
! HTTP method <br />
| GET<br />
|-<br />
! URL<br />
| http://<ip_cse>:<port_cse>/~/in-cse/in-name/myFlexContainer <br/><br />
or <br/><br />
http://<ip_cse>:<port_cse>/~/in-cse/fcnt-953225660 <br />
|-<br />
! Headers<br />
| <br />
{| class="wikitable"<br />
! Name<br />
! Value<br />
! Comments<br />
|-<br />
| X-M2M-Origin<br />
| admin:admin<br />
| Login:password<br />
|}<br />
|}<br />
<br />
An example:<br />
<pre><br />
GET /~/in-cse/in-name/myFlexContainer HTTP/1.1<br />
Host: 127.0.0.1:8080<br />
X-M2M-Origin: admin:admin<br />
Cache-Control: no-cache<br />
Postman-Token: 51dc4ccf-72df-a479-880b-891118112665<br />
</pre><br />
<br />
==== Response ====<br />
<br />
{| class="wikitable"<br />
! HTTP response code<br />
| 200 OK<br />
|-<br />
! Response body<br />
|<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:fcnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="myFlexContainer"><br />
<br />
<!-- ty : resource type (28 = flexContainer) --><br />
<ty>28</ty><br />
<br />
<!-- ri = resource identifier --><br />
<ri>/in-cse/fcnt-491936033</ri><br />
<br />
<!-- pi = parent identifier --><br />
<pi>/in-cse</pi><br />
<br />
<!-- ct = creation time --><br />
<ct>20161221T102226</ct><br />
<br />
<!-- lt = last modified time --><br />
<lt>20161221T102226</lt><br />
<!-- acpi = Access Control Policy identifiers --><br />
<acpi>/in-cse/acp-34501615</acpi><br />
<br />
<!-- et = expiration time --><br />
<et>20171221T102226</et><br />
<br />
<!--cntDef = container definition --><br />
<cnd>org.eclipse.om2m.mydef</cnd><br />
<br />
<!-- custom attributes --><br />
<myStringCustomAttribute <br />
type="xs:string">stringValue</myStringCustomAttribute><br />
<myIntegerCustomAttribute <br />
type="xs:integer">123</myIntegerCustomAttribute><br />
</m2m:fcnt><br />
<br />
|}<br />
<br />
<br />
=== Through CSEService OSGi service ===<br />
<br />
<source lang="java" enclose="div" line><br />
// prepare request<br />
RequestPrimitive request = new RequestPrimitive();<br />
request.setFrom(“admin:admin”);<br />
<br />
request.setTargetId(“/in-cse/in-name/myFlexContainer”);<br />
// targetId could also be “/in-cse/fcnt-491936033”<br />
request.setTo(“/in-cse/in-name/myFlexContainer”););<br />
request.setRequestContentType(MimeMediaType.OBJ);<br />
request.setReturnContentType(MimeMediaType.OBJ);<br />
request.setOperation(Operation.RETRIEVE);<br />
<br />
// several ResultContent type possibles <br />
request.setResultContent(ResultContent.ATTRIBUTES_AND_CHILD_REF);<br />
<br />
// execute request<br />
ResponsePrimitive response = cseService.doRequest(request);<br />
<br />
if (response.getResponseStatusCode().equals(ResponseStatusCode.OK)) {<br />
// OK<br />
FlexContainer responseCreatedFlexContainer = (FlexContainer) response.getContent();<br />
<br />
// use getters of FlexContainer to retrieve FlexContainer fields<br />
responseCreatedFlexContainer.getName();<br />
responseCreatedFlexContainer.getContainerDefinition();<br />
…<br />
}<br />
<br />
</source><br />
<br />
<br />
<br />
== FlexContainer update ==<br />
=== Through HTTP binding ===<br />
==== Request ====<br />
{| class="wikitable"<br />
! HTTP method <br />
| PUT<br />
|-<br />
! URL<br />
| http://<ip_cse>:<port_cse>/~/in-cse/in-name/myFlexContainer <br/><br />
or <br/><br />
http://<ip_cse>:<port_cse>/~/in-cse/fcnt-953225660 <br />
|-<br />
! Headers<br />
| <br />
{| class="wikitable"<br />
! Name<br />
! Value<br />
! Comments<br />
|-<br />
| X-M2M-Origin<br />
| admin:admin<br />
| Login:password<br />
|}<br />
|-<br />
! Body<br />
| <br />
<pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:fcnt xmlns:m2m="http://www.onem2m.org/xml/protocols" ><br />
<br />
<!-- acpi field is updatable --><br />
<!-- other fields except custom attribute fields are not updatable --><br />
<br />
<!-- custom attribute fields are updatable --><br />
<myStringCustomAttribute <br />
type="xs:string">newStringValue</myStringCustomAttribute><br />
<myIntegerCustomAttribute <br />
type="xs:integer">1234567</myIntegerCustomAttribute><br />
</m2m:fcnt><br />
<br />
</pre><br />
|}<br />
<br />
An example:<br />
<pre><br />
PUT /~/in-cse/in-name/myFlexContainer HTTP/1.1<br />
Host: 127.0.0.1:8080<br />
X-M2M-Origin: admin:admin<br />
Cache-Control: no-cache<br />
Postman-Token: d05b77ed-f1bd-4edc-fc26-c79a49f9c7de<br />
<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:fcnt xmlns:m2m="http://www.onem2m.org/xml/protocols" ><br />
<!-- only custom attribute fields are updatable --><br />
<myStringCustomAttribute <br />
type="xs:string">newStringValue</myStringCustomAttribute><br />
<myIntegerCustomAttribute <br />
type="xs:integer">1234567</myIntegerCustomAttribute><br />
</m2m:fcnt><br />
<br />
</pre><br />
<br />
==== Response ====<br />
<br />
{| class="wikitable"<br />
! HTTP response code<br />
| 200 OK<br />
|-<br />
! Response body<br />
|<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:fcnt xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<br />
<!-- lt = last modified time --><br />
<lt>20161221T113042</lt><br />
<br />
<!-- custom Attributes --><br />
<myStringCustomAttribute <br />
type="xs:string">newStringValue</myStringCustomAttribute><br />
<myIntegerCustomAttribute <br />
type="xs:integer">1234567</myIntegerCustomAttribute><br />
<br />
</m2m:fcnt><br />
|}<br />
<br />
<br />
=== Through CSEService OSGi service ===<br />
<br />
<source lang="java" enclose="div" line><br />
// prepare FlexContainer object<br />
FlexContainer toBeUpdated = new FlexContainer();<br />
<br />
CustomAttribute myStringCustomAttribute = new CustomAttribute();<br />
myStringCustomAttribute.setCustomAttributeValue("newStringValue");<br />
myStringCustomAttribute.setCustomAttributeName("myStringCustomAttribute");<br />
myStringCustomAttribute.setCustomAttributeType("xs:string");<br />
toBeUpdated.getCustomAttributes().add(myStringCustomAttribute);<br />
<br />
CustomAttribute myIntegerCustomAttribute = new CustomAttribute();<br />
myIntegerCustomAttribute.setCustomAttributeName("myIntegerCustomAttribute");<br />
myIntegerCustomAttribute.setCustomAttributeType("xs:integer");<br />
myIntegerCustomAttribute.setCustomAttributeValue("1234567");<br />
toBeUpdated.getCustomAttributes().add(myIntegerCustomAttribute);<br />
<br />
// prepare request<br />
RequestPrimitive request = new RequestPrimitive();<br />
request.setContent(toBeUpdated);<br />
request.setFrom(“admin:admin”);<br />
request.setTargetId(“/in-cse/in-name/myFlexContainer”);<br />
// targetId & to parameter could also be “/in-cse/fcnt-953225660”<br />
request.setTo(“/in-cse/in-name/myFlexContainer”);<br />
request.setResourceType(ResourceType.FLEXCONTAINER);<br />
request.setRequestContentType(MimeMediaType.OBJ);<br />
request.setReturnContentType(MimeMediaType.OBJ);<br />
request.setOperation(Operation.UPDATE);<br />
<br />
// execute request<br />
// cseService is an OSGi service retrieved through the OSGi registry<br />
ResponsePrimitive response = cseService.doRequest(request);<br />
<br />
if (response.getResponseStatusCode().equals(ResponseStatusCode.UPDATED)) {<br />
// OK<br />
FlexContainer updatedFlexContainer = (FlexContainer) <br />
response.getContent();<br />
<br />
// use getters of FlexContainer to retrieve FlexContainer fields<br />
<br />
}<br />
<br />
</source><br />
<br />
<br />
<br />
== FlexContainer deletion ==<br />
=== Through HTTP binding ===<br />
==== Request ====<br />
{| class="wikitable"<br />
! HTTP method <br />
| DELETE<br />
|-<br />
! URL<br />
| http://<ip_cse>:<port_cse>/~/in-cse/in-name/myFlexContainer <br/><br />
or <br/><br />
http://<ip_cse>:<port_cse>/~/in-cse/fcnt-953225660 <br />
|-<br />
! Headers<br />
| <br />
{| class="wikitable"<br />
! Name<br />
! Value<br />
! Comments<br />
|-<br />
| X-M2M-Origin<br />
| admin:admin<br />
| Login:password<br />
|}<br />
|}<br />
<br />
An example:<br />
<pre><br />
DELETE /~/in-cse/in-name/myFlexContainer HTTP/1.1<br />
Host: 127.0.0.1:8080<br />
X-M2M-Origin: admin:admin<br />
Cache-Control: no-cache<br />
Postman-Token: 6ff80941-5b77-f0c3-5103-df064bc06b5d<br />
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW<br />
</pre><br />
<br />
==== Response ====<br />
<br />
{| class="wikitable"<br />
! HTTP response code<br />
| 200 OK<br />
|-<br />
! Response body<br />
| No body<br />
|}<br />
<br />
=== Through CSEService OSGi service ===<br />
<br />
<source lang="java" enclose="div" line><br />
// prepare request<br />
RequestPrimitive request = new RequestPrimitive();<br />
request.setTargetId(“/in-cse/in-name/myFlexContainer”);<br />
// targetId & to parameter could also be “/in-cse/fcnt-953225660”<br />
request.setTo(“/in-cse/in-name/myFlexContainer”);<br />
request.setRequestContentType(MimeMediaType.OBJ);<br />
request.setReturnContentType(MimeMediaType.OBJ);<br />
request.setOperation(Operation.DELETE);<br />
<br />
// execute request<br />
ResponsePrimitive response = cseService.doRequest(request);<br />
<br />
// check response<br />
if (response.getResponseStatusCode().equals(ResponseStatusCode.DELETED)) {<br />
// OK<br />
}<br />
</source><br />
<br />
== FlexContainerService ==<br />
A FlexContainerService is an OSGi service attached to a single FlexContainer resource. It is used to retrieve and set value of the custom attributes belonging to a particular FlexContainer.<br />
<br />
If a FlexContainer has no FlexContainerService instance, the customAttribute values are read and set in the database. <br />
<br />
A FlexContainerService has to be registered into the OSGi registry in order to be available to the CSE.<br />
<br />
Example:<br />
<source lang="java" enclose="div" line><br />
// create a flexContainerService<br />
FlexContainerService fcs = new FlexContainerService() {<br />
<br />
@Override<br />
public void setCustomAttributeValues(List<CustomAttribute> customAttributes, <br />
RequestPrimitive requestPrimitive<br />
) throws Om2mException {<br />
// this method is called when the FlexContainer <br />
// associated to this FlexContainerService <br />
// instance is updated.<br />
// put here the business code <br />
// that take into account the new customAttribute<br />
// values<br />
}<br />
<br />
@Override<br />
public String getFlexContainerLocation() {<br />
// this method MUST return the resourceId of the <br />
// attached FlexContainer <br />
return flexContainer.getResourceID();<br />
}<br />
<br />
@Override<br />
public String getCustomAttributeValue(String customAttributeName) throws Om2mException {<br />
// this method is called by the CSE when it <br />
// receive a RETRIEVE request for the attached<br />
// FlexContainer<br />
// this method has to return the value of the <br />
// customAttribute specified by <br />
// customAttributeName argument<br />
return customAttributeValue;<br />
}<br />
<br />
};<br />
<br />
// register FlexContainerService as an OSGi service<br />
flexContainerServiceRegistration = bundleContext.registerService(FlexContainerService.class, fcs, null);<br />
</source></div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/one/FlexContainers&diff=441350OM2M/one/FlexContainers2020-10-23T14:05:44Z<p>Garzone-eclipse.outlook.fr: </p>
<hr />
<div>== FlexContainer description ==<br />
A FlexContainer is a resource similar to a Container. The main difference is the capability of a Flexcontainer to have an extensible set of custom attributes.<br />
[[File:FlexContainerObject.png]]<br />
<br />
A FlexContainer has a containerDefinition attribute that defines the set of custom attributes a Flexcontainer holds. <br />
<br />
More information in section 9.6.35 of TS0001 version 2.10.0<br />
<br />
<br />
== FlexContainer creation ==<br />
=== Through HTTP binding ===<br />
==== Request ====<br />
{| class="wikitable"<br />
! HTTP method <br />
| POST<br />
|-<br />
! URL<br />
| http://<ip_cse>:<port_cse>/~/in-cse/in-name<br />
|-<br />
! Headers<br />
| <br />
{| class="wikitable"<br />
! Name<br />
! Value<br />
! Comments<br />
|-<br />
| X-M2M-Origin<br />
| admin:admin<br />
| Login:password<br />
|-<br />
| X-M2M-NM <br />
| myFlexContainer<br />
| Name of the to-be-created FlexContainer<br />
|-<br />
| Content-Type<br />
| ty=28<br />
| Type of the resource to be created<br />
|- <br />
|}<br />
|-<br />
! Body<br />
| <br />
<pre><br />
<?xml version="1.0" encoding="UTF-8"?> <br />
<m2m:fcnt xmlns:m2m="http://www.onem2m.org/xml/protocols" ><br />
<!-- container Definition is mandatory --><br />
<cnd>org.eclipse.om2m.mydef</cnd> <br><br />
<br />
<!-- some custom attributes --> <br />
<myStringCustomAttribute <br />
type="xs:string">stringValue</myStringCustomAttribute><br><br />
<myIntegerCustomAttribute <br />
type="xs:integer">123</myIntegerCustomAttribute><br><br />
</m2m:fcnt> <br />
</pre><br />
|}<br />
<br />
An example:<br />
<pre><br />
POST /~/in-cse/in-name HTTP/1.1<br />
Host: 127.0.0.1:8080<br />
X-M2M-Origin: admin:admin<br />
X-M2M-NM: myFlexContainer<br />
Content-Type: ty=28<br />
Cache-Control: no-cache<br />
Postman-Token: 965301cf-ade2-a4f2-2b4e-a7b2d8758dca<br />
<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:fcnt xmlns:m2m="http://www.onem2m.org/xml/protocols" ><br />
<br />
<cnd>org.eclipse.om2m.mydef</cnd><br />
<br />
</m2m:fcnt><br />
<br />
</pre><br />
<br />
==== Response ====<br />
<br />
{| class="wikitable"<br />
! HTTP response code<br />
| 201 CREATED<br />
|-<br />
! Response body<br />
|<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:fcnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="'''myFlexContainer'''"><br />
<!-- ty : resource type (28 = flexContainer) --><br />
<ty>28</ty><br />
<br />
<!-- ri = resource identifier --><br />
<ri>/in-cse/fcnt-953225660</ri> <br />
<br />
<!-- pi = parent identifier --><br />
<pi>/in-cse</pi><br />
<br />
<!-- ct = creation time --><br />
<ct>20161221T100447</ct><br />
<br />
<!-- lt = last modified time --><br />
<lt>20161221T100447</lt><br />
<br />
<!-- acpi = Access Control Policy identifiers --><br />
<acpi>/in-cse/acp-34501615</acpi><br />
<br />
<!-- et = expiration time --><br />
<et>20171221T100447</et><br />
<br />
<!--cntDef = container definition --><br />
<cnd>org.eclipse.om2m.mydef</cnd><br />
<br />
< !-- custom attributes --><br />
<myStringCustomAttribute <br />
type="xs:string">stringValue</myStringCustomAttribute><br />
<myIntegerCustomAttribute <br />
type="xs:integer">123</myIntegerCustomAttribute><br />
</m2m:fcnt><br />
|}<br />
<br />
<br />
=== Through CSEService OSGi service ===<br />
<br />
<source lang="java" enclose="div" line><br />
// create a FlexContainer object <br />
FlexContainer flexContainer = new FlexContainer();<br />
flexContainer.setContainerDefinition("org.eclipse.om2m.mydef");<br />
flexContainer.setCreator("Orange");<br />
<br />
// myStringCustomAttribute<br />
CustomAttribute myStringCustomAttribute = new CustomAttribute();<br />
myStringCustomAttribute.setCustomAttributeName("myStringCustomAttribute");<br />
myStringCustomAttribute.setCustomAttributeType("xs:string");<br />
myStringCustomAttribute.setCustomAttributeValue("stringValue");<br />
flexContainer.getCustomAttributes().add(myStringCustomAttribute);<br />
<br />
// myIntegerCustomAttribute<br />
CustomAttribute myIntegerCustomAttribute = new CustomAttribute();<br />
myIntegerCustomAttribute.setCustomAttributeName("myIntegerCustomAttribute");<br />
myIntegerCustomAttribute.setCustomAttributeType("xs:integer");<br />
myIntegerCustomAttribute.setCustomAttributeValue("123");<br />
flexContainer.getCustomAttributes().add(myIntegerCustomAttribute);<br />
<br />
// prepare request<br />
RequestPrimitive request = new RequestPrimitive();<br />
request.setContent(flexContainer);<br />
request.setFrom(“admin:admin”);<br />
request.setTargetId(“/in-cse/in-name”);<br />
request.setTo(“/in-cse/in-name”);<br />
request.setResourceType(ResourceType.FLEXCONTAINER);<br />
request.setRequestContentType(MimeMediaType.OBJ);<br />
request.setReturnContentType(MimeMediaType.OBJ);<br />
request.setName(“myFlexContainer”);<br />
request.setOperation(Operation.CREATE);<br />
<br />
// execute request<br />
// cseService is an OSGi service registered by the CSE<br />
// cseService implements org.eclipse.om2m.core.service.CseService<br />
ResponsePrimitive response = cseService.doRequest(request);<br />
<br />
// check response<br />
if (response.getResponseStatusCode().equals(ResponseStatusCode.CREATED)) {<br />
// OK<br />
FlexContainer responseCreatedFlexContainer = (FlexContainer) response.getContent();<br />
<br />
// use getters of FlexContainer to retrieve FlexContainer fields<br />
}<br />
</source><br />
<br />
<br />
== FlexContainer retrieving ==<br />
=== Through HTTP binding ===<br />
==== Request ====<br />
{| class="wikitable"<br />
! HTTP method <br />
| GET<br />
|-<br />
! URL<br />
| http://<ip_cse>:<port_cse>/~/in-cse/in-name/myFlexContainer <br/><br />
or <br/><br />
http://<ip_cse>:<port_cse>/~/in-cse/fcnt-953225660 <br />
|-<br />
! Headers<br />
| <br />
{| class="wikitable"<br />
! Name<br />
! Value<br />
! Comments<br />
|-<br />
| X-M2M-Origin<br />
| admin:admin<br />
| Login:password<br />
|}<br />
|}<br />
<br />
An example:<br />
<pre><br />
GET /~/in-cse/in-name/myFlexContainer HTTP/1.1<br />
Host: 127.0.0.1:8080<br />
X-M2M-Origin: admin:admin<br />
Cache-Control: no-cache<br />
Postman-Token: 51dc4ccf-72df-a479-880b-891118112665<br />
</pre><br />
<br />
==== Response ====<br />
<br />
{| class="wikitable"<br />
! HTTP response code<br />
| 200 OK<br />
|-<br />
! Response body<br />
|<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:fcnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="myFlexContainer"><br />
<br />
<!-- ty : resource type (28 = flexContainer) --><br />
<ty>28</ty><br />
<br />
<!-- ri = resource identifier --><br />
<ri>/in-cse/fcnt-491936033</ri><br />
<br />
<!-- pi = parent identifier --><br />
<pi>/in-cse</pi><br />
<br />
<!-- ct = creation time --><br />
<ct>20161221T102226</ct><br />
<br />
<!-- lt = last modified time --><br />
<lt>20161221T102226</lt><br />
<!-- acpi = Access Control Policy identifiers --><br />
<acpi>/in-cse/acp-34501615</acpi><br />
<br />
<!-- et = expiration time --><br />
<et>20171221T102226</et><br />
<br />
<!--cntDef = container definition --><br />
<cnd>org.eclipse.om2m.mydef</cnd><br />
<br />
<!-- custom attributes --><br />
<myStringCustomAttribute <br />
type="xs:string">stringValue</myStringCustomAttribute><br />
<myIntegerCustomAttribute <br />
type="xs:integer">123</myIntegerCustomAttribute><br />
</m2m:fcnt><br />
<br />
|}<br />
<br />
<br />
=== Through CSEService OSGi service ===<br />
<br />
<source lang="java" enclose="div" line><br />
// prepare request<br />
RequestPrimitive request = new RequestPrimitive();<br />
request.setFrom(“admin:admin”);<br />
<br />
request.setTargetId(“/in-cse/in-name/myFlexContainer”);<br />
// targetId could also be “/in-cse/fcnt-491936033”<br />
request.setTo(“/in-cse/in-name/myFlexContainer”););<br />
request.setRequestContentType(MimeMediaType.OBJ);<br />
request.setReturnContentType(MimeMediaType.OBJ);<br />
request.setOperation(Operation.RETRIEVE);<br />
<br />
// several ResultContent type possibles <br />
request.setResultContent(ResultContent.ATTRIBUTES_AND_CHILD_REF);<br />
<br />
// execute request<br />
ResponsePrimitive response = cseService.doRequest(request);<br />
<br />
if (response.getResponseStatusCode().equals(ResponseStatusCode.OK)) {<br />
// OK<br />
FlexContainer responseCreatedFlexContainer = (FlexContainer) response.getContent();<br />
<br />
// use getters of FlexContainer to retrieve FlexContainer fields<br />
responseCreatedFlexContainer.getName();<br />
responseCreatedFlexContainer.getContainerDefinition();<br />
…<br />
}<br />
<br />
</source><br />
<br />
<br />
<br />
== FlexContainer update ==<br />
=== Through HTTP binding ===<br />
==== Request ====<br />
{| class="wikitable"<br />
! HTTP method <br />
| PUT<br />
|-<br />
! URL<br />
| http://<ip_cse>:<port_cse>/~/in-cse/in-name/myFlexContainer <br/><br />
or <br/><br />
http://<ip_cse>:<port_cse>/~/in-cse/fcnt-953225660 <br />
|-<br />
! Headers<br />
| <br />
{| class="wikitable"<br />
! Name<br />
! Value<br />
! Comments<br />
|-<br />
| X-M2M-Origin<br />
| admin:admin<br />
| Login:password<br />
|}<br />
|-<br />
! Body<br />
| <br />
<pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:fcnt xmlns:m2m="http://www.onem2m.org/xml/protocols" ><br />
<br />
<!-- acpi field is updatable --><br />
<!-- other fields except custom attribute fields are not updatable --><br />
<br />
<!-- custom attribute fields are updatable --><br />
<myStringCustomAttribute <br />
type="xs:string">newStringValue</myStringCustomAttribute><br />
<myIntegerCustomAttribute <br />
type="xs:integer">1234567</myIntegerCustomAttribute><br />
</m2m:fcnt><br />
<br />
</pre><br />
|}<br />
<br />
An example:<br />
<pre><br />
PUT /~/in-cse/in-name/myFlexContainer HTTP/1.1<br />
Host: 127.0.0.1:8080<br />
X-M2M-Origin: admin:admin<br />
Cache-Control: no-cache<br />
Postman-Token: d05b77ed-f1bd-4edc-fc26-c79a49f9c7de<br />
<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:fcnt xmlns:m2m="http://www.onem2m.org/xml/protocols" ><br />
<!-- only custom attribute fields are updatable --><br />
<myStringCustomAttribute <br />
type="xs:string">newStringValue</myStringCustomAttribute><br />
<myIntegerCustomAttribute <br />
type="xs:integer">1234567</myIntegerCustomAttribute><br />
</m2m:fcnt><br />
<br />
</pre><br />
<br />
==== Response ====<br />
<br />
{| class="wikitable"<br />
! HTTP response code<br />
| 200 OK<br />
|-<br />
! Response body<br />
|<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:fcnt xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<br />
<!-- lt = last modified time --><br />
<lt>20161221T113042</lt><br />
<br />
<!-- custom Attributes --><br />
<myStringCustomAttribute <br />
type="xs:string">newStringValue</myStringCustomAttribute><br />
<myIntegerCustomAttribute <br />
type="xs:integer">1234567</myIntegerCustomAttribute><br />
<br />
</m2m:fcnt><br />
|}<br />
<br />
<br />
=== Through CSEService OSGi service ===<br />
<br />
<source lang="java" enclose="div" line><br />
// prepare FlexContainer object<br />
FlexContainer toBeUpdated = new FlexContainer();<br />
<br />
CustomAttribute myStringCustomAttribute = new CustomAttribute();<br />
myStringCustomAttribute.setCustomAttributeValue("newStringValue");<br />
myStringCustomAttribute.setCustomAttributeName("myStringCustomAttribute");<br />
myStringCustomAttribute.setCustomAttributeType("xs:string");<br />
toBeUpdated.getCustomAttributes().add(myStringCustomAttribute);<br />
<br />
CustomAttribute myIntegerCustomAttribute = new CustomAttribute();<br />
myIntegerCustomAttribute.setCustomAttributeName("myIntegerCustomAttribute");<br />
myIntegerCustomAttribute.setCustomAttributeType("xs:integer");<br />
myIntegerCustomAttribute.setCustomAttributeValue("1234567");<br />
toBeUpdated.getCustomAttributes().add(myIntegerCustomAttribute);<br />
<br />
// prepare request<br />
RequestPrimitive request = new RequestPrimitive();<br />
request.setContent(toBeUpdated);<br />
request.setFrom(“admin:admin”);<br />
request.setTargetId(“/in-cse/in-name/myFlexContainer”);<br />
// targetId & to parameter could also be “/in-cse/fcnt-953225660”<br />
request.setTo(“/in-cse/in-name/myFlexContainer”);<br />
request.setResourceType(ResourceType.FLEXCONTAINER);<br />
request.setRequestContentType(MimeMediaType.OBJ);<br />
request.setReturnContentType(MimeMediaType.OBJ);<br />
request.setOperation(Operation.UPDATE);<br />
<br />
// execute request<br />
// cseService is an OSGi service retrieved through the OSGi registry<br />
ResponsePrimitive response = cseService.doRequest(request);<br />
<br />
if (response.getResponseStatusCode().equals(ResponseStatusCode.UPDATED)) {<br />
// OK<br />
FlexContainer updatedFlexContainer = (FlexContainer) <br />
response.getContent();<br />
<br />
// use getters of FlexContainer to retrieve FlexContainer fields<br />
<br />
}<br />
<br />
</source><br />
<br />
<br />
<br />
== FlexContainer deletion ==<br />
=== Through HTTP binding ===<br />
==== Request ====<br />
{| class="wikitable"<br />
! HTTP method <br />
| DELETE<br />
|-<br />
! URL<br />
| http://<ip_cse>:<port_cse>/~/in-cse/in-name/myFlexContainer <br/><br />
or <br/><br />
http://<ip_cse>:<port_cse>/~/in-cse/fcnt-953225660 <br />
|-<br />
! Headers<br />
| <br />
{| class="wikitable"<br />
! Name<br />
! Value<br />
! Comments<br />
|-<br />
| X-M2M-Origin<br />
| admin:admin<br />
| Login:password<br />
|}<br />
|}<br />
<br />
An example:<br />
<pre><br />
DELETE /~/in-cse/in-name/myFlexContainer HTTP/1.1<br />
Host: 127.0.0.1:8080<br />
X-M2M-Origin: admin:admin<br />
Cache-Control: no-cache<br />
Postman-Token: 6ff80941-5b77-f0c3-5103-df064bc06b5d<br />
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW<br />
</pre><br />
<br />
==== Response ====<br />
<br />
{| class="wikitable"<br />
! HTTP response code<br />
| 200 OK<br />
|-<br />
! Response body<br />
| No body<br />
|}<br />
<br />
=== Through CSEService OSGi service ===<br />
<br />
<source lang="java" enclose="div" line><br />
// prepare request<br />
RequestPrimitive request = new RequestPrimitive();<br />
request.setTargetId(“/in-cse/in-name/myFlexContainer”);<br />
// targetId & to parameter could also be “/in-cse/fcnt-953225660”<br />
request.setTo(“/in-cse/in-name/myFlexContainer”);<br />
request.setRequestContentType(MimeMediaType.OBJ);<br />
request.setReturnContentType(MimeMediaType.OBJ);<br />
request.setOperation(Operation.DELETE);<br />
<br />
// execute request<br />
ResponsePrimitive response = cseService.doRequest(request);<br />
<br />
// check response<br />
if (response.getResponseStatusCode().equals(ResponseStatusCode.DELETED)) {<br />
// OK<br />
}<br />
</source><br />
<br />
== FlexContainerService ==<br />
A FlexContainerService is an OSGi service attached to a single FlexContainer resource. It is used to retrieve and set value of the custom attributes belonging to a particular FlexContainer.<br />
<br />
If a FlexContainer has no FlexContainerService instance, the customAttribute values are read and set in the database. <br />
<br />
A FlexContainerService has to be registered into the OSGi registry in order to be available to the CSE.<br />
<br />
Example:<br />
<source lang="java" enclose="div" line><br />
// create a flexContainerService<br />
FlexContainerService fcs = new FlexContainerService() {<br />
<br />
@Override<br />
public void setCustomAttributeValues(List<CustomAttribute> customAttributes, <br />
RequestPrimitive requestPrimitive<br />
) throws Om2mException {<br />
// this method is called when the FlexContainer <br />
// associated to this FlexContainerService <br />
// instance is updated.<br />
// put here the business code <br />
// that take into account the new customAttribute<br />
// values<br />
}<br />
<br />
@Override<br />
public String getFlexContainerLocation() {<br />
// this method MUST return the resourceId of the <br />
// attached FlexContainer <br />
return flexContainer.getResourceID();<br />
}<br />
<br />
@Override<br />
public String getCustomAttributeValue(String customAttributeName) throws Om2mException {<br />
// this method is called by the CSE when it <br />
// receive a RETRIEVE request for the attached<br />
// FlexContainer<br />
// this method has to return the value of the <br />
// customAttribute specified by <br />
// customAttributeName argument<br />
return customAttributeValue;<br />
}<br />
<br />
};<br />
<br />
// register FlexContainerService as an OSGi service<br />
flexContainerServiceRegistration = bundleContext.registerService(FlexContainerService.class, fcs, null);<br />
</source></div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/Roadmap&diff=440980OM2M/Roadmap2020-09-25T15:24:39Z<p>Garzone-eclipse.outlook.fr: /* Features */</p>
<hr />
<div>This page describes the current plan for the upcoming features of the OM2M project.<br />
<br />
Please note that this roadmap is a moving target. Depending on priorities and community contribution, the roadmap can change any time, so do not take it for granted, but see it as a guidance of direction.<br />
<br />
<br />
== Release 1.4.0 (Aug. 05, 2020) ==<br />
=== Features ===<br />
Eclipse OM2M 1.4.0 offers the following features:<br />
* Implementation of Dynamic Authorization features as defined to oneM2M standard.<br />
* Add SDT new modules and devices<br />
* SDT bug fixing<br />
* Memory usage enhancements<br />
* New unit tests<br />
=== Minor updates ===<br />
* Update to EPL 2.0<br />
<br />
== Release 1.3.0 (March 13, 2018)==<br />
<br />
=== Features ===<br />
This release provides the following updates and new features:<br />
* oneM2M java clients<br />
* oneM2M javascript clients<br />
* oneM2M arduino clients<br />
* ManagementObject :<br />
** Announcement<br />
** Persistence<br />
** Add new Management Object<br />
** Use DeviceInfo Management Object in SDT IPE<br />
<br />
=== Fixed bugs ===<br />
* FlexContainers<br />
** Remove unused XmlSeeAlso annotation into FlexContainers<br />
** Fix deviceSwitchButton device short name <br />
* Discovery with multiple labels<br />
<br />
== Release 1.2.0 (January 04, 2018) ==<br />
=== Features ===<br />
This release provides the following updates and new features:<br />
* android.dashboard: initial import<br />
* build MN-CSE & IN-CSE docker image<br />
* mocked sdt devices : add Thermometer, SwitchButton, NumberValue<br />
* sdt.app.homemonitoring:<br />
** disable switch button in case of readOnly SDT module<br />
** highlight values on notification<br />
<br />
=== Fixed bugs ===<br />
The following bugs are fixed:<br />
* all: <br />
** fix UTF8 character encoding issue<br />
** remove RequestPrimitive's targetId field<br />
* persistence.mongodb: <br />
** implement missing DAO<br />
** fix issue on Container persistence<br />
* announcement : fix issue regarding Container announcement<br />
* commons: fix announcement issue<br />
* datamapping.jaxb: log enhancement.<br />
* sdt.app.homemonitoring: fix authentication issue<br />
* sdt.home.netatmo : fix naming issue<br />
* sdt.app.comparator :fix rendering issue<br />
* Resource browser:Fix rendering issue <br />
* [Bug 526616] Update ol attribute of container correctly<br />
* Fix Bug 522099 on discovery with label filter<br />
<br />
== Release 1.1.0 (October 09, 2017) ==<br />
=== Features ===<br />
This release provides the following updates and new features: <br />
* oneM2M release 2 support<br />
* MQTT communication binding<br />
* NoSQL MongoDB storage<br />
* Smart Device Template (SDT)<br />
* FlexContainer resource<br />
* Dynamic Authorization<br />
* Resource Announcement<br />
* Enocean interworking<br />
* Hue interworking<br />
* Netatmo interworking<br />
* SmarterCoffee interworking<br />
* LIFX interworking<br />
* OSGi DAL (Device Abstraction Layer) interworking<br />
* Several test suites<br />
<br />
=== Tutorials ===<br />
Several tutorials already proposed to explain how to use the new features developed in this release:<br />
* How to use oneM2M MQTT binding<br />
* Develop oneM2M applications<br />
* Develop an Interworking Proxy Plugin<br />
* Develop an Interworking Proxy Application Entity (IPE) Plugin with SDT<br />
* Developing with FlexContainers<br />
* Change database config.<br />
* Integrate OSGi DAL devices into OM2M by using DAL IPE Plugin<br />
Check our wiki: https://wiki.eclipse.org/OM2M/one<br />
<br />
=== Fixed bugs ===<br />
The following bugs are fixed:<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=501266 Bug 501266] - ACP automatically created when an AE is created dosn't have ty=1<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=498911 Bug 498911] - Error in Access Right verification for PoA notification<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=498387 Bug 498387] - Smart Device Template (SDT) support<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=498374 Bug 498374] - FlexContainer feature support<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=497579 Bug 497579] - Unwanted deletion of AEs having the name of the wanted deleted AE as a prefix<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=495606 Bug 495606] - Error on creating ContentInstance with maxNumberOfInstance in Container<br />
<br />
== Release 1.0.0 (June 22, 2016) ==<br />
=== Features ===<br />
Implementation of the oneM2M standard. For more information see [http://www.onem2m.org/ oneM2M standard].<br />
<br />
Main supported features:<br />
<br />
* Nodes: IN-CSE, MN-CSE, ASN-CSE, and ADN.<br />
* Reference Points: MCA, and MCC.<br />
* Resource types: CSEBase, RemoteCSE, ACP, AE, Container, ContentInstance, Subscription, Group, Node, Request, PoA, etc.<br />
* Request primitives: Retrieve, Create, Update, Delete, and Notify.<br />
* Addressing formats: Structured and Unstructured. <br />
* Addressing modes: Absolute, SP-relative, and CSE-Relative.<br />
* Protocol Bindings: HTTP and CoAP.<br />
* Content Formats: XML and JSON.<br />
* Communication Modes: Blocking, Non Blocking Syhcnronous, and Non Blocking Asynchrnonous.<br />
* Multihop: retargeting via PoA.<br />
* Storage mode: SQL and NoSQL (SQL H2 by default)<br />
* Security: SSL/TLS<br />
<br />
=== Fixed bugs ===<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=494086 Bug 494086] - Top level node in JSON representation now with m2m: prefix<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=494911 Bug 494911] - Issues in CoAP binding<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=494090 Bug 494090] - Enable wildcard for AccessControl originators<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=494087 Bug 494087] - hange in some oneM2M Constants<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=492961 Bug 492961] - Missing Access check for Notify requests<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=491796 Bug 491796] - Support JSON content format<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=491797 Bug 491797] - Support of CoAP binding<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=491791 Bug 491791] - Enable resource name attribute in creation request<br />
<br />
== Release 0.8.0 (April 8, 2015) ==<br />
=== Features ===<br />
The first release of OM2M will include the following features:<br />
<br />
* Implement the SmartM2M standard. For more information see [http://www.etsi.org/technologies-clusters/technologies/m2m SmartM2M standard]<br />
* Provide a modular architecture running on top of an OSGi layer based on Eclipse Equinox. <br />
* Integrate Maven and Tycho to automate build process and RCP development.<br />
* Provide a protocol-independent CORE plugin to handle generic REST request.<br />
* Enable machine registration, application deployment, container management, resource discovery, access right authorization, subscription / notification, group management, and resource announcement.<br />
* Provide a HTTP communication binding plugin based on Jetty and Apache HTTP client libraries.<br />
* Provide a CoAP communication binding plugin based on the Californium library.<br />
* Provide a simple retargeting mechanism to connect HTTP and CoAP enabled devices.<br />
* Provide an interworking sample plugin with simulated devices to show how to connect legacy devices.<br />
* Provide a web interface plugin for browsing and debugging each machine resource structure.<br />
* Provide a DAO persistence layer based on EclipseLink JPA library to support different SQL and NOSQL database solutions.<br />
* Replace the DB4O database with the H2 database which provide better performance.<br />
* Introduce required persistence parameters to the "config.ini" file to simplify the JPA configuration.<br />
* Replace the XSD resource validation with a native validation mechanism that offers more flexibility.<br />
* Replace the OASIS OBIX library with a native encoder/decoder based on the JAXB library.<br />
* Improve the OM2M performance by optimizing the resource structure and database access.<br />
<br />
=== Fixed bugs ===<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=463673 Bug 463673] - Problem in starting the GUI of the IPU sample plugin in the GSCL<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=463778 Bug 463778] - Replace the native launcher with an independent single script <br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=453467 Bug 453467] - Can't access a malformed created application<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=463941 Bug 463941] - OM2M starting blocked on ObixMapper</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/Download&diff=440979OM2M/Download2020-09-25T15:21:12Z<p>Garzone-eclipse.outlook.fr: /* Official Releases */</p>
<hr />
<div>__TOC__<br />
<br />
== Official Releases ==<br />
{|border="1" width="100%" class="wikitable"<br />
! Download<br />
! Date<br />
! Description<br />
! Release Notes<br />
|-<br />
| Eclipse OM2M v1.4.0 || August 5, 2020 || New Features || [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.4.0_.28Aug._05.2C_2020.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/eclipse-om2m-v1.3.0.zip Eclipse OM2M v1.3.0] || March 13, 2018 || Bug fixing and new features|| [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.3.0_.28March_13.2C_2018.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.2.0/eclipseom2m-v-1.2.0.zip Eclipse OM2M v1.2.0] || January 04, 2018 || Bug fixing || [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.2.0_.28January_04.2C_2018.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.1.0/eclipse-om2m-v1.1.0.zip Eclipse OM2M v1.1.0] || October 09, 2017 || oneM2M 2.0 support, new features, and bug fixing ||[https://wiki.eclipse.org/OM2M/Roadmap#Release_1.1.0_.28October_09.2C_2017.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.0.0/OM2M-1.0.0.zip Eclipse OM2M v1.0.0] || June 22, 2016 || oneM2M 1.0 support, new features, and bug fixing ||[https://wiki.eclipse.org/OM2M/Roadmap#Release_1.0.0_.28June_22.2C_2016.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/0.8.0/OM2M-0.8.0.zip Eclipse OM2M v0.8.0 ] || April 8, 2015 || smartM2M 1.0 support ||[https://wiki.eclipse.org/OM2M/Roadmap#Release_0.8.0_.28April_8.2C_2015.29 Release notes]<br />
|}<br />
<br />
== Dev releases ==<br />
<br />
{|border="1" width="100%" class="wikitable"<br />
! Download<br />
! Date<br />
! Description<br />
! Notes<br />
|-<br />
| [https://www.dropbox.com/s/nzgd57yxw1osyp4/OM2M-DEV-10072019.zip?dl=1 OM2M-DEV-10072019]<br />
|| July 10, 2019 || Bug fixing ||<br />
Fixed Bugs: <br><br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=540074 540074]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=543030 543030]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=531929 531929]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=543639 543639] <br><br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=544316 544316]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=529725 529725]<br />
|-<br />
| [https://www.dropbox.com/s/d7rwi26tkzokih7/OM2M-DEV-20112018.zip?dl=1 OM2M-DEV-20112018]<br />
|| November 20, 2018 || New features and bug fixing ||<br />
|-<br />
| [https://www.dropbox.com/s/n9pez3aw1l7jhb0/OM2M-DEV-13-11-2016.zip?dl=1 OM2M-DEV-13112016]<br />
|| November 13, 2016 || Bug fixing ||<br />
Fixed Bugs: <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=507443 507443]<br />
|-<br />
| [https://www.dropbox.com/s/uh20fepedxp1gkr/OM2M-DEV-30-07-2016.zip?dl=1 OM2M-DEV-30072016]<br />
|| July 30, 2016 || Bug fixing ||<br />
Fixed Bugs: <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=497579 497579]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=495606 495606]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=498911 498911] <br />
|-<br />
| [https://www.dropbox.com/s/r020j0p47vc5mup/OM2M-DEV-24-04-2016.zip?dl=1 OM2M-DEV-24042016]<br />
|| April 24, 2016 || Bug fixing ||<br />
Features and fixed Bugs: <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=491796 491796]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=491797 491797] <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=491791 491791]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=488769 488769] <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=488268 488268]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=488269 488269]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=484399 484399]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=473505 473505]<br />
|}<br />
<br />
== Source code ==<br />
Click [http://git.eclipse.org/c/om2m/org.eclipse.om2m.git here] to access OM2M source code repository.</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/Roadmap&diff=440978OM2M/Roadmap2020-09-25T15:19:42Z<p>Garzone-eclipse.outlook.fr: /* Features */</p>
<hr />
<div>This page describes the current plan for the upcoming features of the OM2M project.<br />
<br />
Please note that this roadmap is a moving target. Depending on priorities and community contribution, the roadmap can change any time, so do not take it for granted, but see it as a guidance of direction.<br />
<br />
<br />
== Release 1.4.0 (Aug. 05, 2020) ==<br />
=== Features ===<br />
Eclipse OM2M 1.4.0 offers the following features:<br />
* Implementation of Dynamic Authorization features as defined to oneM2M standard.<br />
* Add SDT new modules and devices<br />
* SDT bug fixing<br />
* Memory usage enhancements<br />
* New unit tests<br />
* Update to EPL 2.0<br />
<br />
== Release 1.3.0 (March 13, 2018)==<br />
<br />
=== Features ===<br />
This release provides the following updates and new features:<br />
* oneM2M java clients<br />
* oneM2M javascript clients<br />
* oneM2M arduino clients<br />
* ManagementObject :<br />
** Announcement<br />
** Persistence<br />
** Add new Management Object<br />
** Use DeviceInfo Management Object in SDT IPE<br />
<br />
=== Fixed bugs ===<br />
* FlexContainers<br />
** Remove unused XmlSeeAlso annotation into FlexContainers<br />
** Fix deviceSwitchButton device short name <br />
* Discovery with multiple labels<br />
<br />
== Release 1.2.0 (January 04, 2018) ==<br />
=== Features ===<br />
This release provides the following updates and new features:<br />
* android.dashboard: initial import<br />
* build MN-CSE & IN-CSE docker image<br />
* mocked sdt devices : add Thermometer, SwitchButton, NumberValue<br />
* sdt.app.homemonitoring:<br />
** disable switch button in case of readOnly SDT module<br />
** highlight values on notification<br />
<br />
=== Fixed bugs ===<br />
The following bugs are fixed:<br />
* all: <br />
** fix UTF8 character encoding issue<br />
** remove RequestPrimitive's targetId field<br />
* persistence.mongodb: <br />
** implement missing DAO<br />
** fix issue on Container persistence<br />
* announcement : fix issue regarding Container announcement<br />
* commons: fix announcement issue<br />
* datamapping.jaxb: log enhancement.<br />
* sdt.app.homemonitoring: fix authentication issue<br />
* sdt.home.netatmo : fix naming issue<br />
* sdt.app.comparator :fix rendering issue<br />
* Resource browser:Fix rendering issue <br />
* [Bug 526616] Update ol attribute of container correctly<br />
* Fix Bug 522099 on discovery with label filter<br />
<br />
== Release 1.1.0 (October 09, 2017) ==<br />
=== Features ===<br />
This release provides the following updates and new features: <br />
* oneM2M release 2 support<br />
* MQTT communication binding<br />
* NoSQL MongoDB storage<br />
* Smart Device Template (SDT)<br />
* FlexContainer resource<br />
* Dynamic Authorization<br />
* Resource Announcement<br />
* Enocean interworking<br />
* Hue interworking<br />
* Netatmo interworking<br />
* SmarterCoffee interworking<br />
* LIFX interworking<br />
* OSGi DAL (Device Abstraction Layer) interworking<br />
* Several test suites<br />
<br />
=== Tutorials ===<br />
Several tutorials already proposed to explain how to use the new features developed in this release:<br />
* How to use oneM2M MQTT binding<br />
* Develop oneM2M applications<br />
* Develop an Interworking Proxy Plugin<br />
* Develop an Interworking Proxy Application Entity (IPE) Plugin with SDT<br />
* Developing with FlexContainers<br />
* Change database config.<br />
* Integrate OSGi DAL devices into OM2M by using DAL IPE Plugin<br />
Check our wiki: https://wiki.eclipse.org/OM2M/one<br />
<br />
=== Fixed bugs ===<br />
The following bugs are fixed:<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=501266 Bug 501266] - ACP automatically created when an AE is created dosn't have ty=1<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=498911 Bug 498911] - Error in Access Right verification for PoA notification<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=498387 Bug 498387] - Smart Device Template (SDT) support<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=498374 Bug 498374] - FlexContainer feature support<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=497579 Bug 497579] - Unwanted deletion of AEs having the name of the wanted deleted AE as a prefix<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=495606 Bug 495606] - Error on creating ContentInstance with maxNumberOfInstance in Container<br />
<br />
== Release 1.0.0 (June 22, 2016) ==<br />
=== Features ===<br />
Implementation of the oneM2M standard. For more information see [http://www.onem2m.org/ oneM2M standard].<br />
<br />
Main supported features:<br />
<br />
* Nodes: IN-CSE, MN-CSE, ASN-CSE, and ADN.<br />
* Reference Points: MCA, and MCC.<br />
* Resource types: CSEBase, RemoteCSE, ACP, AE, Container, ContentInstance, Subscription, Group, Node, Request, PoA, etc.<br />
* Request primitives: Retrieve, Create, Update, Delete, and Notify.<br />
* Addressing formats: Structured and Unstructured. <br />
* Addressing modes: Absolute, SP-relative, and CSE-Relative.<br />
* Protocol Bindings: HTTP and CoAP.<br />
* Content Formats: XML and JSON.<br />
* Communication Modes: Blocking, Non Blocking Syhcnronous, and Non Blocking Asynchrnonous.<br />
* Multihop: retargeting via PoA.<br />
* Storage mode: SQL and NoSQL (SQL H2 by default)<br />
* Security: SSL/TLS<br />
<br />
=== Fixed bugs ===<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=494086 Bug 494086] - Top level node in JSON representation now with m2m: prefix<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=494911 Bug 494911] - Issues in CoAP binding<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=494090 Bug 494090] - Enable wildcard for AccessControl originators<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=494087 Bug 494087] - hange in some oneM2M Constants<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=492961 Bug 492961] - Missing Access check for Notify requests<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=491796 Bug 491796] - Support JSON content format<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=491797 Bug 491797] - Support of CoAP binding<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=491791 Bug 491791] - Enable resource name attribute in creation request<br />
<br />
== Release 0.8.0 (April 8, 2015) ==<br />
=== Features ===<br />
The first release of OM2M will include the following features:<br />
<br />
* Implement the SmartM2M standard. For more information see [http://www.etsi.org/technologies-clusters/technologies/m2m SmartM2M standard]<br />
* Provide a modular architecture running on top of an OSGi layer based on Eclipse Equinox. <br />
* Integrate Maven and Tycho to automate build process and RCP development.<br />
* Provide a protocol-independent CORE plugin to handle generic REST request.<br />
* Enable machine registration, application deployment, container management, resource discovery, access right authorization, subscription / notification, group management, and resource announcement.<br />
* Provide a HTTP communication binding plugin based on Jetty and Apache HTTP client libraries.<br />
* Provide a CoAP communication binding plugin based on the Californium library.<br />
* Provide a simple retargeting mechanism to connect HTTP and CoAP enabled devices.<br />
* Provide an interworking sample plugin with simulated devices to show how to connect legacy devices.<br />
* Provide a web interface plugin for browsing and debugging each machine resource structure.<br />
* Provide a DAO persistence layer based on EclipseLink JPA library to support different SQL and NOSQL database solutions.<br />
* Replace the DB4O database with the H2 database which provide better performance.<br />
* Introduce required persistence parameters to the "config.ini" file to simplify the JPA configuration.<br />
* Replace the XSD resource validation with a native validation mechanism that offers more flexibility.<br />
* Replace the OASIS OBIX library with a native encoder/decoder based on the JAXB library.<br />
* Improve the OM2M performance by optimizing the resource structure and database access.<br />
<br />
=== Fixed bugs ===<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=463673 Bug 463673] - Problem in starting the GUI of the IPU sample plugin in the GSCL<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=463778 Bug 463778] - Replace the native launcher with an independent single script <br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=453467 Bug 453467] - Can't access a malformed created application<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=463941 Bug 463941] - OM2M starting blocked on ObixMapper</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/Roadmap&diff=440973OM2M/Roadmap2020-09-25T14:36:15Z<p>Garzone-eclipse.outlook.fr: </p>
<hr />
<div>This page describes the current plan for the upcoming features of the OM2M project.<br />
<br />
Please note that this roadmap is a moving target. Depending on priorities and community contribution, the roadmap can change any time, so do not take it for granted, but see it as a guidance of direction.<br />
<br />
<br />
== Release 1.4.0 (Aug. 05, 2020) ==<br />
=== Features ===<br />
Eclipse OM2M 1.4.0 offers the following features:<br />
* Implementation of Dynamic Authorization features as defined to oneM2M standard.<br />
* Add SDT new modules and devices<br />
* SDT bug fixing<br />
* Memory usage enhancements<br />
* New unit tests<br />
<br />
<br />
== Release 1.3.0 (March 13, 2018)==<br />
<br />
=== Features ===<br />
This release provides the following updates and new features:<br />
* oneM2M java clients<br />
* oneM2M javascript clients<br />
* oneM2M arduino clients<br />
* ManagementObject :<br />
** Announcement<br />
** Persistence<br />
** Add new Management Object<br />
** Use DeviceInfo Management Object in SDT IPE<br />
<br />
=== Fixed bugs ===<br />
* FlexContainers<br />
** Remove unused XmlSeeAlso annotation into FlexContainers<br />
** Fix deviceSwitchButton device short name <br />
* Discovery with multiple labels<br />
<br />
== Release 1.2.0 (January 04, 2018) ==<br />
=== Features ===<br />
This release provides the following updates and new features:<br />
* android.dashboard: initial import<br />
* build MN-CSE & IN-CSE docker image<br />
* mocked sdt devices : add Thermometer, SwitchButton, NumberValue<br />
* sdt.app.homemonitoring:<br />
** disable switch button in case of readOnly SDT module<br />
** highlight values on notification<br />
<br />
=== Fixed bugs ===<br />
The following bugs are fixed:<br />
* all: <br />
** fix UTF8 character encoding issue<br />
** remove RequestPrimitive's targetId field<br />
* persistence.mongodb: <br />
** implement missing DAO<br />
** fix issue on Container persistence<br />
* announcement : fix issue regarding Container announcement<br />
* commons: fix announcement issue<br />
* datamapping.jaxb: log enhancement.<br />
* sdt.app.homemonitoring: fix authentication issue<br />
* sdt.home.netatmo : fix naming issue<br />
* sdt.app.comparator :fix rendering issue<br />
* Resource browser:Fix rendering issue <br />
* [Bug 526616] Update ol attribute of container correctly<br />
* Fix Bug 522099 on discovery with label filter<br />
<br />
== Release 1.1.0 (October 09, 2017) ==<br />
=== Features ===<br />
This release provides the following updates and new features: <br />
* oneM2M release 2 support<br />
* MQTT communication binding<br />
* NoSQL MongoDB storage<br />
* Smart Device Template (SDT)<br />
* FlexContainer resource<br />
* Dynamic Authorization<br />
* Resource Announcement<br />
* Enocean interworking<br />
* Hue interworking<br />
* Netatmo interworking<br />
* SmarterCoffee interworking<br />
* LIFX interworking<br />
* OSGi DAL (Device Abstraction Layer) interworking<br />
* Several test suites<br />
<br />
=== Tutorials ===<br />
Several tutorials already proposed to explain how to use the new features developed in this release:<br />
* How to use oneM2M MQTT binding<br />
* Develop oneM2M applications<br />
* Develop an Interworking Proxy Plugin<br />
* Develop an Interworking Proxy Application Entity (IPE) Plugin with SDT<br />
* Developing with FlexContainers<br />
* Change database config.<br />
* Integrate OSGi DAL devices into OM2M by using DAL IPE Plugin<br />
Check our wiki: https://wiki.eclipse.org/OM2M/one<br />
<br />
=== Fixed bugs ===<br />
The following bugs are fixed:<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=501266 Bug 501266] - ACP automatically created when an AE is created dosn't have ty=1<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=498911 Bug 498911] - Error in Access Right verification for PoA notification<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=498387 Bug 498387] - Smart Device Template (SDT) support<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=498374 Bug 498374] - FlexContainer feature support<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=497579 Bug 497579] - Unwanted deletion of AEs having the name of the wanted deleted AE as a prefix<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=495606 Bug 495606] - Error on creating ContentInstance with maxNumberOfInstance in Container<br />
<br />
== Release 1.0.0 (June 22, 2016) ==<br />
=== Features ===<br />
Implementation of the oneM2M standard. For more information see [http://www.onem2m.org/ oneM2M standard].<br />
<br />
Main supported features:<br />
<br />
* Nodes: IN-CSE, MN-CSE, ASN-CSE, and ADN.<br />
* Reference Points: MCA, and MCC.<br />
* Resource types: CSEBase, RemoteCSE, ACP, AE, Container, ContentInstance, Subscription, Group, Node, Request, PoA, etc.<br />
* Request primitives: Retrieve, Create, Update, Delete, and Notify.<br />
* Addressing formats: Structured and Unstructured. <br />
* Addressing modes: Absolute, SP-relative, and CSE-Relative.<br />
* Protocol Bindings: HTTP and CoAP.<br />
* Content Formats: XML and JSON.<br />
* Communication Modes: Blocking, Non Blocking Syhcnronous, and Non Blocking Asynchrnonous.<br />
* Multihop: retargeting via PoA.<br />
* Storage mode: SQL and NoSQL (SQL H2 by default)<br />
* Security: SSL/TLS<br />
<br />
=== Fixed bugs ===<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=494086 Bug 494086] - Top level node in JSON representation now with m2m: prefix<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=494911 Bug 494911] - Issues in CoAP binding<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=494090 Bug 494090] - Enable wildcard for AccessControl originators<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=494087 Bug 494087] - hange in some oneM2M Constants<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=492961 Bug 492961] - Missing Access check for Notify requests<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=491796 Bug 491796] - Support JSON content format<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=491797 Bug 491797] - Support of CoAP binding<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=491791 Bug 491791] - Enable resource name attribute in creation request<br />
<br />
== Release 0.8.0 (April 8, 2015) ==<br />
=== Features ===<br />
The first release of OM2M will include the following features:<br />
<br />
* Implement the SmartM2M standard. For more information see [http://www.etsi.org/technologies-clusters/technologies/m2m SmartM2M standard]<br />
* Provide a modular architecture running on top of an OSGi layer based on Eclipse Equinox. <br />
* Integrate Maven and Tycho to automate build process and RCP development.<br />
* Provide a protocol-independent CORE plugin to handle generic REST request.<br />
* Enable machine registration, application deployment, container management, resource discovery, access right authorization, subscription / notification, group management, and resource announcement.<br />
* Provide a HTTP communication binding plugin based on Jetty and Apache HTTP client libraries.<br />
* Provide a CoAP communication binding plugin based on the Californium library.<br />
* Provide a simple retargeting mechanism to connect HTTP and CoAP enabled devices.<br />
* Provide an interworking sample plugin with simulated devices to show how to connect legacy devices.<br />
* Provide a web interface plugin for browsing and debugging each machine resource structure.<br />
* Provide a DAO persistence layer based on EclipseLink JPA library to support different SQL and NOSQL database solutions.<br />
* Replace the DB4O database with the H2 database which provide better performance.<br />
* Introduce required persistence parameters to the "config.ini" file to simplify the JPA configuration.<br />
* Replace the XSD resource validation with a native validation mechanism that offers more flexibility.<br />
* Replace the OASIS OBIX library with a native encoder/decoder based on the JAXB library.<br />
* Improve the OM2M performance by optimizing the resource structure and database access.<br />
<br />
=== Fixed bugs ===<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=463673 Bug 463673] - Problem in starting the GUI of the IPU sample plugin in the GSCL<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=463778 Bug 463778] - Replace the native launcher with an independent single script <br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=453467 Bug 453467] - Can't access a malformed created application<br />
* [https://bugs.eclipse.org/bugs/show_bug.cgi?id=463941 Bug 463941] - OM2M starting blocked on ObixMapper</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/Download&diff=433342OM2M/Download2019-07-10T13:29:56Z<p>Garzone-eclipse.outlook.fr: </p>
<hr />
<div>__TOC__<br />
<br />
== Official Releases ==<br />
{|border="1" width="100%" class="wikitable"<br />
! Download<br />
! Date<br />
! Description<br />
! Release Notes<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/eclipse-om2m-v1.3.0.zip Eclipse OM2M v1.3.0] || March 13, 2018 || Bug fixing and new features|| [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.3.0_.28March_13.2C_2018.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.2.0/eclipseom2m-v-1.2.0.zip Eclipse OM2M v1.2.0] || January 04, 2018 || Bug fixing || [https://wiki.eclipse.org/OM2M/Roadmap#Release_1.2.0_.28January_04.2C_2018.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.1.0/eclipse-om2m-v1.1.0.zip Eclipse OM2M v1.1.0] || October 09, 2017 || oneM2M 2.0 support, new features, and bug fixing ||[https://wiki.eclipse.org/OM2M/Roadmap#Release_1.1.0_.28October_09.2C_2017.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/1.0.0/OM2M-1.0.0.zip Eclipse OM2M v1.0.0] || June 22, 2016 || oneM2M 1.0 support, new features, and bug fixing ||[https://wiki.eclipse.org/OM2M/Roadmap#Release_1.0.0_.28June_22.2C_2016.29 Release notes]<br />
|-<br />
| [https://www.eclipse.org/downloads/download.php?file=/om2m/releases/0.8.0/OM2M-0.8.0.zip Eclipse OM2M v0.8.0 ] || April 8, 2015 || smartM2M 1.0 support ||[https://wiki.eclipse.org/OM2M/Roadmap#Release_0.8.0_.28April_8.2C_2015.29 Release notes]<br />
|}<br />
<br />
== Dev releases ==<br />
<br />
{|border="1" width="100%" class="wikitable"<br />
! Download<br />
! Date<br />
! Description<br />
! Notes<br />
|-<br />
| [https://www.dropbox.com/s/nzgd57yxw1osyp4/OM2M-DEV-10072019.zip?dl=1 OM2M-DEV-10072019]<br />
|| July 10, 2019 || Bug fixing ||<br />
Fixed Bugs: <br><br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=540074 540074]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=543030 543030]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=531929 531929]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=543639 543639] <br><br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=544316 544316]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=529725 529725]<br />
|-<br />
| [https://www.dropbox.com/s/d7rwi26tkzokih7/OM2M-DEV-20112018.zip?dl=1 OM2M-DEV-20112018]<br />
|| November 20, 2018 || New features and bug fixing ||<br />
|-<br />
| [https://www.dropbox.com/s/n9pez3aw1l7jhb0/OM2M-DEV-13-11-2016.zip?dl=1 OM2M-DEV-13112016]<br />
|| November 13, 2016 || Bug fixing ||<br />
Fixed Bugs: <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=507443 507443]<br />
|-<br />
| [https://www.dropbox.com/s/uh20fepedxp1gkr/OM2M-DEV-30-07-2016.zip?dl=1 OM2M-DEV-30072016]<br />
|| July 30, 2016 || Bug fixing ||<br />
Fixed Bugs: <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=497579 497579]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=495606 495606]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=498911 498911] <br />
|-<br />
| [https://www.dropbox.com/s/r020j0p47vc5mup/OM2M-DEV-24-04-2016.zip?dl=1 OM2M-DEV-24042016]<br />
|| April 24, 2016 || Bug fixing ||<br />
Features and fixed Bugs: <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=491796 491796]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=491797 491797] <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=491791 491791]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=488769 488769] <br> <br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=488268 488268]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=488269 488269]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=484399 484399]<br />
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=473505 473505]<br />
|}<br />
<br />
== Source code ==<br />
Click [http://git.eclipse.org/c/om2m/org.eclipse.om2m.git here] to access OM2M source code repository.</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/one/REST_API&diff=421329OM2M/one/REST API2017-12-15T13:13:35Z<p>Garzone-eclipse.outlook.fr: </p>
<hr />
<div>__TOC__<br />
== Install a REST client ==<br />
* For this section, you need a REST client to send HTTP request (GET, POST, UPDATE, DELETE) to the OM2M platform. <br />
* Install Postman extension on google chrome browser: http://www.getpostman.com <br />
* The tutorial postman collection is available here: https://www.getpostman.com/collections/41fad4dcdaca7a90325e<br />
<br />
== Retrieve a resource == <br />
* HTTP request:<br />
{{CTable}}<br />
| Field|| Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse<br />
|-<br />
| Method|| GET<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Accept: application/xml<br />
|-<br />
| Body|| (empty)<br />
|}<br />
<br />
* HTTP response:<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|Status|| 200 OK<br />
|-<br />
|Body|| <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:cb xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="in-name"><br />
<ty>5</ty><br />
<ri>/in-cse</ri><br />
<ct>20151104T150228</ct><br />
<lt>20151104T150228</lt><br />
<acpi>/in-cse/acp-563660429</acpi><br />
<cst>1</cst><br />
<csi>in-cse</csi><br />
<srt>1 2 3 4 5 9 14 15 16 17 23</srt><br />
<poa>http://127.0.0.1:8080/</poa><br />
</m2m:cb><br />
</pre><br />
|}<br />
<br />
You can set the '''Accept''' header to '''application/json''' if you want a response in JSON format instead of XML.<br />
<br />
== Create a "MY_SENSOR" application ==<br />
* Send a HTTP request with the following parameters to create a '''MY_SENSOR''' application on the gateway.<br />
{{CTable}}<br />
* In the creation we have two important headers:<br />
** '''Content-Type''': this header has 2 informations seperated by a semicolon<br />
*** The format of the exchange, here "application/xml"<br />
*** The resource type to be created, here "ty=2" (2 for AE, see oneM2M spec TS-0004 (V2.7.1), Table 6.3.4.2.1-1)<br />
<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse<br />
|-<br />
|Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=2<br />
|-<br />
|Body|| <pre><br />
<m2m:ae xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="MY_SENSOR" ><br />
<api>app-sensor</api><br />
<lbl>Type/sensor Category/temperature Location/home</lbl><br />
<rr>false</rr><br />
</m2m:ae></pre><br />
|}<br />
<br />
* HTTP response:<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
| Status || 201 Created<br />
|-<br />
|Headers || Content-Location: /in-cse/ae-CAE449907766<br />
|-<br />
| Body || <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:ae xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="MY_SENSOR"><br />
<ty>2</ty><br />
<ri>ae-CAE449907766</ri><br />
<pi>/in-cse</pi><br />
<ct>20151104T151858</ct><br />
<lt>20151104T151858</lt><br />
<lbl>Type/sensor Category/temperature Location/home</lbl><br />
<acpi>/in-cse/acp-89704715</acpi><br />
<api>app-sensor</api><br />
<aei>CAE449907766</aei><br />
<rr>false</rr><br />
</m2m:ae><br />
</pre><br />
|}<br />
<!--* Here, the application has been created and can be accessed using 2 different URIs: <br />
** '''Unstructured URI''': this URI is the '''ri''' node in the AE representation or present in the '''Content-Location''' header in the creation response "/<cse-id>/<id-of-the-resource>". In our case we have "/in-cse/ae-CAE449907766"<br />
** '''Structured URI''': this URI use the names of the resources hierarchically to get the resource "/<cse-id>/<cse-name>/<hierarchy-of-resource-names>". Here we will simply have "/in-cse/in-name/MY-SENSOR".<br />
The difference between the unstructured URI and the structured one consists in the presence (or not) of the CSE name. Examples:<br />
unstructured URI: "/<cse-id>/<id-of-the-resource>", for instance: "/in-cse/ae-123".<br />
structured URI: "/in-cse/in-name/<hierarchy-of-resource-names>", for instance: "/in-cse/in-name/name1/name2/name3".<br />
--><br />
* You can check the created application on the web interface.<br />
<br />
== Discover resources based on their labels ==<br />
* You can discover available resources based on their search strings using the discovery resource. The '''fu''' parameter (stands for "Filter Usage") indicate that it is a discovery request. The '''lbl''' ("Label") indicate the specific label you what to filter.<br />
* HTTP request: <br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse?fu=1&lbl=Type/sensor<br />
|-<br />
| Method|| GET<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Accept: application/xml<br />
|-<br />
|Body|| (empty)<br />
|}<br />
<br />
* HTTP response:<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|Status|| 200 OK<br />
|-<br />
|Body|| <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:disres xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<ref ty="2"> <uri-of-the-resource> </ref><br />
</m2m:disres></pre><br />
|}<br />
<br />
== Create a DESCRIPTOR container ==<br />
* Send a HTTP request with the following parameters to create a '''DESCRIPTOR''' container resource under the '''MY_SENSOR''' application.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR<br />
|-<br />
| Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=3<br />
|-<br />
|Body|| <pre><br />
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="DESCRIPTOR"><br />
</m2m:cnt></pre><br />
|}<br />
<br />
* HTTP response<br />
{{CTable}}<br />
|Field || Value<br />
|-<br />
| Status || 201 Created<br />
|-<br />
| Header || Content-Location: /in-cse/cnt-478855064<br />
|-<br />
| Body || <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="DESCRIPTOR"><br />
<ty>3</ty><br />
<ri>cnt-478855064</ri><br />
<pi>/in-cse/ae-CAE449907766</pi><br />
<ct>20151104T155844</ct><br />
<lt>20151104T155844</lt><br />
<acpi>/in-cse/acp-89704715</acpi><br />
<cni>0</cni><br />
<cbs>0</cbs><br />
</m2m:cnt><br />
</pre><br />
|}<br />
<!--* As the AE, there is two ways to access the resource:<br />
** '''Unstructured URI''': which is '/in-cse/cnt-478855064'<br />
** '''Structure URI''': which is the Structured URI of the AE plus the name of the container, in our case "/in-cse/in-name/MY_SENSOR/DESCRIPTOR"--><br />
* Check the created container on the web interface.<br />
<br />
== Create a description contentInstance ==<br />
* Send a HTTP request with the following parameters to create a description content instance resource under the "DESCRIPTOR" container.<br />
{{CTable}}<br />
| Field || Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR/DESCRIPTOR<br />
|-<br />
| Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=4<br />
|-<br />
| Body||<pre> <br />
<m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<cnf>application/xml</cnf><br />
<con><br />
&amp;lt;obj&amp;gt;<br />
&amp;lt;str name=&amp;quot;type&amp;quot; val=&amp;quot;Temperature_Sensor&amp;quot;/&amp;gt;<br />
&amp;lt;str name=&amp;quot;location&amp;quot; val=&amp;quot;Home&amp;quot;/&amp;gt;<br />
&amp;lt;str name=&amp;quot;appId&amp;quot; val=&amp;quot;MY_SENSOR&amp;quot;/&amp;gt;<br />
&amp;lt;op name=&amp;quot;getValue&amp;quot; href=&amp;quot;/in-cse/in-name/MY_SENSOR/DATA/la&amp;quot; <br />
in=&amp;quot;obix:Nil&amp;quot; out=&amp;quot;obix:Nil&amp;quot; is=&amp;quot;retrieve&amp;quot;/&amp;gt;<br />
&amp;lt;/obj&amp;gt;<br />
</con><br />
</m2m:cin><br />
</pre><br />
|}<br />
* Check the created content instance on the web interface.<br />
<br />
== Create a DATA container == <br />
* Send a HTTP request with the following parameters to create a "DATA" container resource under the "MY_SENSOR" application.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR<br />
|-<br />
| Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=3<br />
|-<br />
|Body|| <pre><br />
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="DATA"><br />
</m2m:cnt></pre><br />
|}<br />
* Check the created container on the web interface.<br />
<br />
== Create a data contentInstance ==<br />
* Send a HTTP request with the following parameters to create a data content instance resource under the "DATA" container.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR/DATA<br />
|-<br />
|Method|| POST<br />
|-<br />
|Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=4<br />
|-<br />
|Body|| <pre> <br />
<m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<cnf>message</cnf><br />
<con><br />
&amp;lt;obj&amp;gt;<br />
&amp;lt;str name=&amp;quot;appId&amp;quot; val=&amp;quot;MY_SENSOR&amp;quot;/&amp;gt;<br />
&amp;lt;str name=&amp;quot;category&amp;quot; val=&amp;quot;temperature &amp;quot;/&amp;gt;<br />
&amp;lt;int name=&amp;quot;data&amp;quot; val=&amp;quot;27&amp;quot;/&amp;gt;<br />
&amp;lt;int name=&amp;quot;unit&amp;quot; val=&amp;quot;celsius&amp;quot;/&amp;gt;<br />
&amp;lt;/obj&amp;gt;<br />
</con><br />
</m2m:cin><br />
</pre><br />
|}<br />
* Check the created content instance on the web interface.<br />
<br />
== Create a "MY_SENSOR" application using JSON ==<br />
* Since OM2M supports JSON, you can send an HTTP request with the following parameters to create a '''MY_SENSOR''' application on the gateway using JSON instead of XML.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse<br />
|-<br />
|Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/json;ty=2<br />
|-<br />
|Body|| <pre><br />
{<br />
"m2m:ae": {<br />
"api": "app-sensor",<br />
"rr": "false",<br />
"lbl": ["Type/sensor", "Category/temperature", "Location/home"],<br />
"rn": "MY_SENSOR"<br />
}<br />
}<br />
</pre><br />
|}<br />
<br />
You can interact with the system in the same way using JSON instead of XML with an equivalent of the XML body. (Be careful for the Labels to use a JSON array for instance: "lbl":"["label-1", "label-2"].)<br />
<br />
<br />
== Subscribe to MY_SENSOR data ==<br />
* Download the monitor server sample from this link: [https://www.laas.fr/projects/IOT/sites/www.laas.fr.projects.IOT/files/u77/monitor.jar Monitor].<br />
* Start the Monitor server using the following command:<br />
<pre><br />
> java -jar monitor.jar<br />
</pre><br />
* The monitor starts listening on port=1400 and context=/monitor.<br />
[[File:console-monitor.png|center|600px|thumb|Monitor console: the server is started]]<br />
<br />
* Send a HTTP request with the following parameters to create a "Subscription" resource for receive asynchronously events from "MY_SENSOR" application. <br />
* The monitor listening URL (http://127.0.0.1:1400/monitor) should be added on the "nu" tag of the subscription representation.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR/DATA<br />
|-<br />
|Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=23<br />
|-<br />
|Body||<pre><br />
<m2m:sub xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="SUB_MY_SENSOR"><br />
<nu>http://localhost:1400/monitor</nu><br />
<nct>2</nct><br />
</m2m:sub></pre><br />
|}<br />
<br />
* Check the created subscription on the web interface.<br />
<br />
* Create a new event content instance resource under the "DATA" container.<br />
* The new event is published to interested subscribers by the gateway. <br />
* Here is an example of the "Notify" XML representation:<br />
<br />
<pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<nev><br />
<rep rn="cin_name1"><br />
<ty>4</ty><br />
<ri>cin-46677406</ri><br />
<pi>/in-cse/cnt-397256037</pi><br />
<ct>20151104T162611</ct><br />
<lt>20151104T162611</lt><br />
<st>0</st><br />
<cnf>message</cnf><br />
<cs>11</cs><br />
<con>hello world</con><br />
</rep><br />
<rss>1</rss><br />
</nev><br />
<sud>false</sud><br />
<sur>/in-cse/in-name/MY_SENSOR/DATA/SUB_MY_SENSOR</sur><br />
</m2m:sgn><br />
</pre><br />
<br />
* The Monitor receives a "Notify" resource including the new "ContentInstance". <br />
* Remember that the "Notify" resource has a generic structure to support notifications for other type of resources such as "AE", "Container", "Group", "AccessControlPolicy", etc.</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/one/MQTT_Binding&diff=413233OM2M/one/MQTT Binding2017-01-09T13:49:12Z<p>Garzone-eclipse.outlook.fr: </p>
<hr />
<div>The Eclipse OM2M MQTT Binding implements the TS-0010 MQTT Protocol Binding defined by the oneM2M consortium. The document is available on the [http://onem2m.org/technical/published-documents oneM2M website]. The [https://eclipse.org/paho/ Eclipse Paho] library has been used as a MQTT Client for the Eclipse OM2M MQTT Binding.<br />
<br />
== Configuration ==<br />
<br />
=== Broker ===<br />
<br />
The OM2M MQTT Binding does '''NOT''' include the MQTT Broker. The use of the MQTT binding requires to use an external MQTT Broker. For instance, the Eclipse Mosquitto broker can be used (available at: [http://projects.eclipse.org/projects/technology.mosquitto Mosquitto Website]).<br />
<br />
=== Constants ===<br />
<br />
The following constants can be specified in the OM2M product (<code>org.eclipse.om2m.site.*-cse</code> projects) or directly in the <code>config.ini</code> file in the compiled product (under the <code>configuration</code> folder).<br />
{{CTable}}|<br />
!Constant value<br />
!Usage<br />
!Default value<br />
|-<br />
|org.eclipse.om2m.mqtt.ip<br />
|Broker Host name or IP<br />
|localhost<br />
|-<br />
|org.eclipse.om2m.mqtt.port<br />
|Broker Port<br />
|1883<br />
|-<br />
|org.eclipse.om2m.mqtt.username<br />
|Broker username (optional)<br />
|null<br />
|-<br />
|org.eclipse.om2m.mqtt.password<br />
|Broker password (optional)<br />
|null<br />
|-<br />
|org.eclipse.om2m.mqtt.timeout<br />
|Binding request timeout for the client (second)<br />
|20<br />
|}<br />
<br />
=== Start the binding ===<br />
<br />
At first, the binding is not started in the <code>org.eclipse.om2m.site.in-cse</code> product. To start it, one must retrieve the <code>bundleId</code> of the MQTT binding plugin using the <code>ss mqtt</code> and then start it using the command <code>start &lt;bundleId&gt;</code>. Otherwise, it can be set as auto-start into the OM2M product.<br />
<br />
== oneM2M Requests ==<br />
<br />
oneM2M defines a ''request/response'' paradigm to interact with the CSE Entities. Since the MQTT protocol uses a different paradigm (''publish/subscribe''), an adaptation has to be done.<br />
<br />
To achieve this communication via the MQTT Protocol, a request topic has been defined where the client will be able to send the serialized request. Then the response will be posted on a predefined topic where the client will retrieve the serialized response. All information concerning the authentification, the operation, the response status and other parameters will be held into the serialized request/response.<br />
<br />
=== MQTT Topic ===<br />
<br />
The oneM2M technical specification provides the topics that has to be used for MQTT communication. The serialized request has to be pushed on a specific request topic and the response will be given to a different predefined topic.<br />
<br />
==== Request topic ====<br />
<br />
The request topic is formulated as the following:<br />
<br />
<pre>/oneM2M/req/&lt;originator&gt;/&lt;target-id&gt;/&lt;serialization-format&gt;</pre><br />
The <code>&lt;target-id&gt;</code> shall be the CSE-ID that is listening on the broker (for instance <code>in-cse</code>) and the <code>&lt;originator&gt;</code> correspond to the originator provided into the <code>X-M2M-Origin</code> header.<br />
<br />
Then the last information of the topic is serialization format of the request. The <code>&lt;serialization-format&gt;</code> parameter can have 2 values:<br />
<br />
* <code>xml</code> for XML format<br />
* <code>json</code> for JSON format<br />
<br />
==== Response topic ====<br />
<br />
The response topic is constructed based on the request topic.<br />
<br />
<pre>/oneM2M/resp/&lt;target-id&gt;/&lt;originator&gt;/&lt;serialization-format&gt;</pre><br />
<br />
=== MQTT Payload ===<br />
<br />
The payload published into the topic is the serialized <code>RequestPrimitive</code> or <code>ResponsePrimitive</code>. The <code>RequestPrimitive</code> correspond to all information needed to formulate a oneM2M request and receive the response into the <code>ResponsePrimitive</code>.<br />
<br />
The main parameters are:<br />
{{CTable}}|<br />
!Parameter short name<br />
!Parameter name<br />
!Usage<br />
|-<br />
|fr<br />
|From<br />
|Originator of the request<br />
|-<br />
|to<br />
|To<br />
|Destination of the request<br />
|-<br />
|op<br />
|Operation<br />
|The operation to perform (CREATE, RETRIEVE, ...)<br />
|-<br />
|rqi<br />
|Request Identifier<br />
|Correlation ID for the request and response<br />
|-<br />
|pc<br />
|Primitive Content<br />
|Content of the request (e.g., ressource to be created)<br />
|-<br />
|ty<br />
|Type<br />
|The type of the resource to be created<br />
|-<br />
|rsc<br />
|Response Status Code <br />
|The oneM2M response status code<br />
|}<br />
<br />
<br />
The Operation values are:<br />
{|<br />
!Operation <br />
!Value<br />
|-<br />
|CREATE<br />
| 1<br />
|-<br />
|RETRIEVE<br />
| 2<br />
|-<br />
|UPDATE<br />
|3<br />
|-<br />
|DELETE<br />
|4<br />
|-<br />
|NOTIFY<br />
|5<br />
|-<br />
|DISCOVERY<br />
|6<br />
|}<br />
<br />
==== Retrieve the CSE Base ====<br />
<br />
The aim of this request is to retrieve the CSE Base resource of the <code>in-cse</code>. The request topic is: <code>/oneM2M/req/AE_123/in-cse/json</code>.<br />
<br />
<pre>{<br />
&quot;m2m:rqp&quot;: {<br />
&quot;fr&quot;: &quot;AE_123&quot;,<br />
&quot;to&quot;: &quot;/in-cse&quot;,<br />
&quot;op&quot;: 2,<br />
&quot;rqi&quot;: 123456<br />
}<br />
}</pre><br />
The response will be published on the topic: <code>/oneM2M/resp/in-cse/AE_123/json</code>. Response payload is:<br />
<br />
<pre>{<br />
&quot;m2m:rsp&quot; : {<br />
&quot;rsc&quot; : 2000,<br />
&quot;rqi&quot; : &quot;1234&quot;,<br />
&quot;pc&quot; : {<br />
&quot;m2m:cb&quot; : [ {<br />
&quot;rn&quot; : &quot;in-name&quot;,<br />
&quot;ty&quot; : 5,<br />
&quot;ri&quot; : &quot;/in-cse&quot;,<br />
&quot;ct&quot; : &quot;20161116T111621&quot;,<br />
&quot;lt&quot; : &quot;20161116T111621&quot;,<br />
&quot;acpi&quot; : [ &quot;/in-cse/acp-95896161&quot; ],<br />
&quot;cst&quot; : 1,<br />
&quot;csi&quot; : &quot;in-cse&quot;,<br />
&quot;srt&quot; : [ 1, 2, 3, 4, 5, 9, 14, 15, 16, 17, 23 ],<br />
&quot;poa&quot; : [ &quot;http://127.0.0.1:8080/&quot; ]<br />
} ]<br />
},<br />
&quot;to&quot; : &quot;AE_123&quot;,<br />
&quot;fr&quot; : &quot;/in-cse&quot;<br />
}<br />
}</pre><br />
==== Create container ====<br />
<br />
The aim of the request is to create a container named <code>cntName</code>. The Request topic is: <code>/oneM2M/req/AE_123/in-cse/json</code>.<br />
<br />
Payload:<br />
<br />
<pre>{<br />
&quot;m2m:rqp&quot; : {<br />
&quot;fr&quot; : &quot;AE_123&quot;,<br />
&quot;to&quot; : &quot;/in-cse/in-name/AE_123&quot;,<br />
&quot;op&quot; : 1,<br />
&quot;rqi&quot;: 123456,<br />
&quot;pc&quot;: {<br />
&quot;m2m:cnt&quot; : {<br />
&quot;rn&quot;: &quot;cntName&quot;<br />
}<br />
},<br />
&quot;ty&quot;: 3<br />
}<br />
}</pre><br />
The response will be pushed on the topic: <code>/oneM2M/resp/in-cse/AE_123/json</code>. The payload would be:<br />
<br />
<pre>{<br />
&quot;m2m:rsp&quot; : {<br />
&quot;rsc&quot; : 2001,<br />
&quot;rqi&quot; : &quot;123456&quot;,<br />
&quot;pc&quot; : {<br />
&quot;m2m:cnt&quot; : [ {<br />
&quot;rn&quot; : &quot;cntName&quot;,<br />
&quot;ty&quot; : 3,<br />
&quot;ri&quot; : &quot;/in-cse/cnt-114901069&quot;,<br />
&quot;pi&quot; : &quot;/in-cse&quot;,<br />
&quot;ct&quot; : &quot;20161116T111750&quot;,<br />
&quot;lt&quot; : &quot;20161116T111750&quot;,<br />
&quot;acpi&quot; : [ &quot;/in-cse/acp-95896161&quot; ],<br />
&quot;et&quot; : &quot;20171116T111750&quot;,<br />
&quot;st&quot; : 0,<br />
&quot;mni&quot; : 10,<br />
&quot;mbs&quot; : 10000,<br />
&quot;mia&quot; : 0,<br />
&quot;cni&quot; : 0,<br />
&quot;cbs&quot; : 0,<br />
&quot;ol&quot; : &quot;/in-cse/in-name/AE_123/cntName/ol&quot;,<br />
&quot;la&quot; : &quot;/in-cse/in-name/AE_123/cntName/la&quot;<br />
} ]<br />
},<br />
&quot;to&quot; : &quot;AE_1234&quot;,<br />
&quot;fr&quot; : &quot;/in-cse&quot;<br />
}</pre></div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/one/REST_API&diff=412057OM2M/one/REST API2016-11-23T11:22:41Z<p>Garzone-eclipse.outlook.fr: /* Install a REST client */</p>
<hr />
<div>__TOC__<br />
== Install a REST client ==<br />
* For this section, you need a REST client to send HTTP request (GET, POST, UPDATE, DELETE) to the OM2M platform. <br />
* You can use Postman (http://www.getpostman.com) google chrome extension or any other REST client.<br />
* The authentication is handled using a specific oneM2M header: '''X-M2M-Origin'''. This has to be specified in each request to identify the sender.<br />
<br />
== Retrieve a resource == <br />
* HTTP request:<br />
{{CTable}}<br />
| Field|| Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse<br />
|-<br />
| Method|| GET<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Accept: application/xml<br />
|-<br />
| Body|| (empty)<br />
|}<br />
<br />
* HTTP response:<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|Status|| 200 OK<br />
|-<br />
|Body|| <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:cb xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="in-name"><br />
<ty>5</ty><br />
<ri>/in-cse</ri><br />
<ct>20151104T150228</ct><br />
<lt>20151104T150228</lt><br />
<acpi>/in-cse/acp-563660429</acpi><br />
<cst>1</cst><br />
<csi>in-cse</csi><br />
<srt>1 2 3 4 5 9 14 15 16 17 23</srt><br />
<poa>http://127.0.0.1:8080/</poa><br />
</m2m:cb><br />
</pre><br />
|}<br />
<br />
== Create a "MY_SENSOR" application ==<br />
* Send a HTTP request with the following parameters to create a '''MY_SENSOR''' application on the gateway.<br />
{{CTable}}<br />
* In the creation we have two important headers:<br />
** '''Content-Type''': this header has 2 informations seperated by a semicolon<br />
*** The format of the exchange, here "application/xml"<br />
*** The resource type to be created, here "ty=2" (2 for AE, see oneM2M spec TS-0004 (V2.7.1), Table 6.3.4.2.1-1)<br />
** '''X-M2M-NM''': the name of the resource to be created<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse<br />
|-<br />
|Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=2<br />
|-<br />
|Body|| <pre><br />
<m2m:ae xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="MY_SENSOR" ><br />
<api>app-sensor</api><br />
<lbl>Type/sensor Category/temperature Location/home</lbl><br />
<rr>false</rr><br />
</m2m:ae></pre><br />
|}<br />
<br />
* HTTP response:<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
| Status || 201 Created<br />
|-<br />
|Headers || Content-Location: /in-cse/ae-CAE449907766<br />
|-<br />
| Body || <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:ae xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="MY_SENSOR"><br />
<ty>2</ty><br />
<ri>ae-CAE449907766</ri><br />
<pi>/in-cse</pi><br />
<ct>20151104T151858</ct><br />
<lt>20151104T151858</lt><br />
<lbl>Type/sensor Category/temperature Location/home</lbl><br />
<acpi>/in-cse/acp-89704715</acpi><br />
<api>app-sensor</api><br />
<aei>CAE449907766</aei><br />
<rr>false</rr><br />
</m2m:ae><br />
</pre><br />
|}<br />
<!--* Here, the application has been created and can be accessed using 2 different URIs: <br />
** '''Unstructured URI''': this URI is the '''ri''' node in the AE representation or present in the '''Content-Location''' header in the creation response "/<cse-id>/<id-of-the-resource>". In our case we have "/in-cse/ae-CAE449907766"<br />
** '''Structured URI''': this URI use the names of the resources hierarchically to get the resource "/<cse-id>/<cse-name>/<hierarchy-of-resource-names>". Here we will simply have "/in-cse/in-name/MY-SENSOR".<br />
The difference between the unstructured URI and the structured one consists in the presence (or not) of the CSE name. Examples:<br />
unstructured URI: "/<cse-id>/<id-of-the-resource>", for instance: "/in-cse/ae-123".<br />
structured URI: "/in-cse/in-name/<hierarchy-of-resource-names>", for instance: "/in-cse/in-name/name1/name2/name3".<br />
--><br />
* You can check the created application on the web interface.<br />
<br />
== Discover resources based on their labels ==<br />
* You can discover available resources based on their search strings using the discovery resource. The '''fu''' parameter (stands for "Filter Usage") indicate that it is a discovery request. The '''lbl''' ("Label") indicate the specific label you what to filter.<br />
* HTTP request: <br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse?fu=1&lbl=Type/sensor<br />
|-<br />
| Method|| GET<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Accept: application/xml<br />
|-<br />
|Body|| (empty)<br />
|}<br />
<br />
* HTTP response:<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|Status|| 200 OK<br />
|-<br />
|Body|| <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:disres xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<ref ty="2"> <uri-of-the-resource> </ref><br />
</m2m:disres></pre><br />
|}<br />
<br />
== Create a DESCRIPTOR container ==<br />
* Send a HTTP request with the following parameters to create a '''DESCRIPTOR''' container resource under the '''MY_SENSOR''' application.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR<br />
|-<br />
| Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=3<br />
|-<br />
|Body|| <pre><br />
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="DESCRIPTOR"><br />
</m2m:cnt></pre><br />
|}<br />
<br />
* HTTP response<br />
{{CTable}}<br />
|Field || Value<br />
|-<br />
| Status || 201 Created<br />
|-<br />
| Header || Content-Location: /in-cse/cnt-478855064<br />
|-<br />
| Body || <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="DESCRIPTOR"><br />
<ty>3</ty><br />
<ri>cnt-478855064</ri><br />
<pi>/in-cse/ae-CAE449907766</pi><br />
<ct>20151104T155844</ct><br />
<lt>20151104T155844</lt><br />
<acpi>/in-cse/acp-89704715</acpi><br />
<cni>0</cni><br />
<cbs>0</cbs><br />
</m2m:cnt><br />
</pre><br />
|}<br />
<!--* As the AE, there is two ways to access the resource:<br />
** '''Unstructured URI''': which is '/in-cse/cnt-478855064'<br />
** '''Structure URI''': which is the Structured URI of the AE plus the name of the container, in our case "/in-cse/in-name/MY_SENSOR/DESCRIPTOR"--><br />
* Check the created container on the web interface.<br />
<br />
== Create a description contentInstance ==<br />
* Send a HTTP request with the following parameters to create a description content instance resource under the "DESCRIPTOR" container.<br />
{{CTable}}<br />
| Field || Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR/DESCRIPTOR<br />
|-<br />
| Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=4<br />
|-<br />
| Body||<pre> <br />
<m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<cnf>application/xml</cnf><br />
<con><br />
&amp;lt;obj&amp;gt;<br />
&amp;lt;str name=&amp;quot;type&amp;quot; val=&amp;quot;Temperature_Sensor&amp;quot;/&amp;gt;<br />
&amp;lt;str name=&amp;quot;location&amp;quot; val=&amp;quot;Home&amp;quot;/&amp;gt;<br />
&amp;lt;str name=&amp;quot;appId&amp;quot; val=&amp;quot;MY_SENSOR&amp;quot;/&amp;gt;<br />
&amp;lt;op name=&amp;quot;getValue&amp;quot; href=&amp;quot;/in-cse/in-name/MY_SENSOR/DATA/la&amp;quot; <br />
in=&amp;quot;obix:Nil&amp;quot; out=&amp;quot;obix:Nil&amp;quot; is=&amp;quot;retrieve&amp;quot;/&amp;gt;<br />
&amp;lt;/obj&amp;gt;<br />
</con><br />
</m2m:cin><br />
</pre><br />
|}<br />
* Check the created content instance on the web interface.<br />
<br />
== Create a DATA container == <br />
* Send a HTTP request with the following parameters to create a "DATA" container resource under the "MY_SENSOR" application.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR<br />
|-<br />
| Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=3<br />
|-<br />
|Body|| <pre><br />
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="DATA"><br />
</m2m:cnt></pre><br />
|}<br />
* Check the created container on the web interface.<br />
<br />
== Create a data contentInstance ==<br />
* Send a HTTP request with the following parameters to create a data content instance resource under the "DATA" container.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR/DATA<br />
|-<br />
|Method|| POST<br />
|-<br />
|Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=4<br />
|-<br />
|Body|| <pre> <br />
<m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<cnf>message</cnf><br />
<con><br />
&amp;lt;obj&amp;gt;<br />
&amp;lt;str name=&amp;quot;appId&amp;quot; val=&amp;quot;MY_SENSOR&amp;quot;/&amp;gt;<br />
&amp;lt;str name=&amp;quot;category&amp;quot; val=&amp;quot;temperature &amp;quot;/&amp;gt;<br />
&amp;lt;int name=&amp;quot;data&amp;quot; val=&amp;quot;27&amp;quot;/&amp;gt;<br />
&amp;lt;int name=&amp;quot;unit&amp;quot; val=&amp;quot;celsius&amp;quot;/&amp;gt;<br />
&amp;lt;/obj&amp;gt;<br />
</con><br />
</m2m:cin><br />
</pre><br />
|}<br />
* Check the created content instance on the web interface.<br />
<br />
== Create a "MY_SENSOR" application using JSON ==<br />
* Since OM2M supports JSON, you can send an HTTP request with the following parameters to create a '''MY_SENSOR''' application on the gateway using JSON instead of XML.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse<br />
|-<br />
|Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/json;ty=2<br />
|-<br />
|Body|| <pre><br />
{<br />
"m2m:ae": {<br />
"api": "app-sensor",<br />
"rr": "false",<br />
"lbl": ["Type/sensor", "Category/temperature", "Location/home"],<br />
"rn": "MY_SENSOR"<br />
}<br />
}<br />
</pre><br />
|}<br />
<br />
You can interact with the system in the same way using JSON instead of XML with an equivalent of the XML body. (Be careful for the Labels to use a JSON array for instance: "lbl":"["label-1", "label-2"].)<br />
<br />
<br />
== Subscribe to MY_SENSOR data ==<br />
* Download the monitor server sample from this link: [https://www.laas.fr/projects/IOT/sites/www.laas.fr.projects.IOT/files/u77/monitor.jar Monitor].<br />
* Start the Monitor server using the following command:<br />
<pre><br />
> java -jar monitor.jar<br />
</pre><br />
* The monitor starts listening on port=1400 and context=/monitor.<br />
[[File:console-monitor.png|center|600px|thumb|Monitor console: the server is started]]<br />
<br />
* Send a HTTP request with the following parameters to create a "Subscription" resource for receive asynchronously events from "MY_SENSOR" application. <br />
* The monitor listening URL (http://127.0.0.1:1400/monitor) should be added on the "nu" tag of the subscription representation.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR/DATA<br />
|-<br />
|Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=23<br />
|-<br />
|Body||<pre><br />
<m2m:sub xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="SUB_MY_SENSOR"><br />
<nu>http://localhost:1400/monitor</nu><br />
<nct>2</nct><br />
</m2m:sub></pre><br />
|}<br />
<br />
* Check the created subscription on the web interface.<br />
<br />
* Create a new event content instance resource under the "DATA" container.<br />
* The new event is published to interested subscribers by the gateway. <br />
* Here is an example of the "Notify" XML representation:<br />
<br />
<pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<nev><br />
<rep rn="cin_name1"><br />
<ty>4</ty><br />
<ri>cin-46677406</ri><br />
<pi>/in-cse/cnt-397256037</pi><br />
<ct>20151104T162611</ct><br />
<lt>20151104T162611</lt><br />
<st>0</st><br />
<cnf>message</cnf><br />
<cs>11</cs><br />
<con>hello world</con><br />
</rep><br />
<rss>1</rss><br />
</nev><br />
<sud>false</sud><br />
<sur>/in-cse/in-name/MY_SENSOR/DATA/SUB_MY_SENSOR</sur><br />
</m2m:sgn><br />
</pre><br />
<br />
* The Monitor receives a "Notify" resource including the new "ContentInstance". <br />
* Remember that the "Notify" resource has a generic structure to support notifications for other type of resources such as "AE", "Container", "Group", "AccessControlPolicy", etc.</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/one/MQTT_Binding&diff=411749OM2M/one/MQTT Binding2016-11-16T13:52:47Z<p>Garzone-eclipse.outlook.fr: /* MQTT Topic */</p>
<hr />
<div>The Eclipse OM2M MQTT Binding implements the TS-0010 MQTT Protocol Binding defined by the oneM2M consortium. The document is available on the [http://onem2m.org/technical/published-documents oneM2M website]. The [https://eclipse.org/paho/ Eclipse Paho] library has been used as a MQTT Client for the Eclipse OM2M MQTT Binding.<br />
<br />
== Configuration ==<br />
<br />
=== Broker ===<br />
<br />
The OM2M MQTT Binding does '''NOT''' include the MQTT Broker. The use of the MQTT binding requires to use an external MQTT Broker. For instance, the Eclipse Mosquitto broker can be used (available at: [http://projects.eclipse.org/projects/technology.mosquitto Mosquitto Website]).<br />
<br />
=== Constants ===<br />
<br />
The following constants can be specified in the OM2M product (<code>org.eclipse.om2m.site.*-cse</code> projects) or directly in the <code>config.ini</code> file in the compiled product (under the <code>configuration</code> folder).<br />
{{CTable}}|<br />
!Constant value<br />
!Usage<br />
!Default value<br />
|-<br />
|org.eclipse.om2m.mqtt.ip<br />
|Broker Host name or IP<br />
|localhost<br />
|-<br />
|org.eclipse.om2m.mqtt.port<br />
|Broker Port<br />
|1883<br />
|-<br />
|org.eclipse.om2m.mqtt.username<br />
|Broker username (optional)<br />
|null<br />
|-<br />
|org.eclipse.om2m.mqtt.password<br />
|Broker password (optional)<br />
|null<br />
|-<br />
|org.eclipse.om2m.mqtt.timeout<br />
|Binding request timeout for the client (second)<br />
|20<br />
|}<br />
<br />
=== Start the binding ===<br />
<br />
At first, the binding is not started in the <code>org.eclipse.om2m.site.in-cse</code> product. To start it, one must retrieve the <code>bundleId</code> of the MQTT binding plugin using the <code>ss mqtt</code> and then start it using the command <code>start &lt;bundleId&gt;</code>. Otherwise, it can be set as auto-start into the OM2M product.<br />
<br />
== oneM2M Requests ==<br />
<br />
oneM2M defines a ''request/response'' paradigm to interact with the CSE Entities. Since the MQTT protocol uses a different paradigm (''publish/subscribe''), an adaptation has to be done.<br />
<br />
To achieve this communication via the MQTT Protocol, a request topic has been defined where the client will be able to send the serialized request. Then the response will be posted on a predefined topic where the client will retrieve the serialized response. All information concerning the authentification, the operation, the response status and other parameters will be held into the serialized request/response.<br />
<br />
=== MQTT Topic ===<br />
<br />
The oneM2M technical specification provides the topics that has to be used for MQTT communication. The serialized request has to be pushed on a specific request topic and the response will be given to a different predefined topic.<br />
<br />
==== Request topic ====<br />
<br />
The request topic is formulated as the following:<br />
<br />
<pre>/oneM2M/req/&lt;originator&gt;/&lt;target-id&gt;/&lt;serialization-format&gt;</pre><br />
The <code>&lt;target-id&gt;</code> shall be the CSE-ID that is listening on the broker (for instance <code>in-cse</code>) and the <code>&lt;originator&gt;</code> correspond to the originator provided into the <code>X-M2M-Origin</code> header.<br />
<br />
Then the last information of the topic is serialization format of the request. The <code>&lt;serialization-format&gt;</code> parameter can have 2 values:<br />
<br />
* <code>xml</code> for XML format<br />
* <code>json</code> for JSON format<br />
<br />
==== Response topic ====<br />
<br />
The response topic is constructed based on the request topic.<br />
<br />
<pre>/oneM2M/rsp/&lt;target-id&gt;/&lt;originator&gt;/&lt;serialization-format&gt;</pre><br />
<br />
=== MQTT Payload ===<br />
<br />
The payload published into the topic is the serialized <code>RequestPrimitive</code> or <code>ResponsePrimitive</code>. The <code>RequestPrimitive</code> correspond to all information needed to formulate a oneM2M request and receive the response into the <code>ResponsePrimitive</code>.<br />
<br />
The main parameters are:<br />
{{CTable}}|<br />
!Parameter short name<br />
!Parameter name<br />
!Usage<br />
|-<br />
|fr<br />
|From<br />
|Originator of the request<br />
|-<br />
|to<br />
|To<br />
|Destination of the request<br />
|-<br />
|op<br />
|Operation<br />
|The operation to perform (CREATE, RETRIEVE, ...)<br />
|-<br />
|rqi<br />
|Request Identifier<br />
|Correlation ID for the request and response<br />
|-<br />
|pc<br />
|Primitive Content<br />
|Content of the request (e.g., ressource to be created)<br />
|-<br />
|ty<br />
|Type<br />
|The type of the resource to be created<br />
|-<br />
|rsc<br />
|Response Status Code <br />
|The oneM2M response status code<br />
|}<br />
<br />
<br />
The Operation values are:<br />
{|<br />
!Operation <br />
!Value<br />
|-<br />
|CREATE<br />
| 1<br />
|-<br />
|RETRIEVE<br />
| 2<br />
|-<br />
|UPDATE<br />
|3<br />
|-<br />
|DELETE<br />
|4<br />
|-<br />
|NOTIFY<br />
|5<br />
|-<br />
|DISCOVERY<br />
|6<br />
|}<br />
<br />
==== Retrieve the CSE Base ====<br />
<br />
The aim of this request is to retrieve the CSE Base resource of the <code>in-cse</code>. The request topic is: <code>/oneM2M/req/AE_123/in-cse/json</code>.<br />
<br />
<pre>{<br />
&quot;m2m:rqp&quot;: {<br />
&quot;fr&quot;: &quot;AE_123&quot;,<br />
&quot;to&quot;: &quot;/in-cse&quot;,<br />
&quot;op&quot;: 2,<br />
&quot;rqi&quot;: 123456<br />
}<br />
}</pre><br />
The response will be published on the topic: <code>/oneM2M/rsp/in-cse/AE_123/json</code>. Response payload is:<br />
<br />
<pre>{<br />
&quot;m2m:rsp&quot; : {<br />
&quot;rsc&quot; : 2000,<br />
&quot;rqi&quot; : &quot;1234&quot;,<br />
&quot;pc&quot; : {<br />
&quot;m2m:cb&quot; : [ {<br />
&quot;rn&quot; : &quot;in-name&quot;,<br />
&quot;ty&quot; : 5,<br />
&quot;ri&quot; : &quot;/in-cse&quot;,<br />
&quot;ct&quot; : &quot;20161116T111621&quot;,<br />
&quot;lt&quot; : &quot;20161116T111621&quot;,<br />
&quot;acpi&quot; : [ &quot;/in-cse/acp-95896161&quot; ],<br />
&quot;cst&quot; : 1,<br />
&quot;csi&quot; : &quot;in-cse&quot;,<br />
&quot;srt&quot; : [ 1, 2, 3, 4, 5, 9, 14, 15, 16, 17, 23 ],<br />
&quot;poa&quot; : [ &quot;http://127.0.0.1:8080/&quot; ]<br />
} ]<br />
},<br />
&quot;to&quot; : &quot;AE_123&quot;,<br />
&quot;fr&quot; : &quot;/in-cse&quot;<br />
}<br />
}</pre><br />
==== Create container ====<br />
<br />
The aim of the request is to create a container named <code>cntName</code>. The Request topic is: <code>/oneM2M/req/AE_123/in-cse/json</code>.<br />
<br />
Payload:<br />
<br />
<pre>{<br />
&quot;m2m:rqp&quot; : {<br />
&quot;fr&quot; : &quot;AE_123&quot;,<br />
&quot;to&quot; : &quot;/in-cse/in-name/AE_123&quot;,<br />
&quot;op&quot; : 1,<br />
&quot;rqi&quot;: 123456,<br />
&quot;pc&quot;: {<br />
&quot;m2m:cnt&quot; : {<br />
&quot;rn&quot;: &quot;cntName&quot;<br />
}<br />
},<br />
&quot;ty&quot;: 3<br />
}<br />
}</pre><br />
The response will be pushed on the topic: <code>/oneM2M/rsp/in-cse/AE_123/json</code>. The payload would be:<br />
<br />
<pre>{<br />
&quot;m2m:rsp&quot; : {<br />
&quot;rsc&quot; : 2001,<br />
&quot;rqi&quot; : &quot;123456&quot;,<br />
&quot;pc&quot; : {<br />
&quot;m2m:cnt&quot; : [ {<br />
&quot;rn&quot; : &quot;cntName&quot;,<br />
&quot;ty&quot; : 3,<br />
&quot;ri&quot; : &quot;/in-cse/cnt-114901069&quot;,<br />
&quot;pi&quot; : &quot;/in-cse&quot;,<br />
&quot;ct&quot; : &quot;20161116T111750&quot;,<br />
&quot;lt&quot; : &quot;20161116T111750&quot;,<br />
&quot;acpi&quot; : [ &quot;/in-cse/acp-95896161&quot; ],<br />
&quot;et&quot; : &quot;20171116T111750&quot;,<br />
&quot;st&quot; : 0,<br />
&quot;mni&quot; : 10,<br />
&quot;mbs&quot; : 10000,<br />
&quot;mia&quot; : 0,<br />
&quot;cni&quot; : 0,<br />
&quot;cbs&quot; : 0,<br />
&quot;ol&quot; : &quot;/in-cse/in-name/AE_123/cntName/ol&quot;,<br />
&quot;la&quot; : &quot;/in-cse/in-name/AE_123/cntName/la&quot;<br />
} ]<br />
},<br />
&quot;to&quot; : &quot;AE_1234&quot;,<br />
&quot;fr&quot; : &quot;/in-cse&quot;<br />
}</pre></div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/one&diff=411717OM2M/one2016-11-15T14:44:43Z<p>Garzone-eclipse.outlook.fr: /* Interesting links */</p>
<hr />
<div>{{Infobox<br />
| name = OM2M<br />
| download = http://wiki.eclipse.org/OM2M/Download<br />
| website = http://eclipse.org/om2m<br />
| list = om2m-dev<br />
| product = OM2M<br />
| newsgroup =<br />
| source = http://git.eclipse.org/c/om2m/org.eclipse.om2m.git<br />
}} <br />
[[File:om2m-logo.png|400px]]<br />
<br />
'''NEW:''' This page covers the oneM2M version of OM2M. If you are looking for documentation for the smartM2M version (v0.8.x) [[OM2M|click here]].<br />
<br />
OM2M provides an open source service platform for M2M interoperability based on the oneM2M standard. OM2M follows a RESTful approach with open interfaces to enable developing services and applications independently of the underlying network. It proposes a modular architecture running on top of an OSGi layer, making it highly extensible via plugins. It supports multiple protocol bindings such as HTTP and CoAP. Various interworking proxies are provided to enable seamless communication with vendor-specific technologies such as Zigbee and Phidgets devices.<br />
<br />
__TOC__<br />
== Introduction ==<br />
<br />
OM2M provides a RESTful API for creating and managing M2M resources. It includes several primitive procedures to enable machines authentication, resources discovery, applications registration, containers management, synchronous and asynchronous communications, access rights authorization, groups organisation, re-targeting, etc.<br />
<br />
This API operates on the following primary resource types:<br />
<br />
* CseBase: describes the hosting CSE, and is the root for all other resources within the hosting CSE.<br />
* remoteCse: stores information related to M2M CSEs residing on other M2M machines after successful mutual authentication. It enables Cses interactions using retargeting operations<br />
* AE: stores information about the Application Entity after a successful registration on the hosting CSE.<br />
* Container: acts as a mediator for data buffering to enable data exchange between applications and CSEs<br />
* AccessControlPolicies: manages permissions and permissions holders to limit and protect the access to the resource tree structure.<br />
* Group: enhances resources tree operations and simplifying the interactions on the API interfaces by adding the grouping feature. It enables an issuer to send one request to a set of receivers instead of sending requests one by one.<br />
* Subscription: stores information related to subscriptions for some resources. It allow subscribers to receive asynchronous notification when an event happens such as the reception of new sensor event or the creation, update, or delete of a resource.<br />
<br />
== Prerequisites ==<br />
* "JAVA 1.7" at minimum is required to run OM2M.<br />
* "Apache Maven 3" is required to build OM2M.<br />
<br />
== Getting started ==<br />
* [[OM2M/one/Clone|Clone and Build the project]] <br />
* [[OM2M/one/Configuration|Config the node(s)]] <br />
* [[OM2M/one/Starting|Start the node(s)]] <br />
* [[OM2M/one/Web_Interface|Web Interface]]<br />
* [[OM2M/one/REST_API|REST API]]<br />
<br />
== Going further - Advanced tutorials ==<br />
* [[OM2M/one/App | Develop oneM2M applications]] <br />
* [[OM2M/one/Developer | Develop an Interworking Proxy Plugin]]<br />
* [[OM2M/one/Advanced_DB|Change database config.]]<br />
<!-- * [[OM2M/one/IPE_Sample|IPE Sample architecture]] and good practices to create your own IPE.--><br />
<br />
== Project Roadmap ==<br />
*The OM2M roadmap is available here [[OM2M/Roadmap|Roadmap ]]<br />
== Interesting links ==<br />
Talks:<br />
* [https://www.youtube.com/watch?v=pPTAdJZpnsk OM2M talk at EclipseCon San Francisco 2014]<br />
* [https://wiki.eclipse.org/images/8/8a/Eclipse_IOT_Day_OM2M.pdf (PDF) OM2M presentation at Eclipse IoT Days Grenoble 2016]<br />
* [https://www.youtube.com/watch?v=CTsqzQH8iwI&index=6&list=PLy7t4z5SYNaRUZ7jOOuzrobwkyYqY7k5p (Video) OM2M at Eclipse IoT Days Grenoble 2016]<br />
<br />
Papers:<br />
* [http://www.sciencedirect.com/science/article/pii/S1877050914007364 OM2M: Extensible ETSI-compliant M2M Service Platform with Self-configuration Capability]<br />
<br />
Specifications:<br />
* [http://www.onem2m.org/library/index.cfm OneM2M standard specifications]<br />
<br />
== Public Documentation ==<br />
<br />
* [[OM2M/Public documentation | Public documentation]] contains all Presentation slides, Videos, Scientific Publications, etc. related to the OM2M project.<br />
<br />
== OM2M Team ==<br />
The OM2M project leads and contributors list is available [[OM2M/Team | here]].</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/one/REST_API&diff=411716OM2M/one/REST API2016-11-15T14:23:32Z<p>Garzone-eclipse.outlook.fr: </p>
<hr />
<div>__TOC__<br />
== Install a REST client ==<br />
* For this section, you need a REST client to send HTTP request (GET, POST, UPDATE, DELETE) to the OM2M platform. <br />
* You can use Postman (http://www.getpostman.com) google chrome extension or any other REST client.<br />
* The authentication is handle using a specific oneM2M header: '''X-M2M-Origin'''. This has to be specified in every request to identify the sender.<br />
<br />
== Retrieve a resource == <br />
* HTTP request:<br />
{{CTable}}<br />
| Field|| Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse<br />
|-<br />
| Method|| GET<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Accept: application/xml<br />
|-<br />
| Body|| (empty)<br />
|}<br />
<br />
* HTTP response:<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|Status|| 200 OK<br />
|-<br />
|Body|| <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:cb xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="in-name"><br />
<ty>5</ty><br />
<ri>/in-cse</ri><br />
<ct>20151104T150228</ct><br />
<lt>20151104T150228</lt><br />
<acpi>/in-cse/acp-563660429</acpi><br />
<cst>1</cst><br />
<csi>in-cse</csi><br />
<srt>1 2 3 4 5 9 14 15 16 17 23</srt><br />
<poa>http://127.0.0.1:8080/</poa><br />
</m2m:cb><br />
</pre><br />
|}<br />
<br />
== Create a "MY_SENSOR" application ==<br />
* Send a HTTP request with the following parameters to create a '''MY_SENSOR''' application on the gateway.<br />
{{CTable}}<br />
* In the creation we have two important headers:<br />
** '''Content-Type''': this header has 2 informations seperated by a semicolon<br />
*** The format of the exchange, here "application/xml"<br />
*** The resource type to be created, here "ty=2" (2 for AE, see oneM2M spec TS-0004 (V2.7.1), Table 6.3.4.2.1-1)<br />
** '''X-M2M-NM''': the name of the resource to be created<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse<br />
|-<br />
|Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=2<br />
|-<br />
|Body|| <pre><br />
<m2m:ae xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="MY_SENSOR" ><br />
<api>app-sensor</api><br />
<lbl>Type/sensor Category/temperature Location/home</lbl><br />
<rr>false</rr><br />
</m2m:ae></pre><br />
|}<br />
<br />
* HTTP response:<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
| Status || 201 Created<br />
|-<br />
|Headers || Content-Location: /in-cse/ae-CAE449907766<br />
|-<br />
| Body || <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:ae xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="MY_SENSOR"><br />
<ty>2</ty><br />
<ri>ae-CAE449907766</ri><br />
<pi>/in-cse</pi><br />
<ct>20151104T151858</ct><br />
<lt>20151104T151858</lt><br />
<lbl>Type/sensor Category/temperature Location/home</lbl><br />
<acpi>/in-cse/acp-89704715</acpi><br />
<api>app-sensor</api><br />
<aei>CAE449907766</aei><br />
<rr>false</rr><br />
</m2m:ae><br />
</pre><br />
|}<br />
<!--* Here, the application has been created and can be accessed using 2 different URIs: <br />
** '''Unstructured URI''': this URI is the '''ri''' node in the AE representation or present in the '''Content-Location''' header in the creation response "/<cse-id>/<id-of-the-resource>". In our case we have "/in-cse/ae-CAE449907766"<br />
** '''Structured URI''': this URI use the names of the resources hierarchically to get the resource "/<cse-id>/<cse-name>/<hierarchy-of-resource-names>". Here we will simply have "/in-cse/in-name/MY-SENSOR".<br />
The difference between the unstructured URI and the structured one consists in the presence (or not) of the CSE name. Examples:<br />
unstructured URI: "/<cse-id>/<id-of-the-resource>", for instance: "/in-cse/ae-123".<br />
structured URI: "/in-cse/in-name/<hierarchy-of-resource-names>", for instance: "/in-cse/in-name/name1/name2/name3".<br />
--><br />
* You can check the created application on the web interface.<br />
<br />
== Discover resources based on their labels ==<br />
* You can discover available resources based on their search strings using the discovery resource. The '''fu''' parameter (stands for "Filter Usage") indicate that it is a discovery request. The '''lbl''' ("Label") indicate the specific label you what to filter.<br />
* HTTP request: <br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse?fu=1&lbl=Type/sensor<br />
|-<br />
| Method|| GET<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Accept: application/xml<br />
|-<br />
|Body|| (empty)<br />
|}<br />
<br />
* HTTP response:<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|Status|| 200 OK<br />
|-<br />
|Body|| <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:disres xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<ref ty="2"> <uri-of-the-resource> </ref><br />
</m2m:disres></pre><br />
|}<br />
<br />
== Create a DESCRIPTOR container ==<br />
* Send a HTTP request with the following parameters to create a '''DESCRIPTOR''' container resource under the '''MY_SENSOR''' application.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR<br />
|-<br />
| Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=3<br />
|-<br />
|Body|| <pre><br />
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="DESCRIPTOR"><br />
</m2m:cnt></pre><br />
|}<br />
<br />
* HTTP response<br />
{{CTable}}<br />
|Field || Value<br />
|-<br />
| Status || 201 Created<br />
|-<br />
| Header || Content-Location: /in-cse/cnt-478855064<br />
|-<br />
| Body || <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="DESCRIPTOR"><br />
<ty>3</ty><br />
<ri>cnt-478855064</ri><br />
<pi>/in-cse/ae-CAE449907766</pi><br />
<ct>20151104T155844</ct><br />
<lt>20151104T155844</lt><br />
<acpi>/in-cse/acp-89704715</acpi><br />
<cni>0</cni><br />
<cbs>0</cbs><br />
</m2m:cnt><br />
</pre><br />
|}<br />
<!--* As the AE, there is two ways to access the resource:<br />
** '''Unstructured URI''': which is '/in-cse/cnt-478855064'<br />
** '''Structure URI''': which is the Structured URI of the AE plus the name of the container, in our case "/in-cse/in-name/MY_SENSOR/DESCRIPTOR"--><br />
* Check the created container on the web interface.<br />
<br />
== Create a description contentInstance ==<br />
* Send a HTTP request with the following parameters to create a description content instance resource under the "DESCRIPTOR" container.<br />
{{CTable}}<br />
| Field || Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR/DESCRIPTOR<br />
|-<br />
| Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=4<br />
|-<br />
| Body||<pre> <br />
<m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<cnf>application/xml</cnf><br />
<con><br />
&amp;lt;obj&amp;gt;<br />
&amp;lt;str name=&amp;quot;type&amp;quot; val=&amp;quot;Temperature_Sensor&amp;quot;/&amp;gt;<br />
&amp;lt;str name=&amp;quot;location&amp;quot; val=&amp;quot;Home&amp;quot;/&amp;gt;<br />
&amp;lt;str name=&amp;quot;appId&amp;quot; val=&amp;quot;MY_SENSOR&amp;quot;/&amp;gt;<br />
&amp;lt;op name=&amp;quot;getValue&amp;quot; href=&amp;quot;/in-cse/in-name/MY_SENSOR/DATA/la&amp;quot; <br />
in=&amp;quot;obix:Nil&amp;quot; out=&amp;quot;obix:Nil&amp;quot; is=&amp;quot;retrieve&amp;quot;/&amp;gt;<br />
&amp;lt;/obj&amp;gt;<br />
</con><br />
</m2m:cin><br />
</pre><br />
|}<br />
* Check the created content instance on the web interface.<br />
<br />
== Create a DATA container == <br />
* Send a HTTP request with the following parameters to create a "DATA" container resource under the "MY_SENSOR" application.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR<br />
|-<br />
| Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=3<br />
|-<br />
|Body|| <pre><br />
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="DATA"><br />
</m2m:cnt></pre><br />
|}<br />
* Check the created container on the web interface.<br />
<br />
== Create a data contentInstance ==<br />
* Send a HTTP request with the following parameters to create a data content instance resource under the "DATA" container.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR/DATA<br />
|-<br />
|Method|| POST<br />
|-<br />
|Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=4<br />
|-<br />
|Body|| <pre> <br />
<m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<cnf>message</cnf><br />
<con><br />
&amp;lt;obj&amp;gt;<br />
&amp;lt;str name=&amp;quot;appId&amp;quot; val=&amp;quot;MY_SENSOR&amp;quot;/&amp;gt;<br />
&amp;lt;str name=&amp;quot;category&amp;quot; val=&amp;quot;temperature &amp;quot;/&amp;gt;<br />
&amp;lt;int name=&amp;quot;data&amp;quot; val=&amp;quot;27&amp;quot;/&amp;gt;<br />
&amp;lt;int name=&amp;quot;unit&amp;quot; val=&amp;quot;celsius&amp;quot;/&amp;gt;<br />
&amp;lt;/obj&amp;gt;<br />
</con><br />
</m2m:cin><br />
</pre><br />
|}<br />
* Check the created content instance on the web interface.<br />
<br />
== Create a "MY_SENSOR" application using JSON ==<br />
* Since OM2M supports JSON, you can send an HTTP request with the following parameters to create a '''MY_SENSOR''' application on the gateway using JSON instead of XML.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse<br />
|-<br />
|Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/json;ty=2<br />
|-<br />
|Body|| <pre><br />
{<br />
"m2m:ae": {<br />
"api": "app-sensor",<br />
"rr": "false",<br />
"lbl": ["Type/sensor", "Category/temperature", "Location/home"],<br />
"rn": "MY_SENSOR"<br />
}<br />
}<br />
</pre><br />
|}<br />
<br />
You can interact with the system in the same way using JSON instead of XML with an equivalent of the XML body. (Be careful for the Labels to use a JSON array for instance: "lbl":"["label-1", "label-2"].)<br />
<br />
<br />
== Subscribe to MY_SENSOR data ==<br />
* Download the monitor server sample from this link: [https://www.laas.fr/projects/IOT/sites/www.laas.fr.projects.IOT/files/u77/monitor.jar Monitor].<br />
* Start the Monitor server using the following command:<br />
<pre><br />
> java -jar monitor.jar<br />
</pre><br />
* The monitor starts listening on port=1400 and context=/monitor.<br />
[[File:console-monitor.png|center|600px|thumb|Monitor console: the server is started]]<br />
<br />
* Send a HTTP request with the following parameters to create a "Subscription" resource for receive asynchronously events from "MY_SENSOR" application. <br />
* The monitor listening URL (http://127.0.0.1:1400/monitor) should be added on the "nu" tag of the subscription representation.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR/DATA<br />
|-<br />
|Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=23<br />
|-<br />
|Body||<pre><br />
<m2m:sub xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="SUB_MY_SENSOR"><br />
<nu>http://localhost:1400/monitor</nu><br />
<nct>2</nct><br />
</m2m:sub></pre><br />
|}<br />
<br />
* Check the created subscription on the web interface.<br />
<br />
* Create a new event content instance resource under the "DATA" container.<br />
* The new event is published to interested subscribers by the gateway. <br />
* Here is an example of the "Notify" XML representation:<br />
<br />
<pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<nev><br />
<rep rn="cin_name1"><br />
<ty>4</ty><br />
<ri>cin-46677406</ri><br />
<pi>/in-cse/cnt-397256037</pi><br />
<ct>20151104T162611</ct><br />
<lt>20151104T162611</lt><br />
<st>0</st><br />
<cnf>message</cnf><br />
<cs>11</cs><br />
<con>hello world</con><br />
</rep><br />
<rss>1</rss><br />
</nev><br />
<sud>false</sud><br />
<sur>/in-cse/in-name/MY_SENSOR/DATA/SUB_MY_SENSOR</sur><br />
</m2m:sgn><br />
</pre><br />
<br />
* The Monitor receives a "Notify" resource including the new "ContentInstance". <br />
* Remember that the "Notify" resource has a generic structure to support notifications for other type of resources such as "AE", "Container", "Group", "AccessControlPolicy", etc.</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/one/REST_API&diff=411713OM2M/one/REST API2016-11-15T13:57:27Z<p>Garzone-eclipse.outlook.fr: /* Create a DATA container */</p>
<hr />
<div>__TOC__<br />
== Install a REST client ==<br />
* For this section, you need a REST client to send HTTP request (GET, POST, UPDATE, DELETE) to the OM2M platform. <br />
* You can use Postman (http://www.getpostman.com) google chrome extension or any other REST client.<br />
* The authentication is handle using a specific oneM2M header: '''X-M2M-Origin'''. This has to be specified in every request to identify the sender.<br />
<br />
== Retrieve a resource == <br />
* HTTP request:<br />
{{CTable}}<br />
| Field|| Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse<br />
|-<br />
| Method|| GET<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Accept: application/xml<br />
|-<br />
| Body|| (empty)<br />
|}<br />
<br />
* HTTP response:<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|Status|| 200 OK<br />
|-<br />
|Body|| <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:cb xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="in-name"><br />
<ty>5</ty><br />
<ri>/in-cse</ri><br />
<ct>20151104T150228</ct><br />
<lt>20151104T150228</lt><br />
<acpi>/in-cse/acp-563660429</acpi><br />
<cst>1</cst><br />
<csi>in-cse</csi><br />
<srt>1 2 3 4 5 9 14 15 16 17 23</srt><br />
<poa>http://127.0.0.1:8080/</poa><br />
</m2m:cb><br />
</pre><br />
|}<br />
<br />
== Create a "MY_SENSOR" application ==<br />
* Send a HTTP request with the following parameters to create a '''MY_SENSOR''' application on the gateway.<br />
{{CTable}}<br />
* In the creation we have two important headers:<br />
** '''Content-Type''': this header has 2 informations seperated by a semicolon<br />
*** The format of the exchange, here "application/xml"<br />
*** The resource type to be created, here "ty=2" (2 for AE, see oneM2M spec TS-0004 (V2.7.1), Table 6.3.4.2.1-1)<br />
** '''X-M2M-NM''': the name of the resource to be created<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse<br />
|-<br />
|Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=2<br />
|-<br />
|Body|| <pre><br />
<m2m:ae xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="MY_SENSOR" ><br />
<api>app-sensor</api><br />
<lbl>Type/sensor Category/temperature Location/home</lbl><br />
<rr>false</rr><br />
</m2m:ae></pre><br />
|}<br />
<br />
* HTTP response:<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
| Status || 201 Created<br />
|-<br />
|Headers || Content-Location: /in-cse/ae-CAE449907766<br />
|-<br />
| Body || <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:ae xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="MY_SENSOR"><br />
<ty>2</ty><br />
<ri>ae-CAE449907766</ri><br />
<pi>/in-cse</pi><br />
<ct>20151104T151858</ct><br />
<lt>20151104T151858</lt><br />
<lbl>Type/sensor Category/temperature Location/home</lbl><br />
<acpi>/in-cse/acp-89704715</acpi><br />
<api>app-sensor</api><br />
<aei>CAE449907766</aei><br />
<rr>false</rr><br />
</m2m:ae><br />
</pre><br />
|}<br />
<!--* Here, the application has been created and can be accessed using 2 different URIs: <br />
** '''Unstructured URI''': this URI is the '''ri''' node in the AE representation or present in the '''Content-Location''' header in the creation response "/<cse-id>/<id-of-the-resource>". In our case we have "/in-cse/ae-CAE449907766"<br />
** '''Structured URI''': this URI use the names of the resources hierarchically to get the resource "/<cse-id>/<cse-name>/<hierarchy-of-resource-names>". Here we will simply have "/in-cse/in-name/MY-SENSOR".<br />
The difference between the unstructured URI and the structured one consists in the presence (or not) of the CSE name. Examples:<br />
unstructured URI: "/<cse-id>/<id-of-the-resource>", for instance: "/in-cse/ae-123".<br />
structured URI: "/in-cse/in-name/<hierarchy-of-resource-names>", for instance: "/in-cse/in-name/name1/name2/name3".<br />
--><br />
* You can check the created application on the web interface.<br />
<br />
== Discover resources based on their labels ==<br />
* You can discover available resources based on their search strings using the discovery resource. The '''fu''' parameter (stands for "Filter Usage") indicate that it is a discovery request. The '''lbl''' ("Label") indicate the specific label you what to filter.<br />
* HTTP request: <br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse?fu=1&lbl=Type/sensor<br />
|-<br />
| Method|| GET<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Accept: application/xml<br />
|-<br />
|Body|| (empty)<br />
|}<br />
<br />
* HTTP response:<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|Status|| 200 OK<br />
|-<br />
|Body|| <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:disres xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<ref ty="2"> <uri-of-the-resource> </ref><br />
</m2m:disres></pre><br />
|}<br />
<br />
== Create a DESCRIPTOR container ==<br />
* Send a HTTP request with the following parameters to create a '''DESCRIPTOR''' container resource under the '''MY_SENSOR''' application.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR<br />
|-<br />
| Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=3<br />
|-<br />
|Body|| <pre><br />
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="DESCRIPTOR"><br />
</m2m:cnt></pre><br />
|}<br />
<br />
* HTTP response<br />
{{CTable}}<br />
|Field || Value<br />
|-<br />
| Status || 201 Created<br />
|-<br />
| Header || Content-Location: /in-cse/cnt-478855064<br />
|-<br />
| Body || <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="DESCRIPTOR"><br />
<ty>3</ty><br />
<ri>cnt-478855064</ri><br />
<pi>/in-cse/ae-CAE449907766</pi><br />
<ct>20151104T155844</ct><br />
<lt>20151104T155844</lt><br />
<acpi>/in-cse/acp-89704715</acpi><br />
<cni>0</cni><br />
<cbs>0</cbs><br />
</m2m:cnt><br />
</pre><br />
|}<br />
<!--* As the AE, there is two ways to access the resource:<br />
** '''Unstructured URI''': which is '/in-cse/cnt-478855064'<br />
** '''Structure URI''': which is the Structured URI of the AE plus the name of the container, in our case "/in-cse/in-name/MY_SENSOR/DESCRIPTOR"--><br />
* Check the created container on the web interface.<br />
<br />
== Create a description contentInstance ==<br />
* Send a HTTP request with the following parameters to create a description content instance resource under the "DESCRIPTOR" container.<br />
{{CTable}}<br />
| Field || Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR/DESCRIPTOR<br />
|-<br />
| Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=4<br />
|-<br />
| Body||<pre> <br />
<m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<cnf>application/xml</cnf><br />
<con><br />
&amp;lt;obj&amp;gt;<br />
&amp;lt;str name=&amp;quot;type&amp;quot; val=&amp;quot;Temperature_Sensor&amp;quot;/&amp;gt;<br />
&amp;lt;str name=&amp;quot;location&amp;quot; val=&amp;quot;Home&amp;quot;/&amp;gt;<br />
&amp;lt;str name=&amp;quot;appId&amp;quot; val=&amp;quot;MY_SENSOR&amp;quot;/&amp;gt;<br />
&amp;lt;op name=&amp;quot;getValue&amp;quot; href=&amp;quot;/in-cse/in-name/MY_SENSOR/DATA/la&amp;quot; <br />
in=&amp;quot;obix:Nil&amp;quot; out=&amp;quot;obix:Nil&amp;quot; is=&amp;quot;retrieve&amp;quot;/&amp;gt;<br />
&amp;lt;/obj&amp;gt;<br />
</con><br />
</m2m:cin><br />
</pre><br />
|}<br />
* Check the created content instance on the web interface.<br />
<br />
== Create a DATA container == <br />
* Send a HTTP request with the following parameters to create a "DATA" container resource under the "MY_SENSOR" application.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR<br />
|-<br />
| Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=3<br />
|-<br />
|Body|| <pre><br />
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="DATA"><br />
</m2m:cnt></pre><br />
|}<br />
* Check the created container on the web interface.<br />
<br />
== Create a data contentInstance ==<br />
* Send a HTTP request with the following parameters to create a data content instance resource under the "DATA" container.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR/DATA<br />
|-<br />
|Method|| POST<br />
|-<br />
|Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=4<br />
|-<br />
|Body|| <pre> <br />
<m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<cnf>message</cnf><br />
<con><br />
&amp;lt;obj&amp;gt;<br />
&amp;lt;str name=&amp;quot;appId&amp;quot; val=&amp;quot;MY_SENSOR&amp;quot;/&amp;gt;<br />
&amp;lt;str name=&amp;quot;category&amp;quot; val=&amp;quot;temperature &amp;quot;/&amp;gt;<br />
&amp;lt;int name=&amp;quot;data&amp;quot; val=&amp;quot;27&amp;quot;/&amp;gt;<br />
&amp;lt;int name=&amp;quot;unit&amp;quot; val=&amp;quot;celsius&amp;quot;/&amp;gt;<br />
&amp;lt;/obj&amp;gt;<br />
</con><br />
</m2m:cin><br />
</pre><br />
|}<br />
* Check the created content instance on the web interface.<br />
<br />
== Subscribe to MY_SENSOR data ==<br />
* Download the monitor server sample from this link: [https://www.laas.fr/projects/IOT/sites/www.laas.fr.projects.IOT/files/u77/monitor.jar Monitor].<br />
* Start the Monitor server using the following command:<br />
<pre><br />
> java -jar monitor.jar<br />
</pre><br />
* The monitor starts listening on port=1400 and context=/monitor.<br />
[[File:console-monitor.png|center|600px|thumb|Monitor console: the server is started]]<br />
<br />
* Send a HTTP request with the following parameters to create a "Subscription" resource for receive asynchronously events from "MY_SENSOR" application. <br />
* The monitor listening URL (http://127.0.0.1:1400/monitor) should be added on the "nu" tag of the subscription representation.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR/DATA<br />
|-<br />
|Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=23<br />
|-<br />
|Body||<pre><br />
<m2m:sub xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="SUB_MY_SENSOR"><br />
<nu>http://localhost:1400/monitor</nu><br />
<nct>2</nct><br />
</m2m:sub></pre><br />
|}<br />
<br />
* Check the created subscription on the web interface.<br />
<br />
* Create a new event content instance resource under the "DATA" container.<br />
* The new event is published to interested subscribers by the gateway. <br />
* Here is an example of the "Notify" XML representation:<br />
<br />
<pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<nev><br />
<rep rn="cin_name1"><br />
<ty>4</ty><br />
<ri>cin-46677406</ri><br />
<pi>/in-cse/cnt-397256037</pi><br />
<ct>20151104T162611</ct><br />
<lt>20151104T162611</lt><br />
<st>0</st><br />
<cnf>message</cnf><br />
<cs>11</cs><br />
<con>hello world</con><br />
</rep><br />
<rss>1</rss><br />
</nev><br />
<sud>false</sud><br />
<sur>/in-cse/in-name/MY_SENSOR/DATA/SUB_MY_SENSOR</sur><br />
</m2m:sgn><br />
</pre><br />
<br />
* The Monitor receives a "Notify" resource including the new "ContentInstance". <br />
* Remember that the "Notify" resource has a generic structure to support notifications for other type of resources such as "AE", "Container", "Group", "AccessControlPolicy", etc.</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/one/REST_API&diff=411701OM2M/one/REST API2016-11-14T10:26:35Z<p>Garzone-eclipse.outlook.fr: /* Create a description contentInstance */</p>
<hr />
<div>__TOC__<br />
== Install a REST client ==<br />
* For this section, you need a REST client to send HTTP request (GET, POST, UPDATE, DELETE) to the OM2M platform. <br />
* You can use Postman (http://www.getpostman.com) google chrome extension or any other REST client.<br />
* The authentication is handle using a specific oneM2M header: '''X-M2M-Origin'''. This has to be specified in every request to identify the sender.<br />
<br />
== Retrieve a resource == <br />
* HTTP request:<br />
{{CTable}}<br />
| Field|| Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse<br />
|-<br />
| Method|| GET<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Accept: application/xml<br />
|-<br />
| Body|| (empty)<br />
|}<br />
<br />
* HTTP response:<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|Status|| 200 OK<br />
|-<br />
|Body|| <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:cb xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="in-name"><br />
<ty>5</ty><br />
<ri>/in-cse</ri><br />
<ct>20151104T150228</ct><br />
<lt>20151104T150228</lt><br />
<acpi>/in-cse/acp-563660429</acpi><br />
<cst>1</cst><br />
<csi>in-cse</csi><br />
<srt>1 2 3 4 5 9 14 15 16 17 23</srt><br />
<poa>http://127.0.0.1:8080/</poa><br />
</m2m:cb><br />
</pre><br />
|}<br />
<br />
== Create a "MY_SENSOR" application ==<br />
* Send a HTTP request with the following parameters to create a '''MY_SENSOR''' application on the gateway.<br />
{{CTable}}<br />
* In the creation we have two important headers:<br />
** '''Content-Type''': this header has 2 informations seperated by a semicolon<br />
*** The format of the exchange, here "application/xml"<br />
*** The resource type to be created, here "ty=2" (2 for AE, see oneM2M spec TS-0004 (V2.7.1), Table 6.3.4.2.1-1)<br />
** '''X-M2M-NM''': the name of the resource to be created<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse<br />
|-<br />
|Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=2<br />
|-<br />
|Body|| <pre><br />
<m2m:ae xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="MY_SENSOR" ><br />
<api>app-sensor</api><br />
<lbl>Type/sensor Category/temperature Location/home</lbl><br />
<rr>false</rr><br />
</m2m:ae></pre><br />
|}<br />
<br />
* HTTP response:<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
| Status || 201 Created<br />
|-<br />
|Headers || Content-Location: /in-cse/ae-CAE449907766<br />
|-<br />
| Body || <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:ae xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="MY_SENSOR"><br />
<ty>2</ty><br />
<ri>ae-CAE449907766</ri><br />
<pi>/in-cse</pi><br />
<ct>20151104T151858</ct><br />
<lt>20151104T151858</lt><br />
<lbl>Type/sensor Category/temperature Location/home</lbl><br />
<acpi>/in-cse/acp-89704715</acpi><br />
<api>app-sensor</api><br />
<aei>CAE449907766</aei><br />
<rr>false</rr><br />
</m2m:ae><br />
</pre><br />
|}<br />
<!--* Here, the application has been created and can be accessed using 2 different URIs: <br />
** '''Unstructured URI''': this URI is the '''ri''' node in the AE representation or present in the '''Content-Location''' header in the creation response "/<cse-id>/<id-of-the-resource>". In our case we have "/in-cse/ae-CAE449907766"<br />
** '''Structured URI''': this URI use the names of the resources hierarchically to get the resource "/<cse-id>/<cse-name>/<hierarchy-of-resource-names>". Here we will simply have "/in-cse/in-name/MY-SENSOR".<br />
The difference between the unstructured URI and the structured one consists in the presence (or not) of the CSE name. Examples:<br />
unstructured URI: "/<cse-id>/<id-of-the-resource>", for instance: "/in-cse/ae-123".<br />
structured URI: "/in-cse/in-name/<hierarchy-of-resource-names>", for instance: "/in-cse/in-name/name1/name2/name3".<br />
--><br />
* You can check the created application on the web interface.<br />
<br />
== Discover resources based on their labels ==<br />
* You can discover available resources based on their search strings using the discovery resource. The '''fu''' parameter (stands for "Filter Usage") indicate that it is a discovery request. The '''lbl''' ("Label") indicate the specific label you what to filter.<br />
* HTTP request: <br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse?fu=1&lbl=Type/sensor<br />
|-<br />
| Method|| GET<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Accept: application/xml<br />
|-<br />
|Body|| (empty)<br />
|}<br />
<br />
* HTTP response:<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|Status|| 200 OK<br />
|-<br />
|Body|| <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:disres xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<ref ty="2"> <uri-of-the-resource> </ref><br />
</m2m:disres></pre><br />
|}<br />
<br />
== Create a DESCRIPTOR container ==<br />
* Send a HTTP request with the following parameters to create a '''DESCRIPTOR''' container resource under the '''MY_SENSOR''' application.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR<br />
|-<br />
| Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=3<br />
|-<br />
|Body|| <pre><br />
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="DESCRIPTOR"><br />
</m2m:cnt></pre><br />
|}<br />
<br />
* HTTP response<br />
{{CTable}}<br />
|Field || Value<br />
|-<br />
| Status || 201 Created<br />
|-<br />
| Header || Content-Location: /in-cse/cnt-478855064<br />
|-<br />
| Body || <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="DESCRIPTOR"><br />
<ty>3</ty><br />
<ri>cnt-478855064</ri><br />
<pi>/in-cse/ae-CAE449907766</pi><br />
<ct>20151104T155844</ct><br />
<lt>20151104T155844</lt><br />
<acpi>/in-cse/acp-89704715</acpi><br />
<cni>0</cni><br />
<cbs>0</cbs><br />
</m2m:cnt><br />
</pre><br />
|}<br />
<!--* As the AE, there is two ways to access the resource:<br />
** '''Unstructured URI''': which is '/in-cse/cnt-478855064'<br />
** '''Structure URI''': which is the Structured URI of the AE plus the name of the container, in our case "/in-cse/in-name/MY_SENSOR/DESCRIPTOR"--><br />
* Check the created container on the web interface.<br />
<br />
== Create a description contentInstance ==<br />
* Send a HTTP request with the following parameters to create a description content instance resource under the "DESCRIPTOR" container.<br />
{{CTable}}<br />
| Field || Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR/DESCRIPTOR<br />
|-<br />
| Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=4<br />
|-<br />
| Body||<pre> <br />
<m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<cnf>application/xml</cnf><br />
<con><br />
&amp;lt;obj&amp;gt;<br />
&amp;lt;str name=&amp;quot;type&amp;quot; val=&amp;quot;Temperature_Sensor&amp;quot;/&amp;gt;<br />
&amp;lt;str name=&amp;quot;location&amp;quot; val=&amp;quot;Home&amp;quot;/&amp;gt;<br />
&amp;lt;str name=&amp;quot;appId&amp;quot; val=&amp;quot;MY_SENSOR&amp;quot;/&amp;gt;<br />
&amp;lt;op name=&amp;quot;getValue&amp;quot; href=&amp;quot;/in-cse/in-name/MY_SENSOR/DATA/la&amp;quot; <br />
in=&amp;quot;obix:Nil&amp;quot; out=&amp;quot;obix:Nil&amp;quot; is=&amp;quot;retrieve&amp;quot;/&amp;gt;<br />
&amp;lt;/obj&amp;gt;<br />
</con><br />
</m2m:cin><br />
</pre><br />
|}<br />
* Check the created content instance on the web interface.<br />
<br />
== Create a DATA container == <br />
* Send a HTTP request with the following parameters to create a "DATA" container resource under the "MY_SENSOR" application.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR<br />
|-<br />
| Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=3 <br> X-M2M-NM: DATA<br />
|-<br />
|Body|| <pre><br />
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
</m2m:cnt></pre><br />
|}<br />
* Check the created container on the web interface.<br />
<br />
== Create a data contentInstance ==<br />
* Send a HTTP request with the following parameters to create a data content instance resource under the "DATA" container.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR/DATA<br />
|-<br />
|Method|| POST<br />
|-<br />
|Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=4<br />
|-<br />
|Body|| <pre> <br />
<m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<cnf>message</cnf><br />
<con><br />
&amp;lt;obj&amp;gt;<br />
&amp;lt;str name=&amp;quot;appId&amp;quot; val=&amp;quot;MY_SENSOR&amp;quot;/&amp;gt;<br />
&amp;lt;str name=&amp;quot;category&amp;quot; val=&amp;quot;temperature &amp;quot;/&amp;gt;<br />
&amp;lt;int name=&amp;quot;data&amp;quot; val=&amp;quot;27&amp;quot;/&amp;gt;<br />
&amp;lt;int name=&amp;quot;unit&amp;quot; val=&amp;quot;celsius&amp;quot;/&amp;gt;<br />
&amp;lt;/obj&amp;gt;<br />
</con><br />
</m2m:cin><br />
</pre><br />
|}<br />
* Check the created content instance on the web interface.<br />
<br />
== Subscribe to MY_SENSOR data ==<br />
* Download the monitor server sample from this link: [https://www.laas.fr/projects/IOT/sites/www.laas.fr.projects.IOT/files/u77/monitor.jar Monitor].<br />
* Start the Monitor server using the following command:<br />
<pre><br />
> java -jar monitor.jar<br />
</pre><br />
* The monitor starts listening on port=1400 and context=/monitor.<br />
[[File:console-monitor.png|center|600px|thumb|Monitor console: the server is started]]<br />
<br />
* Send a HTTP request with the following parameters to create a "Subscription" resource for receive asynchronously events from "MY_SENSOR" application. <br />
* The monitor listening URL (http://127.0.0.1:1400/monitor) should be added on the "nu" tag of the subscription representation.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR/DATA<br />
|-<br />
|Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=23<br />
|-<br />
|Body||<pre><br />
<m2m:sub xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="SUB_MY_SENSOR"><br />
<nu>http://localhost:1400/monitor</nu><br />
<nct>2</nct><br />
</m2m:sub></pre><br />
|}<br />
<br />
* Check the created subscription on the web interface.<br />
<br />
* Create a new event content instance resource under the "DATA" container.<br />
* The new event is published to interested subscribers by the gateway. <br />
* Here is an example of the "Notify" XML representation:<br />
<br />
<pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<nev><br />
<rep rn="cin_name1"><br />
<ty>4</ty><br />
<ri>cin-46677406</ri><br />
<pi>/in-cse/cnt-397256037</pi><br />
<ct>20151104T162611</ct><br />
<lt>20151104T162611</lt><br />
<st>0</st><br />
<cnf>message</cnf><br />
<cs>11</cs><br />
<con>hello world</con><br />
</rep><br />
<rss>1</rss><br />
</nev><br />
<sud>false</sud><br />
<sur>/in-cse/in-name/MY_SENSOR/DATA/SUB_MY_SENSOR</sur><br />
</m2m:sgn><br />
</pre><br />
<br />
* The Monitor receives a "Notify" resource including the new "ContentInstance". <br />
* Remember that the "Notify" resource has a generic structure to support notifications for other type of resources such as "AE", "Container", "Group", "AccessControlPolicy", etc.</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/one&diff=404525OM2M/one2016-04-26T15:05:58Z<p>Garzone-eclipse.outlook.fr: </p>
<hr />
<div>{{Infobox<br />
| name = OM2M<br />
| download = http://wiki.eclipse.org/OM2M/Download<br />
| website = http://eclipse.org/om2m<br />
| list = om2m-dev<br />
| product = OM2M<br />
| newsgroup =<br />
| source = http://git.eclipse.org/c/om2m/org.eclipse.om2m.git<br />
}} <br />
[[File:om2m-logo.png|400px]]<br />
<br />
'''NEW:''' This page covers the oneM2M version of OM2M. If you are looking for documentation for the smartM2M version (v0.8.x) [[OM2M|click here]].<br />
<br />
OM2M provides an open source service platform for M2M interoperability based on the oneM2M standard. OM2M follows a RESTful approach with open interfaces to enable developing services and applications independently of the underlying network. It proposes a modular architecture running on top of an OSGi layer, making it highly extensible via plugins. It supports multiple protocol bindings such as HTTP and CoAP. Various interworking proxies are provided to enable seamless communication with vendor-specific technologies such as Zigbee and Phidgets devices.<br />
<br />
__TOC__<br />
== Introduction ==<br />
<br />
OM2M provides a RESTful API for creating and managing M2M resources. It includes several primitive procedures to enable machines authentication, resources discovery, applications registration, containers management, synchronous and asynchronous communications, access rights authorization, groups organisation, re-targeting, etc.<br />
<br />
This API operates on the following primary resource types:<br />
<br />
* CseBase: describes the hosting CSE, and is the root for all other resources within the hosting CSE.<br />
* remoteCse: stores information related to M2M CSEs residing on other M2M machines after successful mutual authentication. It enables Cses interactions using retargeting operations<br />
* AE: stores information about the Application Entity after a successful registration on the hosting CSE.<br />
* Container: acts as a mediator for data buffering to enable data exchange between applications and CSEs<br />
* AccessControlPolicies: manages permissions and permissions holders to limit and protect the access to the resource tree structure.<br />
* Group: enhances resources tree operations and simplifying the interactions on the API interfaces by adding the grouping feature. It enables an issuer to send one request to a set of receivers instead of sending requests one by one.<br />
* Subscription: stores information related to subscriptions for some resources. It allow subscribers to receive asynchronous notification when an event happens such as the reception of new sensor event or the creation, update, or delete of a resource.<br />
<br />
== Prerequisites ==<br />
* "JAVA 1.7" is required to run OM2M.<br />
* "Apache Maven 3" is required to build OM2M.<br />
<br />
== Getting started ==<br />
* [[OM2M/one/Clone|Clone & Build]] the project<br />
* [[OM2M/one/Configuration|Config]] the node(s)<br />
* [[OM2M/one/Starting|Start]] the node(s)<br />
* [[OM2M/one/Web_Interface|Web Interface]]<br />
* [[OM2M/one/REST_API|REST API]]<br />
<br />
== Going further - Advanced tutorials ==<br />
* [[OM2M/one/Developer|Add & dev. your plugin]]<br />
* [[OM2M/one/Advanced_DB|Change database config.]]<br />
* [[OM2M/one/IPE_Sample|IPE Sample architecture]] and good practices to create your own IPE.<br />
<br />
== Project Roadmap ==<br />
*The OM2M roadmap is available here [[OM2M/Roadmap|Roadmap ]]<br />
== Interesting links ==<br />
Talks:<br />
* [https://www.youtube.com/watch?v=pPTAdJZpnsk OM2M talk at EclipseCon San Francisco 2014]<br />
<br />
Papers:<br />
* [http://www.sciencedirect.com/science/article/pii/S1877050914007364 OM2M: Extensible ETSI-compliant M2M Service Platform with Self-configuration Capability]<br />
<br />
Specifications:<br />
* [http://www.onem2m.org/library/index.cfm OneM2M standard specifications]<br />
<br />
<br />
== Public Documentation ==<br />
<br />
* [[OM2M/Public documentation | Public documentation]] contains all Presentation slides, Videos, Scientific Publications, etc. related to the OM2M project.<br />
<br />
== OM2M Team ==<br />
The OM2M project leads and contributors list is available [[OM2M/Team | here]].</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/one/Advanced_DB&diff=402774OM2M/one/Advanced DB2016-03-15T14:24:14Z<p>Garzone-eclipse.outlook.fr: </p>
<hr />
<div>In this tutorial, you can configure the OM2M default database (H2) your way and, if needed, use an alternative system and set it up. (From now, database is referred as DB).<br />
By default, OM2M uses the H2 database through a persistence abstraction layer and a JPA (EclipseLink). H2 server is configured to run in an embedded mode and the database file is stored in the product directory (database/<file>).<br />
<br />
If you are looking for more detailed information about H2 itself, check the H2 website and tutorials: [http://www.h2database.com]<br />
<br />
__TOC__<br />
<br />
= Prerequisites =<br />
* OM2M project cloned and built<br />
<br />
= Modify the default configuration =<br />
In the following guidelines, the modified constants are located in the config.in file. This file is located in the configuration folder in the product directory once you have cloned and built the project.<br />
<br />
== DB reset on startup ==<br />
By default the DB is reset on startup of the platform that is to say data are deleted.<br />
To modify this configuration just change the following constant to false. This constant can be found in the config.ini file, in your product (IN, MN, etc.).<br />
<pre><br />
org.eclipse.om2m.dbReset=false<br />
</pre><br />
<br />
== Use another User / password to access the DB ==<br />
By default, the user and its password used to connect to the DB are "om2m". Of course you can use different user/pwd if you want to use another configuration for your persistence part.<br />
To change the user and its password, modify the two following constants:<br />
<pre><br />
org.eclipse.om2m.dbUser=your_user<br />
org.eclipse.om2m.dbPassword=password<br />
</pre><br />
<br />
== Use a different location for DB file ==<br />
To change the location of the DB file, you need to modify one constant in the config.ini file. (located in the configuration folder in the product (IN, MN, etc.).<br />
For the IN you have by default:<br />
<pre><br />
org.eclipse.om2m.dbUrl=jdbc\:h2\:./database/indb<br />
</pre><br />
You can use any alternative path, just put it after the last ":" in the "jdbc\:h2\:" part like this:<br />
<pre><br />
org.eclipse.om2m.dbUrl=jdbc\:h2\:YOUR/PATH/ABSOLUTE/OR/RELATIVE<br />
</pre><br />
<br />
= Run H2 in another mode =<br />
By default H2 is embedded in OM2M and stores data into a file. You can set up H2 to run in server mode (classic) and configure OM2M to connect to this server, or even run H2 in memory (for gateways for instance) if needed.<br />
<br />
== Run H2 in memory ==<br />
For limited gateways, you may want to configure H2 in memory mode to have a faster interaction. However be aware of possible loss of data in case of reboot or shut down of your gateway. This mode is interesting if you have few data stored in the gateway itself and have another instance that is safer.<br />
To use H2 in this mode just modify this constant in the config.ini file of your node:<br />
<pre><br />
org.eclipse.om2m.dbUrl=jdbc\:h2\:mem\:<br />
</pre><br />
<br />
== Run a server and configure the connection ==<br />
This solution may be useful if you want to have a dedicated machine that will be your DB server for your system.<br />
=== Launch the DB server ===<br />
To launch H2 in server mode, just download the version you want to use of H2 from H2 website: [http://www.h2database.com/html/download.html]. (The following example use the platform independant zip.) Unzip the file and go to the h2/bin directory.<br />
To launch the server without any complex configuration, just use:<br />
<pre><br />
java -jar h2*.jar<br />
</pre><br />
This operation will open a webpage about the web console. There you can manage your database, create users, etc.<br />
To know more details and possibilities about this part, please visit the H2 online tutorials: [http://www.h2database.com/html/tutorial.html#using_server]<br />
<br />
=== Configure OM2M to connect to the server ===<br />
Just modify this constant in the config.ini file:<br />
<pre><br />
org.eclipse.om2m.dbUrl=jdbc\:h2\:tcp\://<dbServer>\:<port>/~/sample<br />
</pre><br />
<br />
You can find other configurations on the H2 website: [http://www.h2database.com/html/tutorial.html].</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/one/Advanced_DB&diff=402644OM2M/one/Advanced DB2016-03-11T17:04:26Z<p>Garzone-eclipse.outlook.fr: </p>
<hr />
<div>In this tutorial, you can configure the OM2M default database (H2) your way and, if needed, use an alternative system and set it up. (From now, database is referred as DB).<br />
By default, OM2M uses the H2 database (LINK TO H2 WEBSITE) through a persistence abstraction layer and a JPA (EclipseLink). H2 server is configured to run in an embedded mode and the database file is stored in the product directory (database/<file>).<br />
<br />
__TOC__<br />
<br />
= Prerequisites =<br />
* OM2M project cloned and built (LINK TO THE TUTO)<br />
* project opened in IDE for further modifications<br />
<br />
= Modify the default configuration =<br />
In the following guidelines, the modified constants are located in the config.in file. This file is located in the configuration folder in the product directory once you have cloned and built the project.<br />
<br />
== DB reset on startup ==<br />
By default the DB is reset on startup of the platform that is to say data are deleted.<br />
To modify this configuration just change the following constant to false. This constant can be found in the config.ini file, in your product (IN, MN, etc.).<br />
<pre><br />
org.eclipse.om2m.dbReset=false<br />
</pre><br />
<br />
== Use another User / password to access the DB ==<br />
By default, the user and its password used to connect to the DB are "om2m". Of course you can use different user/pwd if you want to use another configuration for your persistence part.<br />
To change the user and its password, modify the two following constants:<br />
<pre><br />
org.eclipse.om2m.dbUser=your_user<br />
org.eclipse.om2m.dbPassword=password<br />
</pre><br />
<br />
== Use a different location for DB file ==<br />
To change the location of the DB file, you need to modify one constant in the config.ini file. (located in the configuration folder in the product (IN, MN, etc.).<br />
For the IN you have by default:<br />
<pre><br />
org.eclipse.om2m.dbUrl=jdbc\:h2\:./database/indb<br />
</pre><br />
You can use any alternative path, just put it after the last ":" in the "jdbc\:h2\:" part like this:<br />
<pre><br />
org.eclipse.om2m.dbUrl=jdbc\:h2\:YOUR/PATH/ABSOLUTE/OR/RELATIVE<br />
</pre><br />
<br />
= Run H2 in another mode =<br />
By default H2 is embedded in OM2M and stores data into a file. You can set up H2 to run in server mode (classic) and configure OM2M to connect to this server, or even run H2 in memory (for gateways for instance) if needed.<br />
<br />
== Run H2 in memory ==<br />
For limited gateways, you may want to configure H2 in memory mode to have a faster interaction. However be aware of possible loss of data in case of reboot or shut down of your gateway. This mode is interesting if you have few data stored in the gateway itself and have another instance that is safer.<br />
To use H2 in this mode just modify this constant in the config.ini file of your node:<br />
<pre><br />
org.eclipse.om2m.dbUrl=jdbc\:h2\:mem\:<br />
</pre><br />
<br />
== Run a server and configure the connection ==<br />
This solution may be useful if you want to have a dedicated machine that will be your DB server for your system.<br />
=== Launch the DB server ===<br />
To launch H2 in server mode, just download the version you want to use of H2 from H2 website. Unzip the file and go to h2/bin directory.<br />
to launch the server use:<br />
<pre><br />
java -jar h2*.jar<br />
</pre><br />
<br />
=== Configure OM2M to connect to the server ===<br />
Just modify this constant in the config.ini file:<br />
<pre><br />
org.eclipse.om2m.dbUrl=jdbc\:h2\:tcp\://<dbServer>\:<port>/~/sample<br />
</pre><br />
<br />
You can find other configurations on the H2 website: LINK TO H2.<br />
<br />
= Use another DataBase (advanced tutorial) =<br />
<br />
* JDBC driver<br />
* OM2M update<br />
* Connection</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/one/Advanced_DB&diff=402635OM2M/one/Advanced DB2016-03-11T13:15:59Z<p>Garzone-eclipse.outlook.fr: Created page with "In this tutorial, you can configure the OM2M default database (H2) your way and, if needed, use an alternative system and set it up. (Therefore, database is referred as DB) _..."</p>
<hr />
<div>In this tutorial, you can configure the OM2M default database (H2) your way and, if needed, use an alternative system and set it up. (Therefore, database is referred as DB)<br />
<br />
__TOC__<br />
<br />
= Prerequisites =<br />
* OM2M project cloned and built (LINK TO THE TUTO)<br />
* project opened in IDE for further modifications<br />
<br />
= Modify the default configuration =<br />
In the following guidelines, the modified constants are located in the config.in file. This file is located in the configuration folder in the product directory once you have cloned and built the project.<br />
<br />
== DB reset on startup ==<br />
By default the DB is reset on startup of the platform that is to say data are deleted.<br />
To modify this configuration just change the following constant to false. This constant can be found in the config.ini file, in your product (IN, MN, etc.).<br />
<pre><br />
org.eclipse.om2m.dbReset=false<br />
</pre><br />
<br />
== Use another User / password to access the DB ==<br />
By default, the user and its password used to connect to the DB are "om2m". Of course you can use different user/pwd if you want to use another configuration for your persistence part.<br />
To change the user and its password, modify the two following constants:<br />
<pre><br />
org.eclipse.om2m.dbUser=your_user<br />
org.eclipse.om2m.dbPassword=password<br />
</pre><br />
<br />
== Use a different location for DB file ==<br />
To change the location of the DB file, you need to modify one constant in the config.ini file. (located in the configuration folder in the product (IN, MN, etc.).<br />
For the IN you have by default:<br />
<pre><br />
org.eclipse.om2m.dbUrl=jdbc\:h2\:./database/indb<br />
</pre><br />
You can use any alternative path, just put it after the last ":" in the "jdbc\:h2\:" part like this:<br />
<pre><br />
org.eclipse.om2m.dbUrl=jdbc\:h2\:YOUR/PATH/ABSOLUTE/OR/RELATIVE<br />
</pre></div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/one/Configuration&diff=394886OM2M/one/Configuration2015-12-16T11:12:33Z<p>Garzone-eclipse.outlook.fr: </p>
<hr />
<div>__TOC__<br />
== Server (IN-CSE) configuration ==<br />
* Go to the IN-CSE product directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.in-cse/target/products/in-cse/<os>/<ws>/<arch>".<br />
* Edit the file “configuration/config.ini” to configure the IN-CSE. '''(You can keep the current configuration for a local demo)'''<br />
{{CTable}}<br />
| Parameter|| Description|| Example<br />
|-<br />
| org.eclipse.om2m.cseType || CSE type || IN<br />
|-<br />
| org.eclipse.om2m.cseBaseAddress || IN-CSE ip address || 127.0.0.1<br />
|-<br />
| org.eclipse.equinox.http.jetty.http.port || IN-CSE listening port || 8080<br />
|-<br />
| org.eclipse.om2m.cseBaseContext|| IN-CSE listening context|| /<br />
|-<br />
| org.eclipse.om2m.dbDriver|| IN-CSE Database driver || org.h2.Driver<br />
|-<br />
| org.eclipse.om2m.dbUrl|| IN-CSE Database file location || jdbc:h2:./database/db<br />
|-<br />
| org.eclipse.om2m.dbUser|| IN-CSE Database user name || om2m<br />
|-<br />
| org.eclipse.om2m.dbPassword || IN-CSE Database password || om2m<br />
|-<br />
| org.eclipse.om2m.dbReset || IN-CSE Database reset when starting || true<br />
|-<br />
| org.eclipse.om2m.cseBaseId|| IN-CSE cseBase resource id || in-cse<br />
|-<br />
| org.eclipse.om2m.cseBaseName || IN-CSE Csebase resource name || in-name<br />
|-<br />
| org.eclipse.om2m.cseBaseProtocol.default|| IN-CSE Default communication protocol|| http<br />
|-<br />
| org.eclipse.om2m.maxNrOfInstances|| IN-CSE Maximum number of instances stored in a ContentInstances resource|| 1000<br />
|-<br />
| org.eclipse.om2m.adminRequestingEntity|| IN-CSE Default admin requesting entity. (username / password)|| admin:admin<br />
|-<br />
| org.eclipse.om2m.guestRequestingEntity|| IN-CSE Default guest requesting entity. (username / password)|| guest:guest<br />
|}<br />
<br />
== Gateway (MN-CSE) configuration ==<br />
* Go to the MN-CSE product directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.mn-cse/target/products/mn-cse/<os>/<ws>/<arch>".<br />
* Edit the file “configuration/config.ini” to configure the MN-CSE. '''(You can keep the current configuration for a local demo)'''<br />
{{CTable}}<br />
| Parameter|| Description|| Example<br />
|-<br />
| org.eclipse.om2m.cseType|| Cse type|| MN<br />
|-<br />
| org.eclipse.om2m.cseBaseAddress|| MN-CSE ip address|| 127.0.0.1<br />
|-<br />
| org.eclipse.equinox.http.jetty.http.port|| MN-CSE listening port|| 8181<br />
|-<br />
| org.eclipse.om2m.cseBaseContext|| MN-CSE listening context|| /<br />
|-<br />
| org.eclipse.om2m.dbDriver|| MN-CSE Database driver || org.h2.Driver<br />
|-<br />
| org.eclipse.om2m.dbUrl|| MN-CSE Database file location || jdbc:h2:./database/db<br />
|-<br />
| org.eclipse.om2m.dbUser|| MN-CSE Database user name || om2m<br />
|-<br />
| org.eclipse.om2m.dbPassword || MN-CSE Database password || om2m<br />
|-<br />
| org.eclipse.om2m.dbReset || MN-CSE Database reset when starting || true<br />
|-<br />
| org.eclipse.om2m.cseBaseId|| MN-CSE cseBase resource id|| mn-cse<br />
|-<br />
| org.eclipse.om2m.cseBaseName || MN-CSE Base Name || mn-name<br />
|-<br />
| org.eclipse.om2m.cseBaseProtocol.default|| MN-CSE default communication protocol|| http<br />
|-<br />
| org.eclipse.om2m.maxNrOfInstances|| Maximum number of instances stored in a ContentInstances resource|| 1000<br />
|-<br />
| org.eclipse.om2m.adminRequestingEntity|| Default MN-CSE admin requesting entity. (username / password)|| admin:admin<br />
|-<br />
| org.eclipse.om2m.guestRequestingEntity|| Default MN-CSE guest requesting entity. (username / password)|| guest:guest<br />
|}<br />
<br />
* The MN-CSE configuration file contains 4 additional parameters to specify the remote IN-CSE to which the MN-CSE should be authenticated.<br />
{{CTable}}<br />
| Parameter|| Description|| Example<br />
|-<br />
| org.eclipse.om2m.remoteCseId|| Remote IN-CSE Id|| in-cse<br />
|-<br />
| org.eclipse.om2m.remoteCseName || Remote IN-CSE Name || in-name<br />
|-<br />
| org.eclipse.om2m.remoteCseAddress|| Remote IN-CSE ip address|| 127.0.0.1<br />
|-<br />
| org.eclipse.om2m.remoteCsePort|| Remote IN-CSE listening port|| 8080<br />
|-<br />
| org.eclipse.om2m.remoteCseContext|| Remote IN-CSE listening context|| /<br />
|}<br />
<br />
* You can configure MN-CSE and IN-CSE to work on distributed machines.<br />
* You can configure multiple MN-CSEs by setting different identifiers.<br />
<br />
== Multiple gateways configuration==<br />
<br />
* Let's consider a simple M2M system composed of a server and two gateways as follows:<br />
** Server IP: 192.168.0.2<br />
** Gateway1 IP: 192.168.0.3<br />
** Gateway2 IP: 192.168.0.4<br />
<br />
* Of course, you can test the system locally in one machine by using the IP 127.0.0.1 for all products.<br />
<br />
* After building the OM2M project normally, you will obtain 1 IN-CSE product and 1 MN-CSE product.<br />
* You can configure the IN-CSE with the default configuration like this:<br />
<br />
IN-CSE config.ini file:<br />
<pre><br />
org.eclipse.om2m.cseBaseId=IN-CSE<br />
org.eclipse.om2m.cseBaseName=in-name<br />
org.eclipse.om2m.cseBaseAddress=192.168.0.2<br />
org.eclipse.equinox.http.jetty.http.port=8080<br />
</pre><br />
<br />
* Now, copy the MN-CSE product in another folder. You have now two separate MN-CSEs.<br />
<br />
* Configure the first MN-CSE with the following configuration:<br />
<br />
MN-CSE1 config.ini file:<br />
<pre><br />
org.eclipse.om2m.cseBaseId=MN-CSE1<br />
org.eclipse.om2m.cseBaseName=mn-name1<br />
org.eclipse.om2m.cseBaseAddress=192.168.0.3<br />
org.eclipse.equinox.http.jetty.http.port=8181<br />
org.eclipse.om2m.remoteCseId=IN-CSE<br />
org.eclipse.om2m.remoteCseName=in-name<br />
org.eclipse.om2m.remoteCseAddress=192.168.0.2<br />
org.eclipse.om2m.remoteCsePort=8080<br />
</pre><br />
<br />
* Then, configure the second MN-CSE with the following configuration:<br />
<br />
MN-CSE2 config.ini file:<br />
<pre><br />
org.eclipse.om2m.cseBaseId=MN-CSE2<br />
org.eclipse.om2m.cseBaseName=mn-cse2<br />
org.eclipse.om2m.cseBaseAddress=192.168.0.4<br />
org.eclipse.equinox.http.jetty.http.port=8282<br />
org.eclipse.om2m.remoteCseId=IN-CSE<br />
org.eclipse.om2m.remoteCseName=in-name<br />
org.eclipse.om2m.remoteCseddress=192.168.0.2<br />
org.eclipse.om2m.remoteCsePort=8080<br />
</pre><br />
<br />
* If you don't know how to start OM2M please check this tutorial: [https://wiki.eclipse.org/OM2M/one/Starting OM2M startup]<br />
<br />
* You can start the system as follows:<br />
** Start the IN-CSE product.<br />
** Start the MN-CSE1 product.<br />
** Start the MN-CSE2 product.<br />
<br />
*Open the IN-CSE web interface on http://192.168.0.2:8080/webpage. You will find MN-CSE1 and MN-CSE2 authenticated.<br />
<br />
*You can access now each authenticated MN-CSE by clicking on the MN-CSE (eg. /IN-CSE/in-name/MN-CSE1). <br />
<br />
*Click on the "link" button to access remotely the gateway resource tree.</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/one/Developer&diff=394832OM2M/one/Developer2015-12-15T10:32:43Z<p>Garzone-eclipse.outlook.fr: </p>
<hr />
<div>'''Before doing this tutorial you have to''' [https://wiki.eclipse.org/OM2M/Clone clone and build OM2M using Eclipse]<br />
<br />
__TOC__<br />
<br />
=Add a new plug-in to OM2M=<br />
<br />
== Clone and import OM2M ==<br />
* Clone OM2M using the Eclipse IDE.<br />
* Import all nested projects into your workspace.<br />
<br />
== Create a new plug-in project ==<br />
<br />
*Create a new plug-in project called org.eclipse.om2m.sample.ipe via File → New → Other → Plug-in Project.<br />
*Enter the data as depicted in the following screenshots.<br />
[[File:Om2m_ipe1.jpg|thumb|center|600px|create a plug-in project: step 1]]<br />
<br />
[[File:Om2m_ipe2.jpg|thumb|center|600px|create a plug-in project: step 2]]<br />
<br />
*Uncheck the ''Create a plug-in using one of the templates'' checkbook and press the ''Finish'' button.<br />
[[File:Om2m_ipe3.jpg|thumb|center|600px|create a plug-in project: step 3]]<br />
<br />
*As result the following project is created. <br />
[[File:Om2m_ipe4.jpg|thumb|center|600px|sample ipe plug-in]]<br />
<br />
== Convert the plugin into maven project ==<br />
<br />
*Open the build.properties file and update the src attributes as depicted in the following figure. <br />
[[File:Om2m_ipe_configure.png|thumb|center|600px|build-properties build]]<br />
<br />
*Select the created plug-in "org.eclipse.om2m.sample.ipe" → right click → configure → convert to maven project. <br />
*Enter the data as illustrated in the following and press the ''Finish'' button. <br />
[[File:Om2m_ipe_maven_conversion.png|thumb|center|600px|maven conversion: POM edition]]<br />
<br />
*Once the plug-in is converted, open the ''pom.xml'' file to edit the parent filed. <br />
*Click on "select Parent" icon and enter "org.eclipse.om2m" in the "Enter groupId, artifactId or sh1 prefix or pattern" field. <br />
*Select "org.om2m.eclipse" and press ok. <br />
[[File:pom_edition.png|thumb|center|600px|maven conversion: Parent edition]]<br />
<br />
*We end this step by updating the plug-in project. For this, select the "org.eclipse.om2m.sample.ipe" project → maven → update project.<br />
<br />
== Add the plugin as a maven module to the OM2M parent project ==<br />
<br />
* In this part, we will add the created plug-in as a module to the om2m platform:<br />
** Open the pom file of the ''org.eclipse.om2m'' package. <br />
** Go to the ''modules'' tab and press ''Add'' button.<br />
** Select the org.eclipse.om2m.sample.ipe plug-in and press ''ok''.<br />
** Build the om2m package and its sub-projects. To do this, select the "om2m.org.eclipse" package → right click → Run as → maven install. <br />
** Check the org.eclipse.om2m.sample.ipe was successfully built. At the buid end, we should get this result. <br />
[[File:Om2m_ipe_build.png|thumb|center|600px|om2m build]]<br />
<br />
*Remark: To keep the same display pattern for all the platform' plugins, you can add ''description'' and ''name'' tags to the ''org.eclipse.om2m.sample.ipe''' ''pom.xml'' file. <br />
<pre><br />
<project><br />
......<br />
<name>org.eclipse.om2m :: sample ipe</name><br />
<description>org.eclipse.om2m :: sample ipe</description><br />
.....<br />
</project><br />
</pre><br />
<br />
== Add the plugin to the OM2M product(s) ==<br />
<br />
*The final step consists of adding the created plug-in to one of om2m platform products, i.e the ''gscl'' or the ''nscl'' executable. In the following, we choose to add the org.eclipse.om2m.sample.ipe plug-in to the gscl product:<br />
* select the org.eclipse.om2m.site.gscl package. <br />
* open the om2m.product file. <br />
* Press Add button and Type org.eclipse.om2m.sample.ipe<br />
* Click on ok button and save. <br />
* Build the om2m package and its sub-projects: select the "om2m.org.eclipse" package -> right click -> Run as -> maven install.<br />
* To check that the "org.eclipse.om2m.sample.ipe" was successfully added to the gscl product, run the gscl and verify in the console if the "org.eclipse.om2m.sample.ipe" is displayed.<br />
[[File:Om2m_ipe_run.png|thumb|center|600px|gscl product]]<br />
== Add required dependencies ==<br />
=== Add plugin dependencies ===<br />
* Open the manifest file of the created plugin and select Dependencies tab.<br />
* Add the dependencies depicted in the following figure. <br />
'''Important!''' You need to import om2m nested projects into your workspace to find them in the list below.<br />
[[File:Om2m_Ipe_DependenciesPlugin.png|thumb|center|700px|plugin dependencies]]<br />
<br />
=== Add jar dependencies (Only if required) ===<br />
If you want to add specific jar libraries to your plugin, you can follow these steps: <br />
* Create a "libs" folder on your plugin project. <br />
* Put required specific jar on the "libs" folder. <br />
* Open the manifest file of the created plugin and select "runtime" tab. <br />
* Go to the "classpath" tab and click on the "Add" button. <br />
* Select the required jar and click on "ok" button.<br />
[[File:jars.png|thumb|center|800px|plugin specific jar dependencies]]<br />
<br />
= Develop an Interworking Proxy Unit (IPE) plugin =<br />
== IPE Activator ==<br />
<br />
* The Activator class contains the implementation of the start() and stop() method used to activate and deactivate the IPE plugin. <br />
* In the start() method, the Activator registers the IPE Controller service on the registry to make it available for the CORE plugin. Then, it starts tracking the CORE CSE service to use it once the CORE plugin is activated. <br />
* In the Stop() method, the Activator can execute some process to make a clean before deactivation such as stopping threads, handle exceptions, etc. In our case, we stop the Monitor that have a set of thread that must be handled.<br />
<br />
<source lang="java"><br />
package org.eclipse.om2m.sample.ipe;<br />
<br />
import org.eclipse.om2m.core.service.CseService;<br />
import org.eclipse.om2m.interworking.service.InterworkingService;<br />
import org.osgi.framework.BundleActivator;<br />
import org.osgi.framework.BundleContext;<br />
import org.osgi.framework.ServiceReference;<br />
import org.osgi.util.tracker.ServiceTracker;<br />
<br />
public class Activator implements BundleActivator {<br />
<br />
private static BundleContext context;<br />
<br />
private Monitor monitor;<br />
<br />
static BundleContext getContext() {<br />
return context;<br />
}<br />
<br />
public void start(BundleContext bundleContext) throws Exception {<br />
Activator.context = bundleContext;<br />
System.out.println("Starting Sample Ipe");<br />
new ServiceTracker<Object, Object>(bundleContext, CseService.class.getName(), null){<br />
<br />
@Override<br />
public Object addingService(ServiceReference<Object> reference) {<br />
CseService cse = (CseService) this.context.getService(reference);<br />
if(cse != null){<br />
RequestSender.CSE = cse;<br />
new Thread(){<br />
public void run() {<br />
monitor = new Monitor(cse);<br />
monitor.start();<br />
};<br />
}.start();<br />
}<br />
return cse; <br />
}<br />
}.open();<br />
<br />
bundleContext.registerService(InterworkingService.class.getName(), new Controller(), null);<br />
<br />
}<br />
<br />
public void stop(BundleContext bundleContext) throws Exception {<br />
Activator.context = null;<br />
System.out.println("Stopping Sample Ipe");<br />
if(monitor != null){<br />
monitor.stop();<br />
}<br />
}<br />
<br />
}<br />
</source><br />
<hr><br />
== IPE Monitor ==<br />
<br />
* The Monitor class creates one sensor AE called "MY_SENSOR", and one actuator AE called "MY_ACTUATOR". It creates two containers for each applications: "DESCRIPTOR" container to store the description and "DATA" container to store the measurements. For each container the right oBIX XML payload is created as contentInstance.<br />
<br />
* The Monitor starts two threads to listen to each application data as well. Once a new data is detected, the Monitor creates a new contentInstance including the measurement representation.<br />
<br />
* Another method is available to stop the monitor and linked threads.<br />
<br />
<source lang="java"><br />
package org.eclipse.om2m.sample.ipe;<br />
<br />
import java.math.BigInteger;<br />
<br />
import org.eclipse.om2m.commons.constants.Constants;<br />
import org.eclipse.om2m.commons.constants.MimeMediaType;<br />
import org.eclipse.om2m.commons.constants.ResponseStatusCode;<br />
import org.eclipse.om2m.commons.resource.AE;<br />
import org.eclipse.om2m.commons.resource.Container;<br />
import org.eclipse.om2m.commons.resource.ContentInstance;<br />
import org.eclipse.om2m.commons.resource.ResponsePrimitive;<br />
import org.eclipse.om2m.core.service.CseService;<br />
<br />
public class Monitor {<br />
<br />
static CseService CSE;<br />
static String CSE_ID = Constants.CSE_ID;<br />
static String CSE_NAME = Constants.CSE_NAME;<br />
static String REQUEST_ENTITY = Constants.ADMIN_REQUESTING_ENTITY;<br />
static String ipeId = "sample";<br />
static String actuatorId = "MY_ACTUATOR";<br />
static String sensorId = "MY_SENSOR";<br />
static boolean actuatorValue = false;<br />
static int sensorValue = 0;<br />
static String DESCRIPTOR = "DESCRIPTOR";<br />
static String DATA = "DATA";<br />
<br />
private SensorListener sensorListener;<br />
private ActuatorListener actuatorListener;<br />
<br />
public Monitor(CseService cseService){<br />
CSE = cseService;<br />
}<br />
<br />
public void start(){<br />
// Create sensor resources<br />
createSensorResources();<br />
// Listen for the sensor data<br />
listenToSensor();<br />
<br />
// Create required resources for the Actuator<br />
createActuatorResource();<br />
// Listen for the Actuator data<br />
listenToActuator();<br />
}<br />
<br />
public void stop(){<br />
if(sensorListener != null && sensorListener.isAlive()){<br />
sensorListener.stopThread();<br />
}<br />
if(actuatorListener != null && actuatorListener.isAlive()){<br />
actuatorListener.stopThread();<br />
}<br />
}<br />
<br />
public void createSensorResources(){<br />
String targetId, content;<br />
<br />
targetId = "/" + CSE_ID + "/" + CSE_NAME;<br />
AE ae = new AE();<br />
ae.setRequestReachability(true);<br />
ae.setAppID(ipeId);<br />
ae.getPointOfAccess().add(ipeId);<br />
ResponsePrimitive response = RequestSender.createAE(ae, sensorId);<br />
<br />
if(response.getResponseStatusCode().equals(ResponseStatusCode.CREATED)){<br />
targetId = "/" + CSE_ID + "/" + CSE_NAME + "/" + sensorId;<br />
Container cnt = new Container();<br />
cnt.setMaxNrOfInstances(BigInteger.valueOf(10));<br />
// Create the DESCRIPTOR container<br />
RequestSender.createContainer(targetId, DESCRIPTOR, cnt);<br />
<br />
// Create the DATA container<br />
RequestSender.createContainer(targetId, DATA, cnt);<br />
<br />
// Create the description contentInstance<br />
content = ObixUtil.getSensorDescriptorRep(sensorId, ipeId);<br />
targetId = "/" + CSE_ID + "/" + CSE_NAME + "/" + sensorId + "/" + DESCRIPTOR;<br />
ContentInstance cin = new ContentInstance();<br />
cin.setContent(content);<br />
cin.setContentInfo(MimeMediaType.OBIX);<br />
RequestSender.createContentInstance(targetId, cin);<br />
}<br />
}<br />
<br />
public void createActuatorResource(){<br />
String targetId, content;<br />
<br />
targetId = "/" + CSE_ID + "/" + CSE_NAME;<br />
AE ae = new AE();<br />
ae.setRequestReachability(true);<br />
ae.setAppID(ipeId);<br />
ae.getPointOfAccess().add(ipeId);<br />
ResponsePrimitive response = RequestSender.createAE(ae, actuatorId);<br />
<br />
if(response.getResponseStatusCode().equals(ResponseStatusCode.CREATED)){<br />
targetId = "/" + CSE_ID + "/" + CSE_NAME + "/" + actuatorId;<br />
Container cnt = new Container();<br />
cnt.setMaxNrOfInstances(BigInteger.valueOf(10));<br />
// Create the DESCRIPTOR container<br />
RequestSender.createContainer(targetId, DESCRIPTOR, cnt);<br />
<br />
// Create the DATA container<br />
RequestSender.createContainer(targetId, DATA, cnt);<br />
<br />
// Create the description contentInstance<br />
content = ObixUtil.getActutaorDescriptorRep(actuatorId, ipeId);<br />
targetId = "/" + CSE_ID + "/" + CSE_NAME + "/" + actuatorId + "/" + DESCRIPTOR;<br />
ContentInstance cin = new ContentInstance();<br />
cin.setContent(content);<br />
cin.setContentInfo(MimeMediaType.OBIX);<br />
RequestSender.createContentInstance(targetId, cin);<br />
}<br />
}<br />
<br />
public void listenToSensor(){<br />
sensorListener = new SensorListener();<br />
sensorListener.start();<br />
}<br />
<br />
public void listenToActuator(){<br />
actuatorListener = new ActuatorListener();<br />
actuatorListener.start();<br />
}<br />
<br />
<br />
private static class SensorListener extends Thread{<br />
<br />
private boolean running = true;<br />
<br />
@Override<br />
public void run() {<br />
while(running){<br />
// Simulate a random measurement of the sensor<br />
sensorValue = 10 + (int) (Math.random() * 100);<br />
<br />
// Create the data contentInstance<br />
String content = ObixUtil.getSensorDataRep(sensorValue);<br />
String targetId = "/" + CSE_ID + "/" + CSE_NAME + "/" + sensorId + "/" + DATA;<br />
ContentInstance cin = new ContentInstance();<br />
cin.setContent(content);<br />
cin.setContentInfo(MimeMediaType.OBIX);<br />
RequestSender.createContentInstance(targetId, cin);<br />
<br />
try {<br />
Thread.sleep(2000);<br />
} catch (InterruptedException e){<br />
e.printStackTrace();<br />
}<br />
}<br />
<br />
}<br />
<br />
public void stopThread(){<br />
running = false;<br />
}<br />
<br />
}<br />
<br />
private static class ActuatorListener extends Thread{<br />
<br />
private boolean running = true;<br />
private boolean memorizedActuatorValue = false;<br />
<br />
@Override<br />
public void run() {<br />
while(running){<br />
// If the actuator state has changed<br />
if(memorizedActuatorValue != actuatorValue){<br />
// Memorize the new actuator state<br />
memorizedActuatorValue = actuatorValue;<br />
<br />
// Create a data contentInstance<br />
String content = ObixUtil.getActuatorDataRep(memorizedActuatorValue);<br />
String targetId = "/" + CSE_ID + "/" + CSE_NAME + "/" + actuatorId + "/" + DATA;<br />
ContentInstance cin = new ContentInstance();<br />
cin.setContent(content);<br />
cin.setContentInfo(MimeMediaType.OBIX);<br />
RequestSender.createContentInstance(targetId, cin);<br />
}<br />
<br />
// Wait for 2 seconds<br />
try{<br />
Thread.sleep(2000);<br />
} catch (InterruptedException e){<br />
e.printStackTrace();<br />
}<br />
}<br />
}<br />
<br />
public void stopThread(){<br />
running = false;<br />
}<br />
<br />
}<br />
<br />
}<br />
</source><br />
<hr><br />
== IPE oBIX Util ==<br />
* Convert the description and the measured data of the device to oBIX XML representation.<br />
<br />
<source lang="java"><br />
package org.eclipse.om2m.sample.ipe;<br />
<br />
import org.eclipse.om2m.commons.constants.Constants;<br />
import org.eclipse.om2m.commons.obix.Bool;<br />
import org.eclipse.om2m.commons.obix.Contract;<br />
import org.eclipse.om2m.commons.obix.Int;<br />
import org.eclipse.om2m.commons.obix.Obj;<br />
import org.eclipse.om2m.commons.obix.Op;<br />
import org.eclipse.om2m.commons.obix.Uri;<br />
import org.eclipse.om2m.commons.obix.io.ObixEncoder;<br />
<br />
public class ObixUtil {<br />
<br />
public static String getSensorDescriptorRep(String appId, String ipeId) {<br />
String prefix = "/" + Constants.CSE_ID + "/" + Constants.CSE_NAME + "/" + appId;<br />
Obj obj = new Obj();<br />
<br />
Op opGet = new Op();<br />
opGet.setName("GET");<br />
opGet.setHref(new Uri(prefix + "/DATA/la"));<br />
opGet.setIs(new Contract("retrieve"));<br />
obj.add(opGet);<br />
<br />
Op opGetDirect = new Op();<br />
opGetDirect.setName("GET(Direct)");<br />
opGetDirect.setHref(new Uri(prefix + "?op=get"));<br />
opGetDirect.setIs(new Contract("execute"));<br />
obj.add(opGetDirect);<br />
<br />
return ObixEncoder.toString(obj);<br />
}<br />
<br />
public static String getActutaorDescriptorRep(String appId, String ipuId) {<br />
String prefix = "/" + Constants.CSE_ID + "/" + Constants.CSE_NAME + "/" + appId;<br />
Obj obj = new Obj();<br />
<br />
Op opGet = new Op();<br />
opGet.setName("GET");<br />
opGet.setHref(new Uri(prefix + "/DATA/la"));<br />
opGet.setIs(new Contract("retrieve"));<br />
obj.add(opGet);<br />
<br />
Op opGetDirect = new Op();<br />
opGetDirect.setName("GET(Direct)");<br />
opGetDirect.setHref(new Uri(prefix + "?op=get"));<br />
opGetDirect.setIs(new Contract("execute"));<br />
obj.add(opGetDirect);<br />
<br />
Op opON = new Op();<br />
opON.setName("ON");<br />
opON.setHref(new Uri(prefix + "?op=true"));<br />
opON.setIs(new Contract("execute"));<br />
obj.add(opON);<br />
<br />
Op opOFF = new Op();<br />
opOFF.setName("OFF");<br />
opOFF.setHref(new Uri(prefix + "?op=false"));<br />
opOFF.setIs(new Contract("execute"));<br />
obj.add(opOFF);<br />
<br />
return ObixEncoder.toString(obj);<br />
}<br />
<br />
public static String getActuatorDataRep(boolean value) {<br />
Obj obj = new Obj();<br />
obj.add(new Bool("data", value));<br />
return ObixEncoder.toString(obj);<br />
}<br />
<br />
public static String getSensorDataRep(int value) {<br />
Obj obj = new Obj();<br />
obj.add(new Int("data", value));<br />
return ObixEncoder.toString(obj);<br />
}<br />
<br />
}<br />
</source><br />
<hr><br />
== IPE Controller ==<br />
<br />
* Execute received requests from OM2M to the specific technologies.<br />
<br />
<source lang="java"><br />
package org.eclipse.om2m.sample.ipe;<br />
<br />
import org.eclipse.om2m.commons.constants.ResponseStatusCode;<br />
import org.eclipse.om2m.commons.resource.RequestPrimitive;<br />
import org.eclipse.om2m.commons.resource.ResponsePrimitive;<br />
import org.eclipse.om2m.interworking.service.InterworkingService;<br />
<br />
public class Controller implements InterworkingService{<br />
<br />
@Override<br />
public ResponsePrimitive doExecute(RequestPrimitive request) {<br />
String[] parts = request.getTo().split("/");<br />
String appId = parts[3];<br />
ResponsePrimitive response = new ResponsePrimitive(request);<br />
<br />
if(request.getQueryStrings().containsKey("op")){<br />
String valueOp = request.getQueryStrings().get("op").get(0);<br />
<br />
switch(valueOp){<br />
case "get":<br />
if(appId.equals(Monitor.sensorId)){<br />
response.setContent(ObixUtil.getSensorDataRep(Monitor.sensorValue));<br />
response.setResponseStatusCode(ResponseStatusCode.OK);<br />
} else if (appId.equals(Monitor.actuatorId)){<br />
response.setContent(ObixUtil.getActuatorDataRep(Monitor.actuatorValue));<br />
response.setResponseStatusCode(ResponseStatusCode.OK);<br />
} else {<br />
response.setResponseStatusCode(ResponseStatusCode.BAD_REQUEST);<br />
}<br />
return response;<br />
case "true": case "false":<br />
if(appId.equals(Monitor.actuatorId)){<br />
Monitor.actuatorValue = Boolean.parseBoolean(valueOp);<br />
response.setResponseStatusCode(ResponseStatusCode.OK);<br />
} else {<br />
response.setResponseStatusCode(ResponseStatusCode.BAD_REQUEST);<br />
}<br />
return response;<br />
default:<br />
response.setResponseStatusCode(ResponseStatusCode.BAD_REQUEST);<br />
}<br />
} else {<br />
response.setResponseStatusCode(ResponseStatusCode.BAD_REQUEST);<br />
}<br />
return response;<br />
}<br />
<br />
@Override<br />
public String getAPOCPath() {<br />
return Monitor.ipeId;<br />
}<br />
<br />
}<br />
</source><br />
<br />
<br />
== IPE Util: RequestSender ==<br />
<br />
* This class simplify the interaction with the CseService providing the response of specific requests directly. You can take inspiration of this class if you want to create your own request utility/factory.<br />
<br />
<source lang="java"><br />
package org.eclipse.om2m.sample.ipe;<br />
<br />
import java.math.BigInteger;<br />
<br />
import org.eclipse.om2m.commons.constants.Constants;<br />
import org.eclipse.om2m.commons.constants.MimeMediaType;<br />
import org.eclipse.om2m.commons.constants.Operation;<br />
import org.eclipse.om2m.commons.constants.ResourceType;<br />
import org.eclipse.om2m.commons.resource.AE;<br />
import org.eclipse.om2m.commons.resource.Container;<br />
import org.eclipse.om2m.commons.resource.ContentInstance;<br />
import org.eclipse.om2m.commons.resource.RequestPrimitive;<br />
import org.eclipse.om2m.commons.resource.Resource;<br />
import org.eclipse.om2m.commons.resource.ResponsePrimitive;<br />
import org.eclipse.om2m.core.service.CseService;<br />
<br />
public class RequestSender {<br />
<br />
public static CseService CSE;<br />
<br />
/**<br />
* Private constructor to avoid creation of this object<br />
*/<br />
private RequestSender(){}<br />
<br />
public static ResponsePrimitive createResource(String targetId, String name, Resource resource, int resourceType){<br />
RequestPrimitive request = new RequestPrimitive();<br />
request.setFrom(Constants.ADMIN_REQUESTING_ENTITY);<br />
request.setTargetId(targetId);<br />
request.setResourceType(BigInteger.valueOf(resourceType));<br />
request.setRequestContentType(MimeMediaType.OBJ);<br />
request.setReturnContentType(MimeMediaType.OBJ);<br />
request.setContent(resource);<br />
request.setName(name);<br />
request.setOperation(Operation.CREATE);<br />
return CSE.doRequest(request);<br />
}<br />
<br />
public static ResponsePrimitive createAE(AE resource, String name){<br />
return createResource("/" + Constants.CSE_ID, name, resource, ResourceType.AE);<br />
}<br />
<br />
public static ResponsePrimitive createContainer(String targetId, String name, Container resource){<br />
return createResource(targetId, name, resource, ResourceType.CONTAINER);<br />
}<br />
<br />
public static ResponsePrimitive createContentInstance(String targetId, String name, ContentInstance resource){<br />
return createResource(targetId, name, resource, ResourceType.CONTENT_INSTANCE);<br />
}<br />
<br />
public static ResponsePrimitive createContentInstance(String targetId, ContentInstance resource){<br />
return createContentInstance(targetId, null, resource);<br />
}<br />
<br />
public static ResponsePrimitive getRequest(String targetId){<br />
RequestPrimitive request = new RequestPrimitive();<br />
request.setFrom(Constants.ADMIN_REQUESTING_ENTITY);<br />
request.setTargetId(targetId);<br />
request.setReturnContentType(MimeMediaType.OBJ);<br />
request.setOperation(Operation.RETRIEVE);<br />
request.setRequestContentType(MimeMediaType.OBJ);<br />
return CSE.doRequest(request);<br />
}<br />
<br />
}<br />
</source></div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=OM2M/one/REST_API&diff=394830OM2M/one/REST API2015-12-15T10:28:48Z<p>Garzone-eclipse.outlook.fr: </p>
<hr />
<div>__TOC__<br />
== Install a rest client ==<br />
* For this section, you need a REST client to send HTTP request (GET, POST, UPDATE, DELETE) to the OM2M platform. <br />
* You can use the "Client REST Simple" (https://chrome.google.com/webstore/detail/simple-rest-client/fhjcajmcbmldlhcimfajhfbgofnpcjmb), or Postman (http://www.getpostman.com) google chrome extension or any other rest client.<br />
[[File:rest-client.png|center|600px|thumb|Simple REST client inteface]]<br />
<br />
* The authentification is handle using a specific oneM2M header: '''X-M2M-Origin'''. This has to be specified in every request to identify the sender. <br />
<br />
== Retrieve a resource == <br />
* HTTP request:<br />
{{CTable}}<br />
| Field|| Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse<br />
|-<br />
| Method|| GET<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin<br />
|-<br />
| Body|| (empty)<br />
|}<br />
<br />
* HTTP response:<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|Status|| 200 OK<br />
|-<br />
|Body|| <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:cb xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="in-name"><br />
<ty>5</ty><br />
<ri>/in-cse</ri><br />
<ct>20151104T150228</ct><br />
<lt>20151104T150228</lt><br />
<acpi>/in-cse/acp-563660429</acpi><br />
<cst>1</cst><br />
<csi>in-cse</csi><br />
<srt>1 2 3 4 5 9 14 15 16 17 23</srt><br />
<poa>http://127.0.0.1:8080/</poa><br />
</m2m:cb><br />
</pre><br />
|}<br />
<br />
== Discover resources based on their search strings ==<br />
* You can discover available resources based on their search strings using the discovery resource. The '''fu''' parameter (stands for "Filter Usage") indicate that it is a discovery request. The '''lbl''' ("Label") indicate the specific label you what to filter.<br />
* HTTP request: <br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse?fu=1&lbl=my_app<br />
|-<br />
| Method|| GET<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin<br />
|-<br />
|Body|| (empty)<br />
|}<br />
<br />
* HTTP response:<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|Status|| 200 OK<br />
|-<br />
|Body|| <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:disres xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<ref ty="2"> <uri-of-the-resource> </ref><br />
</m2m:disres></pre><br />
|}<br />
<br />
== Create a "MY_SENSOR" application ==<br />
* Send a HTTP request with the following parameters to create a '''MY_SENSOR''' application on the gateway.<br />
{{CTable}}<br />
* In the creation we have two important headers:<br />
** '''Content-Type''': this header has 2 informations seperated by a semicolon<br />
*** The format of the exchange, here "application/xml"<br />
*** The resource type to be created, here "ty=2" (2 for AE, see oneM2M spec TS-0004, Table 6.3.3.2.11-1)<br />
** '''X-M2M-NM''': the name of the resource to be created<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse<br />
|-<br />
|Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=2 <br> X-M2M-NM: MY_SENSOR<br />
|-<br />
|Body|| <pre><br />
<om2m:ae xmlns:om2m="http://www.onem2m.org/xml/protocols"><br />
<api>app-sensor</api><br />
<lbl>Type/sensor Category/temperature Location/home</lbl><br />
<rr>false</rr><br />
</om2m:ae></pre><br />
|}<br />
<br />
* HTTP response:<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
| Status || 201 Created<br />
|-<br />
|Headers || Content-Location: /in-cse/ae-CAE449907766<br />
|-<br />
| Body || <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:ae xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="MY_SENSOR"><br />
<ty>2</ty><br />
<ri>ae-CAE449907766</ri><br />
<pi>/in-cse</pi><br />
<ct>20151104T151858</ct><br />
<lt>20151104T151858</lt><br />
<lbl>Type/sensor Category/temperature Location/home</lbl><br />
<acpi>/in-cse/acp-89704715</acpi><br />
<api>app-sensor</api><br />
<aei>CAE449907766</aei><br />
<rr>false</rr><br />
</m2m:ae><br />
</pre><br />
|}<br />
* Here, the application has been created and can be accessed using 2 different URIs: <br />
** '''Unstructured URI''': this URI is the '''ri''' node in the AE representation or present in the '''Content-Location''' header in the creation response "/<cse-id>/<id-of-the-resource>". In our case we have "/in-cse/ae-CAE449907766"<br />
** '''Structured URI''': this URI use the names of the resources hierarchically to get the resource "/<cse-id>/<cse-name>/<hierarchy-of-resource-names>". Here we will simple have "/in-cse/in-name/MY-SENSOR".<br />
The difference between the unstructured URI and the structured one consists in the presence (or not) of the CSE name. Examples:<br />
unstructured URI: "/<cse-id>/<id-of-the-resource>", for instance: "/in-cse/ae-123".<br />
structured URI: "/in-cse/in-name/<hierarchy-of-resource-names>", for instance: "/in-cse/in-name/name1/name2/name3".<br />
* You can check the created application on the web interface.<br />
<br />
== Create a DESCRIPTOR container ==<br />
* Send a HTTP request with the following parameters to create a '''DESCRIPTOR''' container resource under the '''MY_SENSOR''' application.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR<br />
|-<br />
| Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=3 <br> X-M2M-NM: DESCRIPTOR<br />
|-<br />
|Body|| <pre><br />
<om2m:cnt xmlns:om2m="http://www.onem2m.org/xml/protocols"><br />
</om2m:cnt></pre><br />
|}<br />
<br />
* HTTP response<br />
{{CTable}}<br />
|Field || Value<br />
|-<br />
| Status || 201 Created<br />
|-<br />
| Header || Content-Location: /in-cse/cnt-478855064<br />
|-<br />
| Body || <pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="DESCRIPTOR"><br />
<ty>3</ty><br />
<ri>cnt-478855064</ri><br />
<pi>/in-cse/ae-CAE449907766</pi><br />
<ct>20151104T155844</ct><br />
<lt>20151104T155844</lt><br />
<acpi>/in-cse/acp-89704715</acpi><br />
<cni>0</cni><br />
<cbs>0</cbs><br />
</m2m:cnt><br />
</pre><br />
|}<br />
* As the AE, there is two ways to access the resource:<br />
** '''Unstructured URI''': which is '/in-cse/cnt-478855064'<br />
** '''Structure URI''': which is the Structured URI of the AE plus the name of the container, in our case "/in-cse/in-name/MY_SENSOR/DESCRIPTOR"<br />
* Check the created container on the web interface.<br />
<br />
== Create a description contentInstance ==<br />
* Send a HTTP request with the following parameters to create a description content instance resource under the "DESCRIPTOR" container.<br />
{{CTable}}<br />
| Field || Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR/DESCRIPTOR<br />
|-<br />
| Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=4<br />
|-<br />
| Body||<pre> <br />
<om2m:cin xmlns:om2m="http://www.onem2m.org/xml/protocols"><br />
<cnf>message</cnf><br />
<con><br />
<obj><br />
<str name="type" val="Temperature_Sensor"/><br />
<str name="location" val="Home"/><br />
<str name="appId" val="MY_SENSOR"/><br />
<op name="getValue" href="/in-cse/MY_SENSOR/DATA/la" <br />
in="obix:Nil" out="obix:Nil" is="retrieve"/><br />
</obj><br />
</con><br />
</om2m:cin><br />
</pre><br />
|}<br />
* Check the created content instance on the web interface.<br />
<br />
== Create a DATA container == <br />
* Send a HTTP request with the following parameters to create a "DATA" container resource under the "MY_SENSOR" application.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
| URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR<br />
|-<br />
| Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=3 <br> X-M2M-NM: DATA<br />
|-<br />
|Body|| <pre><br />
<om2m:cnt xmlns:om2m="http://www.onem2m.org/xml/protocols"><br />
</om2m:cnt></pre><br />
|}<br />
* Check the created container on the web interface.<br />
<br />
== Create a data contentInstance ==<br />
* Send a HTTP request with the following parameters to create a data content instance resource under the "DATA" container.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/~/in-cse/in-name/MY_SENSOR/DATA<br />
|-<br />
|Method|| POST<br />
|-<br />
|Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=4<br />
|-<br />
|Body|| <pre> <br />
<obj><br />
<str name="appId" val="MY_SENSOR"/><br />
<str name="category" val="temperature "/><br />
<int name="data" val="27"/><br />
<int name="unit" val="celsius"/><br />
</obj></pre><br />
|}<br />
* Check the created content instance on the web interface.<br />
<br />
== Subscribe to MY_SENSOR data ==<br />
* Download the monitor server sample from this link: [https://www.dropbox.com/s/yjvuf7hnn5q83md/monitor-bin.zip?dl=0 Monitor-bin]. (The monitor source code is available here: [https://www.dropbox.com/s/y95qx9dn9rr3tfm/Monitor.java?dl=0 Monitor.java ]).<br />
* Extract the rar file.<br />
* You can configure the Monitor listening port and context using the "config.properties"<br />
* Start the Monitor server using the following command:<br />
<pre><br />
> java -jar monitor.jar<br />
</pre><br />
* By default the monitor starts listening on port=1400 and context=/monitor.<br />
[[File:console-monitor.png|center|600px|thumb|Monitor console: the server is started]]<br />
<br />
* Send a HTTP request with the following parameters to create a "Subscription" resource for receive asynchronously events from "MY_SENSOR" application. <br />
* The monitor listening URL (http://127.0.0.1:1400/monitor) should be added on the "nu" tag of the subscription representation.<br />
{{CTable}}<br />
|Field|| Value<br />
|-<br />
|URL|| http://127.0.0.1:8080/om2m/~/in-cse/in-name/MY_SENSOR/DATA<br />
|-<br />
|Method|| POST<br />
|-<br />
| Header|| X-M2M-Origin: admin:admin <br> Content-Type: application/xml;ty=23 <br> X-M2M-NM: SUB_MY_SENSOR<br />
|-<br />
|Body||<pre><br />
<m2m:sub xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<nu>http://localhost:1400/monitor</nu><br />
<nct>2</nct><br />
</m2m:sub></pre><br />
|}<br />
<br />
* Check the created subscription on the web interface.<br />
<br />
* Create a new event content instance resource under the "DATA" container.<br />
* The new event is published to interested subscribers by the gateway. <br />
* Here is an example of the "Notify" XML representation:<br />
<br />
<pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols"><br />
<nev><br />
<rep rn="cin_name1"><br />
<ty>4</ty><br />
<ri>cin-46677406</ri><br />
<pi>/in-cse/cnt-397256037</pi><br />
<ct>20151104T162611</ct><br />
<lt>20151104T162611</lt><br />
<st>0</st><br />
<cnf>message</cnf><br />
<cs>11</cs><br />
<con>hello world</con><br />
</rep><br />
<rss>1</rss><br />
</nev><br />
<sud>false</sud><br />
<sur>/in-cse/in-name/MY_SENSOR/DATA/SUB_MY_SENSOR</sur><br />
</m2m:sgn><br />
</pre><br />
<br />
* The Monitor receives a "Notify" resource including the new "ContentInstance". <br />
* Remember that the "Notify" resource has a generic structure to support notifications for other type of resources such as "AE", "Container", "Group", "AccessControlPolicy", etc.</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=Eclipse_Unconference_Europe_2015&diff=393794Eclipse Unconference Europe 20152015-11-13T10:13:12Z<p>Garzone-eclipse.outlook.fr: </p>
<hr />
<div>=Eclipse Unconference=<br />
This page is the live agenda for the Eclipse Unconference in Ludwigsburg on November 2, 2015 at the Forum.<br />
<br />
The Unconference is more and more successful so please get in touch with us (gael.blondelle _ at _ eclipse.org and susan.iwai _ at _ eclipse.org) if you need some space for your group.<br />
<br />
==Registration and logistics==<br />
Unlike the regular conference, this Unconference is organized by '''YOU'''. There will be food and beverages, power and projectors, and meeting rooms. We will coordinate just a bit to avoid obvious topic overlaps during the day and to make sure that everybody has the right place for their group. <br />
<br />
Ther will be some spaces dedicated to a Dev co-working space, that is, spaces where developers meet and work together on their preferred projects. Both experienced and new contributors will find that the co-working space is a good chance to meet and learn from each other.<br />
<br />
Registration: If you plan to participate, you have to register for the Unconference on the [https://www.eclipsecon.org/europe2015/registration conference registration] page.<br />
<br />
==Unconference Organizers==<br />
* Gaël Blondelle: Eclipse Foundation Europe - PolarSys / Embedded Systems<br />
* Susan Iwai: Eclipse Foundation Europe - Unconference coordination<br />
* Ian Skerrett and Benjamin Cabé : IoT Working Group<br />
* Andrew Ross: LocationTech<br />
* Christian El Salloum: Interoperability and OSLC<br />
* Jay Jay Billings, Torkild Resheim, Philip Wenig: Science Working Group<br />
* Matthias Zimmermann: Scout User Group<br />
* Andreas Graff, Harald Mackamul: Automotive Working Group<br />
<br />
=Poster session=<br />
During the Unconference, we will host a poster session over our lunch break. Please send an email to gael.blondelle _at_ eclipse.org and susan.iwai _ at _ eclipse.org if you plan to come with a poster so that we make sure we have enough boards for display. Please list your poster below.<br />
<br />
Here are the posters:<br />
* Long Term Support membership / value proposition<br />
* [https://projects.eclipse.org/projects/modeling.papyrus-rt Papyrus for Real Time] (Papyrus-RT)<br />
* [http://owntracks.org/booklet/images/OwnTracksPosterA1.pdf OwnTracks Poster] OwnTracks Ecosystem - learn what OwnTracks.org built with MQTT and Eclipse/Paho<br />
* Capella Modelling Workbench<br />
* Systems Engineering and Software Engineering for Cyber-physical Systems<br />
* ReqPat: Efficient Documentation of high-quality Requirements using Controlled Natural Language<br />
* [http://profiles.yatta.de Profiles for Eclipse]: Save your Eclipse setup and share it<br />
<br />
The interoperability and OSLC session will hold a specific poster session. Please list your poster here:<br />
*<br />
<br />
=Unconference Agenda=<br />
The agenda is coming soon.<br />
<!--{| class="wikitable" border="1"<br />
|-<br />
! <br />
| align='center' | '''Bürgersaal 2'''<br />
| align='center' | '''Schubartsaal'''<br />
| align='center' | '''Seminarraum 5'''<br />
| align='center' | '''Seminarräume 1-2'''<br />
|-<br />
! 8:30-9:00 <br />
| colspan='4' align='center'|Welcome Coffee<br />
|-<br />
! 9:00-9:10 <br />
| colspan='4' align='center'|Welcome address and Program presentation (Bürgersaal 2)<br />
|-<br />
! 9:15-10:45 <br />
| [https://wiki.eclipse.org/Eclipse_Unconference_Europe_2014#Science_Working_Group Science Working Group]<br />
| [https://wiki.eclipse.org/Eclipse_Unconference_Europe_2014#IoT_Working_Group IoT Working Group]<br />
| [https://wiki.eclipse.org/Eclipse_Unconference_Europe_2014#Getting_Started_with_Papyrus Getting started with Papyrus]<br />
| [https://wiki.eclipse.org/Eclipse_Unconference_Europe_2014#OSLC_Session OSLC Session]<br />
|-<br />
! 10:45-11:00<br />
| colspan='4' align='center' | Coffee Break<br />
|-<br />
! 11:00-12:30 <br />
| [https://wiki.eclipse.org/Eclipse_Unconference_Europe_2014#Science_Working_Group Science Working Group]<br />
| [https://wiki.eclipse.org/Eclipse_Unconference_Europe_2014#IoT_Working_Group IoT Working Group]<br />
| [https://wiki.eclipse.org/Eclipse_Unconference_Europe_2014#Customizing_Papyrus_for_Automotive_and_Embedded_Systems Customizing Papyrus for Automotive and Embedded Systems]<br />
| [https://wiki.eclipse.org/Eclipse_Unconference_Europe_2014#OSLC_Session OSLC Session]<br />
|-<br />
! 12:30-14:00<br />
| colspan='4' align='center' | Lunch and Poster Session<br />
|-<br />
! 14:00-15:30 <br />
| [https://wiki.eclipse.org/Eclipse_Unconference_Europe_2014#Science_Working_Group Science Working Group]<br />
| [https://wiki.eclipse.org/Eclipse_Unconference_Europe_2014#IoT_Information_Model_Repository IoT Information Model Repository]<br />
| [https://wiki.eclipse.org/Eclipse_Unconference_Europe_2014#Polarsys_Requirement_Engineering_Workshop_:_ReqCycle Polarsys Requirement Engineering Workshop : ReqCycle]<br />
| [https://wiki.eclipse.org/Eclipse_Unconference_Europe_2014#Long_Term_Support_Working_Group Long Term Support WG]<br />
|-<br />
! 15:30-16:00<br />
| colspan='4' align='center' | Coffee break ([https://wiki.eclipse.org/Eclipse_Unconference_Europe_2014#Model_Finder_Group Model Finder Group Organization])<br />
|-<br />
! 16:00-17:30 <br />
| [https://wiki.eclipse.org/Eclipse_Unconference_Europe_2014#Science_Working_Group Science Working Group]<br />
| [https://wiki.eclipse.org/Eclipse_Unconference_Europe_2014#IoT_Working_Group IoT Working Group]<br />
| [https://wiki.eclipse.org/Eclipse_Unconference_Europe_2014#PolarSys_Maturity_Assessment PolarSys maturity assessment]<br />
| [https://wiki.eclipse.org/Eclipse_Unconference_Europe_2014#Where_to_go_with_EASE.3F Where to go with EASE?]<br />
|}--><br />
<br />
=Dev Co-working Space=<br />
Tell your buddies you will be at the Dev Co-working Space! <br />
Starting noon on November 2nd, use the Dev co-working space to work on your Eclipse project. We have space for self-organizing groups to work together on open source projects, to discuss topics relevant to a broader subset of the community, and to hack code...<br />
<br />
If you want to tell the world you will be there, add yourself to the list below, and list :<br />
* Your name<br />
* Projects name in which you are or would like to be involved<br />
* When do you arrive at the Dev Co-working space<br />
<br />
Meet the developers!<br />
* ModelWriter: Ferhat Erata, Yvan Lussaud.<br />
* MQTT-Client iOS/OSX/tvOS, OwnTracks: Christoph Krey.<br />
*<br />
<br />
=Unconference session descriptions=<br />
<br />
<!--==Science Working Group==<br />
* Session coordinator: Philip Wenig<br />
* Session type: Coding session<br />
Editing and display of time series data is an ubiquitous task in scientific research. Most commonly, the needed functionality is developed by each project from the ground up. Contrary to that, it would be better to have a flexible framework that separates the editing pipeline and the display of the data. Moreover, it must be data format independent so that it can be used more widely. Specialized scientific projects could then use the framework and connect their data to the framework. Within the session, we'd like to discuss about such a framework. Moreover, coding says more than thousand words.<br />
* n-dimensional data editing<br />
* Display libraries, SWTChart, XYGraph, JavaFX, ...--><br />
<br />
== IoT Working Group ==<br />
<br />
A meeting of the Eclipse IoT community and IoT enthusiasts. Join us to learn about IoT at Eclipse and share your thoughts on the requirements for building an Internet of Things based on open source and open standards.<br />
<br />
* Session coordinators: Ian Skerrett, Benjamin Cabé<br />
<br />
==== Project Updates - 9:00am Start====<br />
* Each project will spend 10 minutes updating on their current status. The update should include:<br />
**Project Overview: Short (1 slide) reminder about your project functionality. This is for people who might be new.<br />
** Project stats: tell us how well your project is doing. Number of download, number of contributors, number of bugs opened, number of mailing list subscribers, etc.<br />
** Project plan: when is the next release and what are the key features.<br />
** Key Challenges: What challenges/issues are you having? <br />
** Collaboration Opportunities: Where do you see potential for collaboration with other Eclipse IoT projects or other communities.<br />
<br />
* Projects that will be represented<br />
** [//eclipse.org/kura/ Kura] (Luca Dazi)<br />
** [//eclipse.org/vorto/ Vorto] (Olaf Weinmann)<br />
** [//projects.eclipse.org/proposals/hawkbit hawkBit] (Kai Zimmermann) - [http://sp-collateral.apps.bosch-iot-cloud.com/slides/eclipseCon2015_unconference.html slides]<br />
** [//eclipse.org/smarthome/ Eclipse SmartHome] (Kai Kreuzer) [[:File:esh_project_update_ece2015.pdf|slides]]<br />
** [//eclipse.org/eclipsescada/ Eclipse SCADA] (Jens Reimann) [[:File:Scada_project_update_ece2015_v2.pdf|slides]]<br />
** [//eclipse.org/leshan/ Leshan/Californium] (Kai Hudalla)<br />
** [//eclipse.org/concierge/ Concierge] (Jochen Hiller) [[:File:151102_Concierge-StatusUpdate.pdf|Presentation Concierge Status Update]]<br />
** [//eclipse.org/4diac/ 4DIAC] (Alois)<br />
** [//eclipse.org/om2m/ OM2M] (Guillaume Garzone) [[:File:Om2m-project-update-ece2015.pdf|slides]]<br />
** [//eclipse.org/tiaki/ Tiaki] (Regis) [[:File:Tiaki introduction-ece2015.pdf|slides]]<br />
** [//eclipse.org/paho/ Paho/Mosquitto] (James Sutton) [[:File:PahoProjectUpdateECE2015.pdf|slides]]<br />
<br />
==== Collaborations / Invited Speakers ====<br />
<br />
* IoT Commons - Benjamin Cabe<br />
* IoT Server Discussion<br />
* Vorto Meta Model Discussion - Olaf Weinmann<br />
* AGILE: An Open Source, Adoptive & Programmable IoT Gateway for Makers & Entrepreneurs - Charalampos Doukas<br />
** A new European initiative that will include collaboration with Eclipse IoT projects.<br />
* OSGi IoT Expert Group - Tim Ward<br />
* What makes a good IoT open source project?<br />
<br />
====Open Whiteboard====<br />
* Other topics of collaboration or of interest to IoT enthusitasts<br />
<br />
== LocationTech ==<br />
This full day meeting of the LocationTech working group will cover topics of interest to participants including big geo data processing, version control of geodata, mobile applications, spatially aware desktop applications, and more. Participants can expect to meet with some of the technology leads, potential suppliers & customers, and others in a casual setting.<br />
<br />
* Session coordinator: Andrea Ross<br />
<br />
==== 9:00-10:30 Time slot 1====<br />
<br />
==== 11:00-12:30 Geospatial Mobile Apps Using an Open Source Toolkit ====<br />
mousebird consulting inc is a member of LocationTech and we make the WhirlyGlobe-Maply open source geospatial display toolkit. It's used in a fair number of big, popular apps like Dark Sky and the National Geographic World Atlas for iOS.<br />
<br />
Ever wanted to write your own weather, aviation, or map app? It's not actually that difficult to get started. We'll go over some examples of apps that use WhirlyGlobe-Maply and point out the relevant tutorials. If anyone wants to actually follow along, you'll need a mac, a copy of Xcode, and the WhirlyGlobe-Maply toolkit.<br />
<br />
==== 14:00-15:30 Time slot 3====<br />
==== 16:00-17:30 Time slot 4====<br />
<br />
== Science Working Group ==<br />
Meet and greet with the Science Working Group community. Project updates, ...<br />
<br />
* Session coordinator: Jay Jay Billings, Torkild Resheim, Philip Wenig<br />
* Other participants : Erwin De Ley, Tim Jagenberg<br />
<br />
==== 9:00-10:30 Time slot 1====<br />
==== 11:00-12:30 Time slot 2====<br />
==== 14:00-15:30 Time slot 3====<br />
==== 16:00-17:30 Time slot 4====<br />
<br />
== Scout User Group ==<br />
<br />
The [[Scout/UserGroupMeeting/2015|Scout User Group Meeting]] is the place to learn and exchange about building business applications with the Scout framework. The day offers a chance to hear the latest on updates to the platform, exchange with fellow users or even get yourself started using Scout. Scout users are invited to present their experiences and ideas for using and developing the framework. [https://wiki.eclipse.org/Scout/UserGroupMeeting/2015 Find out more!]<br />
<br />
* Session coordinator: Matthias Zimmermann<br />
<br />
==== 9:00-10:30 The new Scout Java Platform ====<br />
* Intro/Teaser<br />
* Platform Overview<br />
* Platform, Bean Support and Exensibility<br />
==== 11:00-12:30 Industry Use Cases ====<br />
* Various Contributions<br />
==== 14:00-15:30 The new HTML5 UI ====<br />
* Overview and Features<br />
* Architecture<br />
* Custom Styling<br />
* Building and CI<br />
==== 16:00-17:30 Migration to Neon ====<br />
* Migration from Mars to Scout Neon<br />
* Hands-on Session<br />
<br />
== Workshop on Life-cycle Interoperability - OSLC in Practice ==<br />
<br />
The goal of the “Workshop on Life-cycle Interoperability” is to propose and discuss ways to achieve sustainable interoperability for embedded systems development environments. A special focus will be on Open Services for Lifecycle Collaboration (OSLC) and the challenge of putting this standard into practice. [https://wiki.eclipse.org/Eclipse_Unconference_Europe_2015/OSLCInPractice Find out more]!<br />
<br />
* Session coordinator: Annemarie Hamedler<br />
<br />
==== 10:30 - 11:00 Morning Coffee & Welcome ====<br />
==== 11:00 - 12:30 Impulse Talks by industrial leaders====<br />
==== 14:00 - 15:30 Interactive Workshop and poster session====<br />
==== 16:00 - 17:30 Interactive Workshop and poster session====<br />
<br />
== PolarSys and Automotive projects update ==<br />
<br />
The goal of this session is to share short updates from PolarSys and Automotive WG projects with the community.<br />
If you have a talk in the regular conference, please do not give us a short version of the talk, but rather tell us the new and noteworthy of your project.<br />
In order to have a slot, please send an email to the coordinators, with the topic, the time needed, and your travel constraints (like we should plan your project update after noon is you travel in the morning).<br />
<br />
* Session coordinator: Gaël Blondelle, Susan Iwai<br />
<br />
==== 10:30 - 11:00 Morning Coffee & Welcome ====<br />
==== 11:00 - 12:30 Project updates batch 1====<br />
==== 14:00 - 15:30 Project updates batch 2====<br />
==== 16:00 - 17:30 Project update batch 3====<br />
<br />
== Automotive Working Group meeting ==<br />
<br />
This meeting is an opportunity to share information between the members of the Automotive WG. Feel free to join the meeting.<br />
<br />
* Session coordinator: Andreas Graff, Harald Mackamul</div>Garzone-eclipse.outlook.frhttps://wiki.eclipse.org/index.php?title=File:Om2m-project-update-ece2015.pdf&diff=393793File:Om2m-project-update-ece2015.pdf2015-11-13T10:11:14Z<p>Garzone-eclipse.outlook.fr: OM2M project update for ECE 2015 - Unconference</p>
<hr />
<div>OM2M project update for ECE 2015 - Unconference</div>Garzone-eclipse.outlook.fr