简体   繁体   English

使用 Californium 在不存在的路径上添加带有 PUT 的动态资源

[英]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.我希望 Californium CoAP 服务器处理具有尚未存在的资源路径的 PUT 请求。 Instead of providing an Error return message, the server should dynamically add a resource with the path the PUT method is targeting.服务器不应提供错误返回消息,而应动态添加具有 PUT 方法所针对的路径的资源。

I am using the cf-plugtest-server coming with the Californium Core library in Java to try to implement this function.我正在使用 Java 中的 Californium Core 库附带的 cf-plugtest-server 来尝试实现这个 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.到目前为止,我发现“找不到资源”output 正在 californium.core.server 中的 ServerMessageDeliverer 上发生,带有 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.当前打算的方法是提供覆盖 preDeliverRequest 的 ServerMessageDeliverer 的特定实现。 there you may create the resource you want and add it to the resources tree.在那里您可以创建所需的资源并将其添加到资源树中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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