Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.3k views
in Technique[技术] by (71.8m points)

notifications - OneM2M: Notify IN-CSE of the new resources created on MN-CSE

In oneM2M, all the resources created on MN-CSE node are stored in the database on the node itself. I also want to notify IN-CSE of the new resources that are created on the MN-CSE and save them in the datatbase there. How can I achieve this?

My approach - currently, I am thinking of creating a subscription for each resource with IN-CSE address as the notificationURL. So that as soon as a new child resource is created for a resource, IN-CSE will be notified and IN-CSE will parse the notification and save the information in the database. Is the approach correct?

Thanks in advance :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

While you can have an AE running on the IN-CSE that will do the duplication of resources with the method you described (the notification target would be that AE), it would be better to make use of announced resources. This is the specified way to achieve what you want.

To announce a resource you assign the CSE's csi to that resource's at (announceTo) attribute. If the target CSE is reachable then this will automatically announce the resource and all mandatory announced attributes to that target CSE. If you also want other optionally announced attributes to be announced then you need to specify them in the aa (announcedAttribute) attribute. Please also note that attributes marked as "not announced" in the spec cannot be announced across CSEs.

An announced resource is updated automatically by the Hosting CSE of the original resource whenever the original resource changes. The announced resource contains a link to the original resource.

For more details you might have a look at TS-0001, clause 9.2.3 "Announced Resources".


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...