|
1 | 1 | /*
|
2 |
| - * Copyright 2006-2021 the original author or authors. |
| 2 | + * Copyright 2006-2022 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -65,6 +65,11 @@ public class JobExecution extends Entity {
|
65 | 65 |
|
66 | 66 | private transient volatile List<Throwable> failureExceptions = new CopyOnWriteArrayList<>();
|
67 | 67 |
|
| 68 | + /** |
| 69 | + * Constructor that sets the state of the instance to the {@link JobExecution} parameter. |
| 70 | + * |
| 71 | + * @param original The {@link JobExecution} to be copied. |
| 72 | + */ |
68 | 73 | public JobExecution(JobExecution original) {
|
69 | 74 | this.jobParameters = original.getJobParameters();
|
70 | 75 | this.jobInstance = original.getJobInstance();
|
@@ -98,45 +103,83 @@ public JobExecution(JobInstance job, Long id, @Nullable JobParameters jobParamet
|
98 | 103 | /**
|
99 | 104 | * Constructor for transient (unsaved) instances.
|
100 | 105 | *
|
101 |
| - * @param job the enclosing {@link JobInstance} |
102 |
| - * @param jobParameters {@link JobParameters} instance for this JobExecution. |
| 106 | + * @param job The enclosing {@link JobInstance}. |
| 107 | + * @param jobParameters The {@link JobParameters} instance for this JobExecution. |
103 | 108 | */
|
104 | 109 | public JobExecution(JobInstance job, JobParameters jobParameters) {
|
105 | 110 | this(job, null, jobParameters);
|
106 | 111 | }
|
107 | 112 |
|
| 113 | + /** |
| 114 | + * Constructor that accepts the job execution ID and {@link JobParameters}. |
| 115 | + * |
| 116 | + * @param id The job execution ID. |
| 117 | + * @param jobParameters The {@link JobParameters} for the {@link JobExecution}. |
| 118 | + */ |
108 | 119 | public JobExecution(Long id, JobParameters jobParameters) {
|
109 | 120 | this(null, id, jobParameters);
|
110 | 121 | }
|
111 | 122 |
|
| 123 | + /** |
| 124 | + * Constructor that accepts the job execution ID. |
| 125 | + * |
| 126 | + * @param id The job execution ID. |
| 127 | + */ |
112 | 128 | public JobExecution(Long id) {
|
113 | 129 | this(null, id, null);
|
114 | 130 | }
|
115 | 131 |
|
| 132 | + /** |
| 133 | + * @return The current {@link JobParameters}. |
| 134 | + */ |
116 | 135 | public JobParameters getJobParameters() {
|
117 | 136 | return this.jobParameters;
|
118 | 137 | }
|
119 | 138 |
|
| 139 | + /** |
| 140 | + * @return The current end time. |
| 141 | + */ |
120 | 142 | public Date getEndTime() {
|
121 | 143 | return endTime;
|
122 | 144 | }
|
123 | 145 |
|
| 146 | + /** |
| 147 | + * Set the {@link JobInstance} used by the {@link JobExecution}. |
| 148 | + * |
| 149 | + * @param jobInstance The {@link JobInstance} used by the {@link JobExecution}. |
| 150 | + */ |
124 | 151 | public void setJobInstance(JobInstance jobInstance) {
|
125 | 152 | this.jobInstance = jobInstance;
|
126 | 153 | }
|
127 | 154 |
|
| 155 | + /** |
| 156 | + * Set the end time. |
| 157 | + * |
| 158 | + * @param endTime The {@link Date} to be used for the end time. |
| 159 | + */ |
128 | 160 | public void setEndTime(Date endTime) {
|
129 | 161 | this.endTime = endTime;
|
130 | 162 | }
|
131 | 163 |
|
| 164 | + /** |
| 165 | + * @return The current start time. |
| 166 | + */ |
132 | 167 | public Date getStartTime() {
|
133 | 168 | return startTime;
|
134 | 169 | }
|
135 | 170 |
|
| 171 | + /** |
| 172 | + * Set the start time. |
| 173 | + * |
| 174 | + * @param startTime The {@link Date} to be used for the start time. |
| 175 | + */ |
136 | 176 | public void setStartTime(Date startTime) {
|
137 | 177 | this.startTime = startTime;
|
138 | 178 | }
|
139 | 179 |
|
| 180 | + /** |
| 181 | + * @return The current {@link BatchStatus}. |
| 182 | + */ |
140 | 183 | public BatchStatus getStatus() {
|
141 | 184 | return status;
|
142 | 185 | }
|
@@ -297,6 +340,10 @@ public void setLastUpdated(Date lastUpdated) {
|
297 | 340 | this.lastUpdated = lastUpdated;
|
298 | 341 | }
|
299 | 342 |
|
| 343 | + /** |
| 344 | + * Retrieve a list of exceptions. |
| 345 | + * @return The {@link List} of {@link Throwable} objects. |
| 346 | + */ |
300 | 347 | public List<Throwable> getFailureExceptions() {
|
301 | 348 | return failureExceptions;
|
302 | 349 | }
|
|
0 commit comments