Skip to content

Commit

Permalink
Rename cancelPendingRequests() in cancelOngoingRequests()
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernard31 committed Nov 14, 2019
1 parent 3e4df34 commit 7fde752
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Observation> observations, boolean expired,
Registration newReg) {
requestSender.cancelPendingRequests(registration);
requestSender.cancelOngoingRequests(registration);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -55,11 +54,10 @@ <T extends LwM2mResponse> void send(Registration destination, DownlinkRequest<T>
ResponseCallback<T> 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);
}

0 comments on commit 7fde752

Please sign in to comment.