简体   繁体   中英

Add dynamic resource with PUT on non-existent path with Californium

I want the Californium CoAP server to handle a PUT request with a yet non-existent Resource path. Instead of providing an Error return message, the server should dynamically add a resource with the path the PUT method is targeting.

I am using the cf-plugtest-server coming with the Californium Core library in Java to try to implement this function. Unfortunately i am completely new to Californium and couldn't find a solution approach.

So far i found out the "resource not found" output is taking place at the ServerMessageDeliverer in californium.core.server with deliverRequest. However i don't know how to proceed from here.

Any help is very much appreciated. I am sorry if a solution to this is more obvious, i am fairly new to such a kind of programming. Thank you in advance!

Manipulations/changes on the resource tree are currently not supported out of the box.

The currently intended way is to provide a specific implementation of ServerMessageDeliverer which overrides the preDeliverRequest. there you may create the resource you want and add it to the resources tree.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM