From 7fde7521c1e18d4fe1761f021d8b38c40f2d274c Mon Sep 17 00:00:00 2001 From: Simon Bernard Date: Tue, 1 Oct 2019 15:58:21 +0200 Subject: [PATCH] Rename cancelPendingRequests() in cancelOngoingRequests() --- .../eclipse/leshan/server/californium/LeshanServer.java | 4 ++-- .../request/CaliforniumLwM2mRequestSender.java | 2 +- .../leshan/server/queue/QueueModeLwM2mRequestSender.java | 4 ++-- .../eclipse/leshan/server/request/LwM2mRequestSender.java | 8 +++----- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/leshan-server-cf/src/main/java/org/eclipse/leshan/server/californium/LeshanServer.java b/leshan-server-cf/src/main/java/org/eclipse/leshan/server/californium/LeshanServer.java index b850bb2476..416c4d352d 100644 --- a/leshan-server-cf/src/main/java/org/eclipse/leshan/server/californium/LeshanServer.java +++ b/leshan-server-cf/src/main/java/org/eclipse/leshan/server/californium/LeshanServer.java @@ -242,14 +242,14 @@ protected LwM2mRequestSender createRequestSender(Endpoint securedEndpoint, Endpo public void updated(RegistrationUpdate update, Registration updatedRegistration, Registration previousReg) { if (!update.getAddress().equals(previousReg.getAddress()) || update.getPort() != previousReg.getPort()) { - requestSender.cancelPendingRequests(previousReg); + requestSender.cancelOngoingRequests(previousReg); } } @Override public void unregistered(Registration registration, Collection observations, boolean expired, Registration newReg) { - requestSender.cancelPendingRequests(registration); + requestSender.cancelOngoingRequests(registration); } @Override diff --git a/leshan-server-cf/src/main/java/org/eclipse/leshan/server/californium/request/CaliforniumLwM2mRequestSender.java b/leshan-server-cf/src/main/java/org/eclipse/leshan/server/californium/request/CaliforniumLwM2mRequestSender.java index 7c997612c6..f4b9703466 100644 --- a/leshan-server-cf/src/main/java/org/eclipse/leshan/server/californium/request/CaliforniumLwM2mRequestSender.java +++ b/leshan-server-cf/src/main/java/org/eclipse/leshan/server/californium/request/CaliforniumLwM2mRequestSender.java @@ -106,7 +106,7 @@ public void sendCoapRequest(Registration destination, Request coapRequest, long } @Override - public void cancelPendingRequests(Registration registration) { + public void cancelOngoingRequests(Registration registration) { Validate.notNull(registration); sender.cancelRequests(registration.getId()); } diff --git a/leshan-server-core/src/main/java/org/eclipse/leshan/server/queue/QueueModeLwM2mRequestSender.java b/leshan-server-core/src/main/java/org/eclipse/leshan/server/queue/QueueModeLwM2mRequestSender.java index e09c06ab58..3996eca276 100644 --- a/leshan-server-core/src/main/java/org/eclipse/leshan/server/queue/QueueModeLwM2mRequestSender.java +++ b/leshan-server-core/src/main/java/org/eclipse/leshan/server/queue/QueueModeLwM2mRequestSender.java @@ -117,7 +117,7 @@ public void onError(Exception e) { } @Override - public void cancelPendingRequests(Registration registration) { - delegatedSender.cancelPendingRequests(registration); + public void cancelOngoingRequests(Registration registration) { + delegatedSender.cancelOngoingRequests(registration); } } diff --git a/leshan-server-core/src/main/java/org/eclipse/leshan/server/request/LwM2mRequestSender.java b/leshan-server-core/src/main/java/org/eclipse/leshan/server/request/LwM2mRequestSender.java index 8cc5961dae..23df6e49eb 100644 --- a/leshan-server-core/src/main/java/org/eclipse/leshan/server/request/LwM2mRequestSender.java +++ b/leshan-server-core/src/main/java/org/eclipse/leshan/server/request/LwM2mRequestSender.java @@ -18,7 +18,6 @@ import org.eclipse.leshan.core.node.codec.CodecException; import org.eclipse.leshan.core.request.DownlinkRequest; -import org.eclipse.leshan.core.request.exception.RequestCanceledException; import org.eclipse.leshan.core.response.ErrorCallback; import org.eclipse.leshan.core.response.LwM2mResponse; import org.eclipse.leshan.core.response.ResponseCallback; @@ -55,11 +54,10 @@ void send(Registration destination, DownlinkRequest ResponseCallback responseCallback, ErrorCallback errorCallback); /** - * cancel all pending messages for a LWM2M client identified by the registration identifier. In case a client - * de-registers, the consumer can use this method to cancel all messages pending for the given client. + * cancel all ongoing messages for a LWM2M client identified by the registration identifier. In case a client + * de-registers, the consumer can use this method to cancel all ongoing messages for the given client. * * @param registration client registration meta data of a LWM2M client. - * @throws RequestCanceledException when a request is already being sent in CoAP, then the exception is thrown. */ - void cancelPendingRequests(Registration registration); + void cancelOngoingRequests(Registration registration); }