Skip to content

Commit

Permalink
LRA Deprecations cleanup 2.x (#4450)
Browse files Browse the repository at this point in the history
* LRA Deprecations cleanup

Signed-off-by: Daniel Kec <daniel.kec@oracle.com>
  • Loading branch information
danielkec authored Jun 30, 2022
1 parent 98f5d67 commit 6cf9874
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public interface CoordinatorClient {
* @return id of the new LRA
* @deprecated Use {@link io.helidon.lra.coordinator.client.CoordinatorClient#start(String, PropagatedHeaders, long)} instead
*/
@Deprecated
@Deprecated(since = "2.4.2", forRemoval = true)
default Single<URI> start(String clientID, long timeout) {
return start(clientID, PropagatedHeaders.noop(), timeout);
}
Expand All @@ -96,7 +96,7 @@ default Single<URI> start(String clientID, long timeout) {
* @deprecated Use
* {@link io.helidon.lra.coordinator.client.CoordinatorClient#start(java.net.URI, String, PropagatedHeaders, long)} instead
*/
@Deprecated
@Deprecated(since = "2.4.2", forRemoval = true)
default Single<URI> start(URI parentLRA, String clientID, long timeout) {
return start(parentLRA, clientID, PropagatedHeaders.noop(), timeout);
}
Expand All @@ -122,7 +122,7 @@ default Single<URI> start(URI parentLRA, String clientID, long timeout) {
* @deprecated Use
* {@link io.helidon.lra.coordinator.client.CoordinatorClient#join(java.net.URI, PropagatedHeaders, long, Participant)} instead
*/
@Deprecated
@Deprecated(since = "2.4.2", forRemoval = true)
default Single<Optional<URI>> join(URI lraId, long timeLimit, Participant participant) {
return join(lraId, PropagatedHeaders.noop(), timeLimit, participant);
}
Expand All @@ -146,7 +146,7 @@ default Single<Optional<URI>> join(URI lraId, long timeLimit, Participant partic
* @deprecated Use
* {@link io.helidon.lra.coordinator.client.CoordinatorClient#cancel(java.net.URI, PropagatedHeaders)} instead
*/
@Deprecated
@Deprecated(since = "2.4.2", forRemoval = true)
default Single<Void> cancel(URI lraId) {
return cancel(lraId, PropagatedHeaders.noop());
}
Expand All @@ -168,7 +168,7 @@ default Single<Void> cancel(URI lraId) {
* @deprecated Use
* {@link io.helidon.lra.coordinator.client.CoordinatorClient#close(java.net.URI, PropagatedHeaders)} instead
*/
@Deprecated
@Deprecated(since = "2.4.2", forRemoval = true)
default Single<Void> close(URI lraId) {
return close(lraId, PropagatedHeaders.noop());
}
Expand All @@ -192,7 +192,7 @@ default Single<Void> close(URI lraId) {
* @deprecated Use
* {@link io.helidon.lra.coordinator.client.CoordinatorClient#leave(java.net.URI, PropagatedHeaders, Participant)} instead
*/
@Deprecated
@Deprecated(since = "2.4.2", forRemoval = true)
default Single<Void> leave(URI lraId, Participant participant) {
return leave(lraId, PropagatedHeaders.noop(), participant);
}
Expand All @@ -216,7 +216,7 @@ default Single<Void> leave(URI lraId, Participant participant) {
* @deprecated Use
* {@link io.helidon.lra.coordinator.client.CoordinatorClient#status(java.net.URI, PropagatedHeaders)} instead
*/
@Deprecated
@Deprecated(since = "2.4.2", forRemoval = true)
default Single<LRAStatus> status(URI lraId) {
return status(lraId, PropagatedHeaders.noop());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@

/**
* Abstraction over the structure used for sending LRA id by coordinatior.
*
* @deprecated Never used on LRA api, going to be removed without replacement.
*/
@Deprecated
@Deprecated(since = "2.5.2", forRemoval = true)
public interface Headers {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void handleJaxRsBefore(ContainerRequestContext reqCtx, ResourceInfo resou
.ifPresent(lraId -> {
URI baseUri = reqCtx.getUriInfo().getBaseUri();
Participant p = participantService.participant(baseUri, resourceInfo.getResourceClass());
coordinatorClient.leave(lraId, p);
coordinatorClient.leave(lraId, PropagatedHeaders.noop(), p);
reqCtx.getHeaders().add(LRA_HTTP_CONTEXT_HEADER, lraId.toASCIIString());
reqCtx.setProperty(LRA_HTTP_CONTEXT_HEADER, lraId);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Oracle and/or its affiliates.
* Copyright (c) 2021, 2022 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -40,6 +40,7 @@
import io.helidon.common.reactive.Single;
import io.helidon.config.Config;
import io.helidon.lra.coordinator.client.CoordinatorClient;
import io.helidon.lra.coordinator.client.PropagatedHeaders;
import io.helidon.microprofile.config.ConfigCdiExtension;
import io.helidon.microprofile.lra.resources.NonJaxRsCompleteOrCompensate;
import io.helidon.microprofile.lra.resources.CdiNestedCompleteOrCompensate;
Expand Down Expand Up @@ -438,7 +439,7 @@ void firstNotEnding(WebTarget target) throws Exception {
.get(TIMEOUT_SEC, TimeUnit.SECONDS);
assertThat(response.getStatus(), AnyOf.anyOf(is(200), is(204)));
URI lraId = await(DontEnd.CS_START_LRA);
assertThat(coordinatorClient.status(lraId).await(TIMEOUT_SEC, TimeUnit.SECONDS), is(LRAStatus.Active));
assertThat(coordinatorClient.status(lraId, PropagatedHeaders.noop()).await(TIMEOUT_SEC, TimeUnit.SECONDS), is(LRAStatus.Active));
assertThat(target.path(DontEnd.PATH_BASE)
.path(DontEnd.PATH_START_SECOND_LRA)
.request()
Expand Down Expand Up @@ -553,7 +554,7 @@ void statusNonRecoveryTest(WebTarget target) throws ExecutionException, Interrup

private void assertClosedOrNotFound(URI lraId) {
try {
assertThat(coordinatorClient.status(lraId).await(TIMEOUT_SEC, TimeUnit.SECONDS), is(LRAStatus.Closed));
assertThat(coordinatorClient.status(lraId, PropagatedHeaders.noop()).await(TIMEOUT_SEC, TimeUnit.SECONDS), is(LRAStatus.Closed));
} catch (NotFoundException e) {
// in case coordinator don't retain closed lra long enough
}
Expand Down

0 comments on commit 6cf9874

Please sign in to comment.