• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

temporalio / sdk-java / #166

pending completion
#166

push

github-actions

web-flow
Add comment on Workflow#newQueue (#1747)

17109 of 20962 relevant lines covered (81.62%)

0.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

35.71
/temporal-sdk/src/main/java/io/temporal/internal/sync/WorkflowInfoImpl.java
1
/*
2
 * Copyright (C) 2022 Temporal Technologies, Inc. All Rights Reserved.
3
 *
4
 * Copyright (C) 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
 *
6
 * Modifications copyright (C) 2017 Uber Technologies, Inc.
7
 *
8
 * Licensed under the Apache License, Version 2.0 (the "License");
9
 * you may not use this material except in compliance with the License.
10
 * You may obtain a copy of the License at
11
 *
12
 *   http://www.apache.org/licenses/LICENSE-2.0
13
 *
14
 * Unless required by applicable law or agreed to in writing, software
15
 * distributed under the License is distributed on an "AS IS" BASIS,
16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
 * See the License for the specific language governing permissions and
18
 * limitations under the License.
19
 */
20

21
package io.temporal.internal.sync;
22

23
import io.temporal.api.common.v1.SearchAttributes;
24
import io.temporal.api.common.v1.WorkflowExecution;
25
import io.temporal.internal.replay.ReplayWorkflowContext;
26
import io.temporal.workflow.WorkflowInfo;
27
import java.time.Duration;
28
import java.util.Optional;
29
import javax.annotation.Nonnull;
30
import javax.annotation.Nullable;
31

32
final class WorkflowInfoImpl implements WorkflowInfo {
33

34
  private final ReplayWorkflowContext context;
35

36
  WorkflowInfoImpl(ReplayWorkflowContext context) {
37
    this.context = context;
38
  }
39

40
  @Override
41
  public String getNamespace() {
42
    return context.getNamespace();
43
  }
44

45
  @Override
46
  public String getWorkflowId() {
47
    return context.getWorkflowId();
48
  }
49

50
  @Override
51
  public String getWorkflowType() {
52
    return context.getWorkflowType().getName();
53
  }
54

55
  @Nonnull
56
  @Override
57
  public String getRunId() {
58
    return context.getRunId();
59
  }
60

61
  @Nonnull
62
  @Override
63
  public String getFirstExecutionRunId() {
64
    return context.getFirstExecutionRunId();
65
  }
66

67
  @Override
68
  public Optional<String> getContinuedExecutionRunId() {
69
    return context.getContinuedExecutionRunId();
70
  }
71

72
  @Nonnull
73
  @Override
74
  public String getOriginalExecutionRunId() {
75
    return context.getOriginalExecutionRunId();
76
  }
77

78
  @Override
79
  public String getTaskQueue() {
80
    return context.getTaskQueue();
81
  }
82

83
  @Override
84
  public Duration getWorkflowRunTimeout() {
85
    return context.getWorkflowRunTimeout();
86
  }
87

88
  @Override
89
  public Duration getWorkflowExecutionTimeout() {
90
    return context.getWorkflowExecutionTimeout();
91
  }
92

93
  @Override
94
  public long getRunStartedTimestampMillis() {
95
    return context.getRunStartedTimestampMillis();
96
  }
97

98
  @Override
99
  @Nullable
100
  public SearchAttributes getSearchAttributes() {
101
    return context.getSearchAttributes();
102
  }
103

104
  @Override
105
  public Optional<String> getParentWorkflowId() {
106
    WorkflowExecution parentWorkflowExecution = context.getParentWorkflowExecution();
107
    return parentWorkflowExecution == null
108
        ? Optional.empty()
109
        : Optional.of(parentWorkflowExecution.getWorkflowId());
110
  }
111

112
  @Override
113
  public Optional<String> getParentRunId() {
114
    WorkflowExecution parentWorkflowExecution = context.getParentWorkflowExecution();
115
    return parentWorkflowExecution == null
116
        ? Optional.empty()
117
        : Optional.of(parentWorkflowExecution.getRunId());
118
  }
119

120
  @Override
121
  public int getAttempt() {
122
    return context.getAttempt();
123
  }
124

125
  @Override
126
  public String getCronSchedule() {
127
    return context.getCronSchedule();
128
  }
129

130
  @Override
131
  public long getHistoryLength() {
132
    return context.getCurrentWorkflowTaskStartedEventId();
133
  }
134

135
  @Override
136
  public String toString() {
137
    return "WorkflowInfo{"
138
        + "namespace="
139
        + getNamespace()
140
        + ", workflowId="
141
        + getWorkflowId()
142
        + ", runId="
143
        + getRunId()
144
        + ", workflowType="
145
        + getWorkflowType()
146
        + ", continuedExecutionRunId="
147
        + getContinuedExecutionRunId()
148
        + ", taskQueue='"
149
        + getTaskQueue()
150
        + '\''
151
        + ", workflowRunTimeout="
152
        + getWorkflowRunTimeout()
153
        + ", workflowExecutionTimeout="
154
        + getWorkflowExecutionTimeout()
155
        + ", runStartedTimestampMillis="
156
        + getRunStartedTimestampMillis()
157
        + ", searchAttributes="
158
        + getSearchAttributes()
159
        + ", parentWorkflowId="
160
        + getParentWorkflowId()
161
        + ", parentRunId="
162
        + getParentRunId()
163
        + ", attempt="
164
        + getAttempt()
165
        + ", cronSchedule="
166
        + getCronSchedule()
167
        + ", historyLength="
168
        + getHistoryLength()
169
        + '}';
170
  }
171
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc