-
Notifications
You must be signed in to change notification settings - Fork 8
/
service.onem2m.html
9677 lines (9315 loc) · 946 KB
/
service.onem2m.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>153 Service Layer API for oneM2M™ - OSGi Compendium 8</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
<link rel="home" href="index.html" title="OSGi Compendium" />
<link rel="up" href="index.html" title="OSGi Compendium" />
<link rel="prev" href="service.cdi.html" title="152 CDI Integration Specification" />
<link rel="next" href="dmtree.residential.html" title="154 Residential Device Management Tree Specification" />
<meta name="Section-title" content="153 Service Layer API for oneM2M™" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="shortcut icon" href="images/favicon.png" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="css/custom.css" />
<link rel="stylesheet" type="text/css" href="css/github.css" />
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Ubuntu:regular,bold&subset=Latin" /><script type="text/javascript" src="js/highlight.pack.js"></script><script type="text/javascript" src="js/main.js"></script></head>
<body>
<div id="fullbody">
<div id="header">
<div class="menu-top-container"></div>
<div id="shadow-block"><a class="logo" href="index.html"><img src="images/OSGi.svg" alt="OSGi Working Group Documentation" /><h1>OSGi Compendium Release 8</h1></a></div>
</div>
<div id="mobile-menu-icon">⋮</div>
<div id="column-two">
<div id="content">
<div id="scrollable">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr>
<td width="20%" align="left"><a accesskey="p" href="service.cdi.html">Prev</a>
</td>
<th width="60%" align="center"> </th>
<td width="20%" align="right"> <a accesskey="n" href="dmtree.residential.html">Next</a></td>
</tr>
</table>
<hr />
</div>
<div class="chapter">
<div xmlns="" class="titlepage">
<div>
<div>
<h1 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="service.onem2m"></a><span xmlns="" class="number">153</span> Service Layer API for oneM2M™
</h1>
</div>
<div>
<p xmlns="http://www.w3.org/1999/xhtml" class="releaseinfo"><a xmlns="" class="xref" href="service.onem2m.html#org.osgi.service.onem2m" title="153.10 org.osgi.service.onem2m">Version 1.0</a></p>
</div>
</div>
</div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h2 xmlns="http://www.w3.org/1999/xhtml" class="title" style="clear: both"><a xmlns="" class="anchor" id="d0e143638"></a><span xmlns="" class="number">153.1</span> Introduction of oneM2M
</h2>
</div>
</div>
</div>
<p>oneM2M™ is a standard for IoT platform, which is standardized by oneM2M partnership project.
oneM2M defines set of functionalities that are commonly used in IoT applications, which is called Common Services Function
(CSF).
The implementation of the CSF is provided by Communication Service Entity (CSE).
oneM2M also defines the interface to use the CSF with REST oriented API that consist of limited types of operation (CREATE,
RETRIEVE, UPDATE, DELETE, NOTIFY) on many types of resources.
Applications of oneM2M use the interface to communicate with CSEs.
In a system managed by a single service provider, multiple CSEs can exist and they form tree structure. The root CSE is called
Infrastructure Node CSE (IN-CSE).
Each application connects to one of CSEs in the system. CSEs have routing capability and application can send request to any
CSEs in the system through the directly-connected CSE.
</p>
<p>
One of characteristic aspects of oneM2M is to allow multiple protocols and serialization formats for messages. Currently
specified protocols are HTTP, CoAP, MQTT and WebSocket, and
specified serialization are XML, JSON and CBOR (Concise Binary Object Representation). To make specification coherent,
oneM2M specifications are separated into abstract level and concrete level.
As abstract level, TS-0001 defines the oneM2M architecuture and resource types and
TS-0004 defines data procedures and data structures.
As concrete level, TS-0008 ,
TS-0009 ,
TS-0010 , and
TS-0020 define concrete protocol which are mappoed
to model of the abstract level.
Here, the interface defined in abstract level, which independent on concrete protocols, is regarded as oneM2M Service
Layer.
</p>
<p>oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) register oneM2M trademarks and logos in their respective
jurisdictions.
</p>
</div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h2 xmlns="http://www.w3.org/1999/xhtml" class="title" style="clear: both"><a xmlns="" class="anchor" id="d0e143647"></a><span xmlns="" class="number">153.2</span> Application Portability Problem of oneM2M
</h2>
</div>
</div>
</div>
<p>
One of potential problems is application portability.
oneM2M specifies protocol based interfaces, but doesn’t specify a programming level API.
Without a standardized API, application program tends to be built tightly coupled with the libraries handling the communication
method (combination of protocol and serialization) that is initially intend to use.
In that case it would be hard to operate the application in another environment where different communication method
is used; basically it is required to modify the application drastically.
oneM2M could introduce segmentation of ecosystem within oneM2M compliant applications due to the lack of application
portability.
</p>
</div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h2 xmlns="http://www.w3.org/1999/xhtml" class="title" style="clear: both"><a xmlns="" class="anchor" id="d0e143652"></a><span xmlns="" class="number">153.3</span> Introduction of Service Layer API for oneM2M
</h2>
</div>
</div>
</div>
<p>
This chapter provides interface to oneM2M applications for communicating communicate CSE at Service Layer of oneM2M.
The providing API is protocol and serialization agnostic for preventing the problem above.
Once application developer write code, it can be run in other environment where different communication method is
used.
</p>
<p>
Another benefit of the service is reduction of computational resources, typically latency of execution in a certain
cases, where both application and CSE is implemented on OSGi framework.
In that case, it is possible to reduce executiontime for serialization/deserialization of data, context-switch of applications,
compared to the case where they communicates with a certain communication protocol.
</p>
</div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h2 xmlns="http://www.w3.org/1999/xhtml" class="title" style="clear: both"><a xmlns="" class="anchor" id="d0e143659"></a><span xmlns="" class="number">153.4</span> Essentials
</h2>
</div>
</div>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p><span class="emphasis"><em>Protocol Agnostic</em></span> - API is independent on protocol that are used in communications. oneM2M specifies multiple protocols, which are HTTP, CoAP,
MQTT and WebSocket.
conversion operations.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>Serialization Agnostic</em></span> - API is independent on serialization that are actually used in communications. oneM2M specifies multiple serializations,
which are XML, JSON and CBOR .
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>Support of synchoronous and asynchronous method call</em></span> - API allows both of calling manners.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>Use of Data Transfer Object (DTO)</em></span> - DTO is used as parameters passing on API. Since oneM2M defines many types, concrete DTOs are specified for the higher level
structure, and for lower structures generic DTO is used.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>Low level and high level operations</em></span> - API allows for applications to use both low level operation and high level operation, where low level operation allows
all possible oneM2M operations and high level operation allows resource level operations, which are create, retrieve, update,
and delete.
</p>
</li>
</ul>
</div>
</div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h2 xmlns="http://www.w3.org/1999/xhtml" class="title" style="clear: both"><a xmlns="" class="anchor" id="d0e143688"></a><span xmlns="" class="number">153.5</span> Entities
</h2>
</div>
</div>
</div>
<p>The following entities are used in this specification:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p><span class="emphasis"><em>Application Bundle</em></span> - Application, which use oneM2M CSE's capability. This specification assumes that an application bundle consists an oneM2M
application.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>ServiceLayer</em></span> - This is the API used by oneM2M applications.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>NotificationListener</em></span> - Listener Interface, which is necessary to implement by oneM2M applications, when then need to received notifications.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>ServiceLayer Implementation Bundle</em></span> - Bundle providing implementation of ServiceLayer and its ServiceFactory.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>oneM2M CSE</em></span> - oneM2M's Server. It may exist remotely or locally.
</p>
</li>
</ul>
</div>
<div class="figure"><a xmlns="" class="anchor" id="d0e143719"></a><p class="title"><strong>Figure <span xmlns="" class="number">153</span>.1 Entity overview of Service Layer API for oneM2M</strong></p>
<div class="figure-contents">
<div class="mediaobject" align="center"><img src="images/153-onem2m-classes.png" align="middle" width="540" height="369" alt="Entity overview of Service Layer API for oneM2M" /></div>
</div>
</div><br class="figure-break" /></div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h2 xmlns="http://www.w3.org/1999/xhtml" class="title" style="clear: both"><a xmlns="" class="anchor" id="d0e143725"></a><span xmlns="" class="number">153.6</span> oneM2M ServiceLayer
</h2>
</div>
</div>
</div>
<p>
oneM2M ServiceLayer is the interface used by an application for sending request and get response as return method.
It contains low level API and high level API.
</p>
<p>
request() method allows very raw data type access and it enables all possible
message exchanges among oneM2M entities. This is called the low level API.
The method takes requestPrimitive as an argument and returns responseRequest.
It allows all possible operation of oneM2M. For the return type, OSGi Promise
( <a xmlns="" class="xref" href="util.promise.html" title="705 Promises Specification"><em xmlns="http://www.w3.org/1999/xhtml">Promises Specification</em></a> ) is used for allowing synchronous and
asynchronous calling manner.
</p>
<p>
The low level API may be redundant to application developers, because they need to write composition of requestPrimitive
and decomposition of responsePrimitive.
Following methods allow application developers to develop application with less lines of code.
They provides higher level of abstraction; operation level of resource such as create, retrieve,
update, delete, notify and discovery. They cover typical oneM2M operations but do not cover all of
possible messages of oneM2M.
</p>
<p>
Implementation of these high level API automatically inserts ‘requestID’ and ‘from’ parameter to RequestDTO.
</p>
<p>
Following example shows temperature measurement application using
container resource and contentInstance resource.
</p><pre xmlns="" class="programlisting"><code>
ServiceReference<ServiceLayer> sr = bc
.getServiceReference(ServiceLayer.class);
ServiceLayer sl = bc.getService(sr);
ResourceDTO container = new ResourceDTO();
container.resourceType = Constants.RT_contentInstance;
container.resourceName = "temperatureStore";
sl.create("/CSE1/csebase", container).getValue();
ScheduledExecutorService service = Executors
.newSingleThreadScheduledExecutor();
AtomicInteger count = new AtomicInteger(0);
service.scheduleAtFixedRate(() -> {
ResourceDTO instance = new ResourceDTO();
instance.resourceType = Constants.RT_contentInstance;
instance.resourceName = "instance" + count.getAndIncrement();
instance.attribute = new HashMap<String,Object>();
instance.attribute.put("content", measureTemperature());
sl.create("/CSE1/csebase/temperatureStore", instance);
}, 0, 60, TimeUnit.SECONDS);
</code></pre><p>
</p>
<p>
Following example shows visualizing application of temperature data.
</p><pre xmlns="" class="programlisting"><code>
ServiceReference<ServiceLayer> sr = (ServiceReference<ServiceLayer>) bc
.getServiceReference("org.osgi.service.onem2m.ServiceLayer");
ServiceLayer sl = bc.getService(sr);
FilterCriteriaDTO fc = new FilterCriteriaDTO();
fc.createdAfter = "20200101T120000";
fc.createdBefore = "20200101T130000";
List<Integer> resourceTypes = new ArrayList<Integer>();
resourceTypes.add(Constants.RT_contentInstance);
fc.resourceType = resourceTypes;
fc.filterOperation = FilterOperation.AND;
List<String> l = sl.discovery("/CSE1/csebase/temperatureStore", fc)
.getValue();
List<Pair<String,Double>> renderData = new ArrayList<Pair<String,Double>>();
for (String uri : l) {
ResourceDTO resource = sl.retrieve(uri).getValue();
renderData.add(new Pair<String,Double>(resource.creationTime,
(Double) resource.attribute.get("content")));
}
renderService(renderData);
</code></pre></div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h2 xmlns="http://www.w3.org/1999/xhtml" class="title" style="clear: both"><a xmlns="" class="anchor" id="d0e143747"></a><span xmlns="" class="number">153.7</span> NotificationListener
</h2>
</div>
</div>
</div>
<p>
NotificationListener is an interface for receiving oneM2M notification.
An application that needs to receive
oneM2M notifications must implement the interface and register it to the
OSGi registry.
</p>
<p>
A ServiceLayer Implementation Bundle must call the notify() method of
the NotificationListener, when it receives notification from CSE.
In notification, target address is designated by AE-ID.
The ServiceLayer Implementation Bundle finds the coresponding instance of
the NotificationListener by
checking its registerer bundle and checking internal mapping table of
AE-ID and application bundle.
</p>
<p>
</p><pre xmlns="" class="programlisting"><code>
public class MyListener implements NotificationListener {
public void notified(RequestPrimitiveDTO request){
NotificationDTO notification = request.content.notification;
NotificationEventDTO event = notification.notificationEvent;
Object updatedResource = event.representation;
NotificationEventType type = event.notificationEventType;
if( type == NotificationEventType.update_of_resource ){
// check updated resource, execute some actions.
}
}
}
@Activate
public void activate(BundleContext bc) {
NotificationListener l = new MyListener();
bc.registerService(NotificationListener.class, l, null);
}
}
</code></pre><p>
</p>
</div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h2 xmlns="http://www.w3.org/1999/xhtml" class="title" style="clear: both"><a xmlns="" class="anchor" id="d0e143759"></a><span xmlns="" class="number">153.8</span> DTO
</h2>
</div>
</div>
</div>
<p>
OSGi DTOs are used for representing data structured passed on the API.
Some of the data structures, which are directly referred from API or
in small number of hops, are specified with concrete field names.
The following figure shows DTOs with concrete field names, and reference
relationship of class.
Following DTO's rule, instances must not have loop reference relationship.
</p>
<div class="figure"><a xmlns="" class="anchor" id="d0e143764"></a><p class="title"><strong>Figure <span xmlns="" class="number">153</span>.2 DTOs representing high level structures</strong></p>
<div class="figure-contents">
<div class="mediaobject" align="center"><img src="images/153-onem2m-dto.png" align="middle" width="540" height="369" alt="DTOs representing high level structures" /></div>
</div>
</div><br class="figure-break" /><p>
ResourceDTO represents oneM2M resource.
ResourceDTO has both fields with concrete names and a field (named as attribute) for having sub-elements in generic
manner.
All of fields of the ResourceDTO represent attributes. Most of attributes have a primitive type and part of attributes
have structured value.
For structured value, if it possible defined concrete DTOs must be used, otherwise GenericDTO must be used.
</p>
<p>
oneM2M specifies two types of key names for representing name of resources, attributes, and elements of data structure,
which are long name and short name. Long name is human readable representation, for example "resourceID",
meanwhile short name is compact representation for minimizing network transfer, consist with typically 2-4 alphabetical
characters, for example "ri".
All field names in concrete DTOs are based on long name. Long name should be used for key names of GenericDTO and attribute
names of ResourceDTO.
</p>
</div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h2 xmlns="http://www.w3.org/1999/xhtml" class="title" style="clear: both"><a xmlns="" class="anchor" id="d0e143774"></a><span xmlns="" class="number">153.9</span> Security
</h2>
</div>
</div>
</div>
<p>
Implementation of ServiceLayer may use credentials on behalf of application bundles on the communication with oneM2M
CSE.
So ServiceLayer Implementation should pass the service reference of ServiceLayer to only the proper application bundle.
Use of ServiceFactory is to realize this. Application Bundles should not pass the service reference to other application bundles.
</p>
<p>
How to configure those credentials is left to developer of ServiceLayer Implementation, and it is out of scope the
specification.
</p>
</div>
<div class="section package">
<div xmlns="" class="titlepage">
<div>
<div>
<h2 xmlns="http://www.w3.org/1999/xhtml" class="title" style="clear: both"><a xmlns="" class="anchor" id="org.osgi.service.onem2m"></a><span xmlns="" class="number">153.10</span> org.osgi.service.onem2m
</h2>
</div>
<div>
<p xmlns="http://www.w3.org/1999/xhtml" class="releaseinfo">Version 1.0</p>
</div>
</div>
</div>
<p>
Service Layer API for oneM2M Specification Package Version 1.0.
</p>
<p>
Bundles wishing to use this package must list the package in the
Import-Package header of the bundle's manifest. This package has two types of
users: the consumers that use the API in this package and the providers that
implement the API in this package.
</p>
<p>
Example import for consumers using the API in this package:
</p>
<p>
<code class="code">Import-Package: org.osgi.service.onem2m; version="[1.0,2.0)"</code>
</p>
<p>
Example import for providers implementing the API in this package:
</p>
<p>
<code class="code">Import-Package: org.osgi.service.onem2m; version="[1.0,1.1)"</code>
</p>
<div class="section summary">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="d0e143807"></a><span xmlns="" class="number">153.10.1</span> Summary
</h3>
</div>
</div>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a xmlns="" class="link" href="service.onem2m.html#org.osgi.service.onem2m.NotificationListener" title="153.10.2 public interface NotificationListener">
<code xmlns="http://www.w3.org/1999/xhtml" class="code">NotificationListener</code>
</a> -
Interface to receive notification from other oneM2M entities.
</p>
</li>
<li class="listitem">
<p>
<a xmlns="" class="link" href="service.onem2m.html#org.osgi.service.onem2m.OneM2MException" title="153.10.3 public class OneM2MException extends IOException">
<code xmlns="http://www.w3.org/1999/xhtml" class="code">OneM2MException</code>
</a> -
General Exception for oneM2M.
</p>
</li>
<li class="listitem">
<p>
<a xmlns="" class="link" href="service.onem2m.html#org.osgi.service.onem2m.ServiceLayer" title="153.10.4 public interface ServiceLayer">
<code xmlns="http://www.w3.org/1999/xhtml" class="code">ServiceLayer</code>
</a> -
Primary Interface for an oneM2M application entity to send request and get
response to/from other oneM2M entity.
</p>
</li>
</ul>
</div>
</div>
<div class="section class">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="org.osgi.service.onem2m.NotificationListener"></a><span xmlns="" class="number">153.10.2</span> public interface NotificationListener
</h3>
</div>
</div>
</div>
<p>
Interface to receive notification from other oneM2M entities.
</p>
<p>
Application that receives notification must implement this interface and
register to OSGi service registry. No service property is required.
</p>
<div class="section method">
<div xmlns="" class="titlepage">
<div>
<div>
<h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="org.osgi.service.onem2m.NotificationListener.notified-RequestPrimitiveDTO-"></a><span xmlns="" class="number">153.10.2.1</span> public void notified(RequestPrimitiveDTO request)
</h4>
</div>
</div>
</div>
<p xmlns="" class="parameter"><label>request</label><span>request primitive</span></p>
<p xmlns="" class="description"><label>□</label><span>
receive notification.
</span></p>
</div>
</div>
<div class="section class">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="org.osgi.service.onem2m.OneM2MException"></a><span xmlns="" class="number">153.10.3</span> public class OneM2MException<br xmlns="" /> extends IOException
</h3>
</div>
</div>
</div>
<p>
General Exception for oneM2M.
</p>
<div class="section method">
<div xmlns="" class="titlepage">
<div>
<div>
<h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="org.osgi.service.onem2m.OneM2MException.OneM2MException-String-int-"></a><span xmlns="" class="number">153.10.3.1</span> public OneM2MException(String message, int errorCode)
</h4>
</div>
</div>
</div>
<p xmlns="" class="parameter"><label>message</label><span>The exception message.</span></p>
<p xmlns="" class="parameter"><label>errorCode</label><span>The exception error code.</span></p>
<p xmlns="" class="description"><label>□</label><span>
Construct a OneM2MException with a message and an error code.
</span></p>
</div>
<div class="section method">
<div xmlns="" class="titlepage">
<div>
<div>
<h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="org.osgi.service.onem2m.OneM2MException.getErrorCode--"></a><span xmlns="" class="number">153.10.3.2</span> public int getErrorCode()
</h4>
</div>
</div>
</div>
<p xmlns="" class="description"><label>□</label><span>
Return the error code for the exception.
</span></p>
<p xmlns="" class="parameter"><label>Returns</label><span>The error code for the exception.</span></p>
</div>
</div>
<div class="section class">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="org.osgi.service.onem2m.ServiceLayer"></a><span xmlns="" class="number">153.10.4</span> public interface ServiceLayer
</h3>
</div>
</div>
</div>
<p>
Primary Interface for an oneM2M application entity to send request and get
response to/from other oneM2M entity.
</p>
<p>
It contains low level API and high level API. The only low level method is
request() and other methods are categorized as high level API.
</p>
<p xmlns="" class="parameter"><label>Provider Type</label><span>Consumers of this API must not implement this type</span></p>
<div class="section method">
<div xmlns="" class="titlepage">
<div>
<div>
<h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="org.osgi.service.onem2m.ServiceLayer.create-String-ResourceDTO-"></a><span xmlns="" class="number">153.10.4.1</span> public Promise<ResourceDTO> create(String uri, ResourceDTO resource)
</h4>
</div>
</div>
</div>
<p xmlns="" class="parameter"><label>uri</label><span>URI for parent resource of the resource being created.</span></p>
<p xmlns="" class="parameter"><label>resource</label><span>resource data</span></p>
<p xmlns="" class="description"><label>□</label><span>
create resource
</span></p>
<p>
The create() method is a method to create new resource under specified
uri. The second argument resource is expression of resource to be
generated. The resourceType field of the resourceDTO must be assigned.
For other fields depends on resource type. Section 7.4 of TS-00004
specifies the optionalities of the fields.
</p>
<p xmlns="" class="parameter"><label>Returns</label><span>Promise of created resource</span></p>
</div>
<div class="section method">
<div xmlns="" class="titlepage">
<div>
<div>
<h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="org.osgi.service.onem2m.ServiceLayer.delete-String-"></a><span xmlns="" class="number">153.10.4.2</span> public Promise<Boolean> delete(String uri)
</h4>
</div>
</div>
</div>
<p xmlns="" class="parameter"><label>uri</label><span>target URI for deleting resource</span></p>
<p xmlns="" class="description"><label>□</label><span>
delete resource
</span></p>
<p>
delete resource on the URI specified by uri argument.
</p>
<p xmlns="" class="parameter"><label>Returns</label><span>promise of execution status</span></p>
</div>
<div class="section method">
<div xmlns="" class="titlepage">
<div>
<div>
<h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="org.osgi.service.onem2m.ServiceLayer.discovery-String-FilterCriteriaDTO-"></a><span xmlns="" class="number">153.10.4.3</span> public Promise<List<String>> discovery(String uri, FilterCriteriaDTO fc)
</h4>
</div>
</div>
</div>
<p xmlns="" class="parameter"><label>uri</label><span>URI for resource tree to start the search</span></p>
<p xmlns="" class="parameter"><label>fc</label><span>filter criteria selecting resources</span></p>
<p xmlns="" class="description"><label>□</label><span>
find resources with filter condition specified in fc argument.
</span></p>
<p>
Discovery Result Type is kept as blank and default value of target CSE is
used for the parameter.
</p>
<p xmlns="" class="parameter"><label>Returns</label><span>list of URIs matching the condition specified in fc</span></p>
</div>
<div class="section method">
<div xmlns="" class="titlepage">
<div>
<div>
<h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="org.osgi.service.onem2m.ServiceLayer.discovery-String-FilterCriteriaDTO-DesiredIdentifierResultType-"></a><span xmlns="" class="number">153.10.4.4</span> public Promise<List<String>> discovery(String uri, FilterCriteriaDTO fc, RequestPrimitiveDTO.DesiredIdentifierResultType
drt)
</h4>
</div>
</div>
</div>
<p xmlns="" class="parameter"><label>uri</label><span>URI for resource tree to start the search</span></p>
<p xmlns="" class="parameter"><label>fc</label><span>filter criteria</span></p>
<p xmlns="" class="parameter"><label>drt</label><span>Discovery Result Type (structured/unstructured)</span></p>
<p xmlns="" class="description"><label>□</label><span>
find resources with filter condition specified in fc argument.
</span></p>
<p>
With this method application can specify desired identifier in result
</p>
<p xmlns="" class="parameter"><label>Returns</label><span>list of URIs matching the condition specified in fc</span></p>
</div>
<div class="section method">
<div xmlns="" class="titlepage">
<div>
<div>
<h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="org.osgi.service.onem2m.ServiceLayer.notify-String-NotificationDTO-"></a><span xmlns="" class="number">153.10.4.5</span> public Promise<Boolean> notify(String uri, NotificationDTO notification)
</h4>
</div>
</div>
</div>
<p xmlns="" class="parameter"><label>uri</label><span>uri of destination</span></p>
<p xmlns="" class="parameter"><label>notification</label><span>content of notification</span></p>
<p xmlns="" class="description"><label>□</label><span>
send notification
</span></p>
<p></p>
<p xmlns="" class="parameter"><label>Returns</label><span>Promise of notification execution status</span></p>
</div>
<div class="section method">
<div xmlns="" class="titlepage">
<div>
<div>
<h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="org.osgi.service.onem2m.ServiceLayer.request-RequestPrimitiveDTO-"></a><span xmlns="" class="number">153.10.4.6</span> public Promise<ResponsePrimitiveDTO> request(RequestPrimitiveDTO request)
</h4>
</div>
</div>
</div>
<p xmlns="" class="parameter"><label>request</label><span>request primitive</span></p>
<p xmlns="" class="description"><label>□</label><span>
send a request and receive response.
</span></p>
<p>
This method allows very raw data type access and it enables all possible
message exchanges among oneM2M entities. This is called the low level
API. This method allows all possible operation of oneM2M. For the return
type, OSGi Promise is used for allowing synchronous and asynchronous
calling manner.
</p>
<p xmlns="" class="parameter"><label>Returns</label><span>promise of ResponseDTO.</span></p>
</div>
<div class="section method">
<div xmlns="" class="titlepage">
<div>
<div>
<h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="org.osgi.service.onem2m.ServiceLayer.retrieve-String-"></a><span xmlns="" class="number">153.10.4.7</span> public Promise<ResourceDTO> retrieve(String uri)
</h4>
</div>
</div>
</div>
<p xmlns="" class="parameter"><label>uri</label><span>URI for retrieving resource</span></p>
<p xmlns="" class="description"><label>□</label><span>
retrieve resource
</span></p>
<p>
retrieve resource on URI specified by uri argument. This method retrieve
all attributes of the resource.
</p>
<p xmlns="" class="parameter"><label>Returns</label><span>retrieved resource data</span></p>
</div>
<div class="section method">
<div xmlns="" class="titlepage">
<div>
<div>
<h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="org.osgi.service.onem2m.ServiceLayer.retrieve-String-List-"></a><span xmlns="" class="number">153.10.4.8</span> public Promise<ResourceDTO> retrieve(String uri, List<String> targetAttributes)
</h4>
</div>
</div>
</div>
<p xmlns="" class="parameter"><label>uri</label><span>URI for retrieving resource</span></p>
<p xmlns="" class="parameter"><label>targetAttributes</label><span>names of the target attribute</span></p>
<p xmlns="" class="description"><label>□</label><span>
retrieve resource with selected attributes.
</span></p>
<p>
retrieve resource on URI specified by uri argument. This method retrieve
selected attributes by targetAttributes argument. The retrieve() methods
are methods to retrieve resource on URI specified by uri argument.
</p>
<p xmlns="" class="parameter"><label>Returns</label><span>retrieved resource data</span></p>
</div>
<div class="section method">
<div xmlns="" class="titlepage">
<div>
<div>
<h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="org.osgi.service.onem2m.ServiceLayer.update-String-ResourceDTO-"></a><span xmlns="" class="number">153.10.4.9</span> public Promise<ResourceDTO> update(String uri, ResourceDTO resource)
</h4>
</div>
</div>
</div>
<p xmlns="" class="parameter"><label>uri</label><span>URI for updating resource</span></p>
<p xmlns="" class="parameter"><label>resource</label><span>data resource</span></p>
<p xmlns="" class="description"><label>□</label><span>
update resource
</span></p>
<p>
The update() method is a method to update resource on the URI specified
by uri argument. The resource argument holds attributes to be updated.
Attributes not to be updated shall not included in the argument.
</p>
<p xmlns="" class="parameter"><label>Returns</label><span>updated resource</span></p>
</div>
</div>
</div>
<div class="section package">
<div xmlns="" class="titlepage">
<div>
<div>
<h2 xmlns="http://www.w3.org/1999/xhtml" class="title" style="clear: both"><a xmlns="" class="anchor" id="org.osgi.service.onem2m.dto"></a><span xmlns="" class="number">153.11</span> org.osgi.service.onem2m.dto
</h2>
</div>
<div>
<p xmlns="http://www.w3.org/1999/xhtml" class="releaseinfo">Version 1.0</p>
</div>
</div>
</div>
<p>
Service Layer Data Transfer Objects for oneM2M Specification Package Version
1.0.
</p>
<p>
Bundles wishing to use this package must list the package in the
Import-Package header of the bundle's manifest. This package has two types of
users: the consumers that use the API in this package and the providers that
implement the API in this package.
</p>
<p>
Example import for consumers using the API in this package:
</p>
<p>
<code class="code">Import-Package: org.osgi.service.onem2m.dto; version="[1.0,2.0)"</code>
</p>
<p>
Example import for providers implementing the API in this package:
</p>
<p>
<code class="code">Import-Package: org.osgi.service.onem2m.dto; version="[1.0,1.1)"</code>
</p>
<div class="section summary">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="d0e144112"></a><span xmlns="" class="number">153.11.1</span> Summary
</h3>
</div>
</div>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a xmlns="" class="link" href="service.onem2m.html#org.osgi.service.onem2m.dto.AttributeDTO" title="153.11.2 public class AttributeDTO extends DTO">
<code xmlns="http://www.w3.org/1999/xhtml" class="code">AttributeDTO</code>
</a> -
DTO expresses Attribute.
</p>
</li>
<li class="listitem">
<p>
<a xmlns="" class="link" href="service.onem2m.html#org.osgi.service.onem2m.dto.ChildResourceRefDTO" title="153.11.3 public class ChildResourceRefDTO extends DTO">
<code xmlns="http://www.w3.org/1999/xhtml" class="code">ChildResourceRefDTO</code>
</a> -
DTO expresses ChildResourceRef.
</p>
</li>
<li class="listitem">
<p>
<a xmlns="" class="link" href="service.onem2m.html#org.osgi.service.onem2m.dto.Constants" title="153.11.4 public final class Constants">
<code xmlns="http://www.w3.org/1999/xhtml" class="code">Constants</code>
</a> -
This class defines constants for resource types.
</p>
</li>
<li class="listitem">
<p>
<a xmlns="" class="link" href="service.onem2m.html#org.osgi.service.onem2m.dto.DasInfoDTO" title="153.11.5 public class DasInfoDTO extends DTO">
<code xmlns="http://www.w3.org/1999/xhtml" class="code">DasInfoDTO</code>
</a> -
DTO expresses DasInfo.
</p>
</li>
<li class="listitem">
<p>
<a xmlns="" class="link" href="service.onem2m.html#org.osgi.service.onem2m.dto.FilterCriteriaDTO" title="153.11.6 public class FilterCriteriaDTO extends DTO">
<code xmlns="http://www.w3.org/1999/xhtml" class="code">FilterCriteriaDTO</code>
</a> -
DTO expresses FilterCriteria.
</p>
</li>
<li class="listitem">
<p>
<a xmlns="" class="link" href="service.onem2m.html#org.osgi.service.onem2m.dto.FilterCriteriaDTO.FilterOperation" title="153.11.7 enum FilterCriteriaDTO.FilterOperation">
<code xmlns="http://www.w3.org/1999/xhtml" class="code">FilterCriteriaDTO.FilterOperation</code>
</a> -
Enum FilterOperation
</p>
</li>
<li class="listitem">
<p>
<a xmlns="" class="link" href="service.onem2m.html#org.osgi.service.onem2m.dto.FilterCriteriaDTO.FilterUsage" title="153.11.8 enum FilterCriteriaDTO.FilterUsage">
<code xmlns="http://www.w3.org/1999/xhtml" class="code">FilterCriteriaDTO.FilterUsage</code>
</a> -
Enum FilterUsage
</p>
</li>
<li class="listitem">
<p>
<a xmlns="" class="link" href="service.onem2m.html#org.osgi.service.onem2m.dto.GenericDTO" title="153.11.9 public class GenericDTO extends DTO">
<code xmlns="http://www.w3.org/1999/xhtml" class="code">GenericDTO</code>
</a> -
GenericDTO expresses miscellaneous data structures of oneM2M.
</p>
</li>
<li class="listitem">
<p>
<a xmlns="" class="link" href="service.onem2m.html#org.osgi.service.onem2m.dto.IPEDiscoveryRequestDTO" title="153.11.10 public class IPEDiscoveryRequestDTO extends DTO">
<code xmlns="http://www.w3.org/1999/xhtml" class="code">IPEDiscoveryRequestDTO</code>
</a> -
IPEDiscoveryRequestDTO is an element of NotificationEventDTO
</p>
</li>
<li class="listitem">
<p>
<a xmlns="" class="link" href="service.onem2m.html#org.osgi.service.onem2m.dto.LocalTokenIdAssignmentDTO" title="153.11.11 public class LocalTokenIdAssignmentDTO extends DTO">
<code xmlns="http://www.w3.org/1999/xhtml" class="code">LocalTokenIdAssignmentDTO</code>
</a> -
DTO expresses LocalTokenIdAssignment.
</p>
</li>
<li class="listitem">
<p>
<a xmlns="" class="link" href="service.onem2m.html#org.osgi.service.onem2m.dto.NotificationDTO" title="153.11.12 public class NotificationDTO extends DTO">
<code xmlns="http://www.w3.org/1999/xhtml" class="code">NotificationDTO</code>
</a> -
DTO expresses Notification.
</p>
</li>
<li class="listitem">
<p>
<a xmlns="" class="link" href="service.onem2m.html#org.osgi.service.onem2m.dto.NotificationEventDTO" title="153.11.13 public class NotificationEventDTO">
<code xmlns="http://www.w3.org/1999/xhtml" class="code">NotificationEventDTO</code>
</a> -
DTO expresses NotificationEventDTO
</p>
</li>
<li class="listitem">
<p>
<a xmlns="" class="link" href="service.onem2m.html#org.osgi.service.onem2m.dto.NotificationEventDTO.NotificationEventType" title="153.11.14 enum NotificationEventDTO.NotificationEventType">
<code xmlns="http://www.w3.org/1999/xhtml" class="code">NotificationEventDTO.NotificationEventType</code>
</a> -
NotificationEventType
</p>
</li>
<li class="listitem">
<p>
<a xmlns="" class="link" href="service.onem2m.html#org.osgi.service.onem2m.dto.PrimitiveContentDTO" title="153.11.15 public class PrimitiveContentDTO extends DTO">
<code xmlns="http://www.w3.org/1999/xhtml" class="code">PrimitiveContentDTO</code>
</a> -
DTO expresses Primitive Content.
</p>
</li>
<li class="listitem">
<p>
<a xmlns="" class="link" href="service.onem2m.html#org.osgi.service.onem2m.dto.ReleaseVersion" title="153.11.16 enum ReleaseVersion">
<code xmlns="http://www.w3.org/1999/xhtml" class="code">ReleaseVersion</code>
</a> -
enum expresses oneM2M specification version.
</p>
</li>
<li class="listitem">
<p>
<a xmlns="" class="link" href="service.onem2m.html#org.osgi.service.onem2m.dto.RequestPrimitiveDTO" title="153.11.17 public class RequestPrimitiveDTO extends DTO">
<code xmlns="http://www.w3.org/1999/xhtml" class="code">RequestPrimitiveDTO</code>
</a> -
DTO expresses Request Primitive.
</p>
</li>
<li class="listitem">
<p>
<a xmlns="" class="link" href="service.onem2m.html#org.osgi.service.onem2m.dto.RequestPrimitiveDTO.DesiredIdentifierResultType" title="153.11.18 enum RequestPrimitiveDTO.DesiredIdentifierResultType">
<code xmlns="http://www.w3.org/1999/xhtml" class="code">RequestPrimitiveDTO.DesiredIdentifierResultType</code>
</a> -
Enum for DesiredIdentifierResultType
</p>
</li>
<li class="listitem">
<p>
<a xmlns="" class="link" href="service.onem2m.html#org.osgi.service.onem2m.dto.RequestPrimitiveDTO.Operation" title="153.11.19 enum RequestPrimitiveDTO.Operation">