Skip to content

Commit d1cd99c

Browse files
committed
address comments, change signatures to newer
1 parent 3b5f145 commit d1cd99c

6 files changed

Lines changed: 326 additions & 169 deletions

File tree

temporal-sdk/src/main/java/io/temporal/internal/common/LinkConverter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public static io.temporal.api.nexus.v1.Link workflowLinkToNexusLink(Link.Workflo
107107
.setUrl(url)
108108
.setType(workflowLinkType)
109109
.build();
110-
} catch (UnsupportedEncodingException e) {
110+
} catch (Exception e) {
111111
log.error("Failed to encode Nexus link URL", e);
112112
return null;
113113
}
@@ -190,6 +190,7 @@ public static Link nexusLinkToWorkflowLink(io.temporal.api.nexus.v1.Link nexusLi
190190
Link.Builder link = Link.newBuilder();
191191
try {
192192
URI uri = new URI(nexusLink.getUrl());
193+
log.debug("Parsing nexus link URL: {}", uri.getRawPath());
193194
if (!uri.getScheme().equals(temporalUrlScheme)) {
194195
log.error("Failed to parse Nexus link URL: invalid scheme: {}", uri.getScheme());
195196
return null;
@@ -234,7 +235,6 @@ public static io.temporal.api.nexus.v1.Link linkToNexusLink(Link commonLink) {
234235
if (commonLink.hasNexusOperation()) {
235236
return nexusOperationToNexusLink(commonLink.getNexusOperation());
236237
}
237-
// check for workflow link only if a more specific variant is not set
238238
if (commonLink.hasWorkflow()) {
239239
return workflowLinkToNexusLink(commonLink.getWorkflow());
240240
}

temporal-sdk/src/main/java/io/temporal/nexus/CancelUpdateWorkflowExecutionInput.java renamed to temporal-sdk/src/main/java/io/temporal/nexus/CancelUpdateWorkflowInput.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
package io.temporal.nexus;
22

3+
import com.google.common.base.Strings;
34
import io.temporal.common.Experimental;
45
import java.util.Objects;
5-
import javax.annotation.Nullable;
66

77
/**
88
* Input to {@link TemporalOperationHandler#cancelUpdateWorkflow} describing the workflow update to
99
* cancel.
1010
*/
1111
@Experimental
12-
public final class CancelUpdateWorkflowExecutionInput {
12+
public final class CancelUpdateWorkflowInput {
1313

1414
private final String workflowId;
15-
@Nullable private final String runId;
15+
private final String runId;
1616
private final String updateId;
1717

18-
public CancelUpdateWorkflowExecutionInput(
19-
String workflowId, @Nullable String runId, String updateId) {
18+
public CancelUpdateWorkflowInput(String workflowId, String runId, String updateId) {
2019
this.workflowId = Objects.requireNonNull(workflowId);
21-
this.runId = runId;
20+
this.runId = Strings.nullToEmpty(runId);
2221
this.updateId = Objects.requireNonNull(updateId);
2322
}
2423

@@ -27,8 +26,7 @@ public String getWorkflowId() {
2726
return workflowId;
2827
}
2928

30-
/** Returns the run ID extracted from the operation token, or null if not present. */
31-
@Nullable
29+
/** Returns the run ID extracted from the operation token, or empty if not present. */
3230
public String getRunId() {
3331
return runId;
3432
}

0 commit comments

Comments
 (0)