Search in sources :

Example 6 with ServerIdentity

use of org.eclipse.leshan.client.request.ServerIdentity in project leshan by eclipse.

the class RootResource method handleDELETE.

@Override
public void handleDELETE(CoapExchange exchange) {
    if (!StringUtils.isEmpty(exchange.getRequestOptions().getUriPathString())) {
        exchange.respond(ResponseCode.METHOD_NOT_ALLOWED);
        return;
    }
    ServerIdentity identity = ResourceUtil.extractServerIdentity(exchange, bootstrapHandler);
    BootstrapDeleteResponse response = bootstrapHandler.delete(identity, new BootstrapDeleteRequest());
    exchange.respond(toCoapResponseCode(response.getCode()), response.getErrorMessage());
}
Also used : BootstrapDeleteRequest(org.eclipse.leshan.core.request.BootstrapDeleteRequest) BootstrapDeleteResponse(org.eclipse.leshan.core.response.BootstrapDeleteResponse) ServerIdentity(org.eclipse.leshan.client.request.ServerIdentity)

Aggregations

ServerIdentity (org.eclipse.leshan.client.request.ServerIdentity)6 ResourceUtil.extractServerIdentity (org.eclipse.leshan.client.californium.impl.ResourceUtil.extractServerIdentity)4 LwM2mModel (org.eclipse.leshan.core.model.LwM2mModel)3 LwM2mNode (org.eclipse.leshan.core.node.LwM2mNode)3 LwM2mPath (org.eclipse.leshan.core.node.LwM2mPath)3 ContentFormat (org.eclipse.leshan.core.request.ContentFormat)3 CodecException (org.eclipse.leshan.core.node.codec.CodecException)2 BootstrapWriteRequest (org.eclipse.leshan.core.request.BootstrapWriteRequest)2 WriteRequest (org.eclipse.leshan.core.request.WriteRequest)2 BootstrapWriteResponse (org.eclipse.leshan.core.response.BootstrapWriteResponse)2 WriteResponse (org.eclipse.leshan.core.response.WriteResponse)2 ObserveSpec (org.eclipse.leshan.ObserveSpec)1 LwM2mObjectInstance (org.eclipse.leshan.core.node.LwM2mObjectInstance)1 BootstrapDeleteRequest (org.eclipse.leshan.core.request.BootstrapDeleteRequest)1 BootstrapFinishRequest (org.eclipse.leshan.core.request.BootstrapFinishRequest)1 CreateRequest (org.eclipse.leshan.core.request.CreateRequest)1 DeleteRequest (org.eclipse.leshan.core.request.DeleteRequest)1 DiscoverRequest (org.eclipse.leshan.core.request.DiscoverRequest)1 ExecuteRequest (org.eclipse.leshan.core.request.ExecuteRequest)1 ObserveRequest (org.eclipse.leshan.core.request.ObserveRequest)1