Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCMOD-8730: Support expiry policies #235

Open
wants to merge 197 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
197 commits
Select commit Hold shift + click to select a range
acd1eab
Add expirationDate column on Job table
xbreizh Mar 8, 2021
d79a4b2
fix id name
xbreizh Mar 8, 2021
a86f374
change expirationDate to expirationdays
xbreizh Mar 8, 2021
e2cc2f4
Update contract
xbreizh Mar 9, 2021
c03cf8c
Add expirationPolicy object
xbreizh Mar 9, 2021
f32efb2
Update model
xbreizh Mar 9, 2021
475d70b
Update contract
xbreizh Mar 9, 2021
2c0872e
Remove db changes
xbreizh Mar 9, 2021
2cd8000
Reset files
xbreizh Mar 9, 2021
3dd83cd
Add expiryTime
xbreizh Mar 10, 2021
3ba822a
readd extra space
xbreizh Mar 10, 2021
581d23d
Pass expiryTime as date
xbreizh Mar 10, 2021
b357306
Add ExpirationPolicy to job and newJob + test
xbreizh Mar 10, 2021
85770b8
Update contract
xbreizh Mar 11, 2021
761c513
Downstream update
xbreizh Mar 11, 2021
2c728d2
Correct db column type
xbreizh Mar 12, 2021
3f06bdb
Add expiration_policy table
xbreizh Mar 12, 2021
a7c4b53
Update contract
xbreizh Mar 12, 2021
e48fc85
Update related objects
xbreizh Mar 12, 2021
1c3d77c
workaround test (temp)
xbreizh Mar 12, 2021
72ae034
Merge branch 'develop' into SCMOD-8730
xbreizh Mar 12, 2021
5967a6e
Review adjustments
xbreizh Mar 12, 2021
de265ae
Append new status
xbreizh Mar 15, 2021
481096a
Simplify job_status enum update
xbreizh Mar 15, 2021
c4ae1d8
Simplify expiryTime object
xbreizh Mar 15, 2021
d12c1a8
Rename Expiry back to ExpirationPolicy
xbreizh Mar 15, 2021
9037c25
Add upsertJobPolicy
xbreizh Mar 15, 2021
aad2b51
Update policy table
xbreizh Mar 15, 2021
a15f541
Simplified OperationEnum
xbreizh Mar 16, 2021
7375a49
Add policies build / validation
xbreizh Mar 17, 2021
835cf58
Review corrections
xbreizh Mar 17, 2021
6c42c67
Fixed policy typo
xbreizh Mar 18, 2021
e854d99
Change hashmap for map
xbreizh Mar 18, 2021
88ad854
Reduce cognotive complexity + javadoc
xbreizh Mar 18, 2021
9739795
Reduce cognitive complexity + javadoc
xbreizh Mar 18, 2021
c519823
Merge remote-tracking branch 'origin/SCMOD-8730' into SCMOD-8730
xbreizh Mar 18, 2021
0ffa5ff
Update expiration_policy table structure
xbreizh Mar 18, 2021
6adea26
implement upsert_job_policy.sql
xbreizh Mar 18, 2021
c302dcb
Simplified defineDefaultPolicy
xbreizh Mar 18, 2021
9002c19
Capitalizing
xbreizh Mar 18, 2021
f0d599b
Renamed job_expiration_policy table
xbreizh Mar 18, 2021
fba00e6
Implement sql scripts
xbreizh Mar 18, 2021
73992a3
Merge branch 'develop' into SCMOD-8730
xbreizh Mar 18, 2021
881a2ae
Update create_policy name
xbreizh Mar 19, 2021
db44cd7
Change map for ExpirationPolicy
xbreizh Mar 19, 2021
b6c9fed
Fixed typo
xbreizh Mar 19, 2021
3ae745a
Fixed ExpirationPolicy db string
xbreizh Mar 19, 2021
20a2a06
Adapted Expiration Policy to match db requirements
xbreizh Mar 22, 2021
85d074c
Implemented persistence
xbreizh Mar 22, 2021
b4de723
Restore PolicyBuilder
xbreizh Mar 23, 2021
34f1d24
Fixing tests
xbreizh Mar 23, 2021
f70af36
Add debug log
xbreizh Mar 23, 2021
8f5c830
Fixed internal_upsert_job_policy.sql
xbreizh Mar 23, 2021
31f03f8
fixed policyBuilder
xbreizh Mar 23, 2021
c21043c
converted duration unity
xbreizh Mar 23, 2021
d5e291e
Fixed log
xbreizh Mar 23, 2021
95e3d86
Fixed job with dependency
xbreizh Mar 23, 2021
2d131df
Refactored expiration_policy
xbreizh Mar 24, 2021
681c537
Update create_job functions
xbreizh Mar 24, 2021
fbeab05
Add copyright on upsertJobPolicy
xbreizh Mar 24, 2021
a24be4b
Remove duplication
xbreizh Mar 24, 2021
988a696
Add getJobPolicy
xbreizh Mar 24, 2021
8704872
Retrieve expiration policy on getJob
xbreizh Mar 24, 2021
f3b7371
Reordered the policies
xbreizh Mar 24, 2021
cef0bcb
Restored missing date validation
xbreizh Mar 24, 2021
611f00f
Remodel getJob()
xbreizh Mar 24, 2021
0b75aae
fixed getJobs()
xbreizh Mar 24, 2021
bddb94d
Return original expiration date value
xbreizh Mar 25, 2021
57e70bf
Merge branch 'develop' into SCMOD-8730
xbreizh Mar 26, 2021
736b92c
Merge remote-tracking branch 'origin/develop' into SCMOD-8730
xbreizh Mar 26, 2021
c0ceb43
Simplify expiration_policy persistence
xbreizh Mar 26, 2021
7167d27
Removed extra columns
xbreizh Mar 26, 2021
2b767dd
extracted ExpirationPolicy.toDBString to new class
xbreizh Mar 26, 2021
b2896bf
Updated date regex
xbreizh Apr 1, 2021
f3c585f
Update interval doc syntax
xbreizh Apr 1, 2021
b2f7f26
Added foreign key and cascade deletion
xbreizh Apr 1, 2021
8e9aa5a
Added applyJobExpirationPolicy.sql
xbreizh Apr 1, 2021
aa41e47
Minor changes and copyright
xbreizh Apr 6, 2021
6b1301f
Update changelog
xbreizh Apr 6, 2021
01f091f
Merge develop
xbreizh Apr 6, 2021
8484f3c
Fix merge conflicts
xbreizh Apr 6, 2021
a0963e3
Re-add delete procedures
xbreizh Apr 6, 2021
092c2fe
Remodel expiration_policy script
xbreizh Apr 6, 2021
1f30bdb
Replaces cascade with verbose delete
xbreizh Apr 7, 2021
74cde33
Add index on job_expiration_policy table
xbreizh Apr 7, 2021
6c23dac
Typo
xbreizh Apr 7, 2021
be601a4
Update duration regex
xbreizh Apr 7, 2021
f96932d
Remove index
xbreizh Apr 7, 2021
a7389b1
Fixed duration regex
xbreizh Apr 7, 2021
b25c540
Reworked update policy query
xbreizh Apr 7, 2021
b2a0dbe
Outer join
xbreizh Apr 7, 2021
d86f435
Function calling instead of procedure
xbreizh Apr 7, 2021
7d4e1e2
Update policy execution frequency
xbreizh Apr 7, 2021
5fc97a8
Remove unused import
xbreizh Apr 7, 2021
4b034d3
Dropped modified functions
xbreizh Apr 7, 2021
a61f0a8
Review changes
xbreizh Apr 8, 2021
ae05771
Adjustment for new Job Status
xbreizh Apr 8, 2021
022d186
Fixed typo
xbreizh Apr 8, 2021
391daaf
Add support for Seconds (duration)
xbreizh Apr 8, 2021
e4ff0a6
Add validation on expiryTime
xbreizh Apr 8, 2021
379504a
remove extra /
xbreizh Apr 8, 2021
6b06c06
Add second in documentation
xbreizh Apr 8, 2021
36f9759
Compile pattern a single time
dermot-hardy Apr 8, 2021
0ea0ba6
Just warn if a date in the past is specified
dermot-hardy Apr 8, 2021
6d12bc5
DateHelper: Added line breaks to JavaDoc
dermot-hardy Apr 8, 2021
5285766
ExpirationPolicyHelper: Make into utility class
dermot-hardy Apr 8, 2021
55301c0
Moved expirationDate validation
xbreizh Apr 8, 2021
0846a11
typo
xbreizh Apr 8, 2021
0ffc1e6
Fix getJob(), getJobs() on retrieving policies
xbreizh Apr 8, 2021
6fd6d72
Changed the apply_expiration_policy execution time
xbreizh Apr 9, 2021
9a1548d
ExpirationPolicyHelper: Review changes
dermot-hardy Apr 9, 2021
81fc55e
Update documentation and release notes
xbreizh Apr 13, 2021
15f2438
Added missing status to contract
xbreizh Apr 15, 2021
29618a1
Updated architecture page
dermot-hardy Apr 16, 2021
1180cb8
Architecture page: Further update
dermot-hardy Apr 16, 2021
e2a613a
Architecture page: Further update
dermot-hardy Apr 16, 2021
d1e4fc3
Added primary key to job_expiration_policy table
dermot-hardy Apr 16, 2021
f4dbd54
Release notes: Moved out of breaking changes
dermot-hardy Apr 16, 2021
c002b4a
PolicyBuilder: Updated to reduce duplication
dermot-hardy Apr 16, 2021
23e3b78
JobsPut: Moved policy checking into try block
dermot-hardy Apr 16, 2021
42a58c3
Auto stash before merge of "SCMOD-8730" and "origin/SCMOD-8730"
xbreizh Apr 16, 2021
6724b62
Added PolicyBuilderTest
xbreizh Apr 16, 2021
c42c8f4
Replaced CALL with SELECT * FROM
xbreizh Apr 19, 2021
6fd26c6
Applied review comments
dermot-hardy Apr 19, 2021
32d375e
Auto stash before merge of "SCMOD-8730" and "origin/SCMOD-8730"
xbreizh Apr 20, 2021
6319192
Review adjustments
xbreizh Apr 20, 2021
9adf2a7
Review db changes
xbreizh Apr 20, 2021
5b95353
Matching develop to prevent merge conflict
xbreizh Apr 20, 2021
7fdf6fd
Merge branch 'develop' into SCMOD-8730
xbreizh Apr 20, 2021
53e115a
Fixed bug on getJobs()
xbreizh Apr 21, 2021
164e8a9
Converted expire_job into procedure
xbreizh Apr 21, 2021
d27a46e
Added support for system default
xbreizh Apr 21, 2021
52e38d9
Refactoring applyJobExpirationPolicy
xbreizh Apr 22, 2021
f0d69db
Merge remote-tracking branch 'origin/develop' into SCMOD-8730
xbreizh Apr 22, 2021
c1235d4
Call procedure
xbreizh Apr 22, 2021
de7e9c3
Reworked apply_job_expiration_policy()
xbreizh Apr 22, 2021
d7ffbb9
format applyJobExpirationPolicy
xbreizh Apr 23, 2021
0dd06c5
Updated logs
xbreizh Apr 23, 2021
85c8123
Added default operation for deletePolicy
xbreizh Apr 26, 2021
4d92887
Added log for statusCheckIntervalSeconds
xbreizh Apr 27, 2021
9d42370
Updated deletePolicy json operation name
xbreizh Apr 28, 2021
00ba946
Merge remote-tracking branch 'origin/develop' into SCMOD-8730
xbreizh Apr 29, 2021
645556e
Applied review comments
dermot-hardy Apr 29, 2021
ec30ab8
Renamed policy to expirablePolicy and removed default
xbreizh Apr 30, 2021
a6260b7
Fixed the system policy filter
xbreizh Apr 30, 2021
1df5d97
Refactored policyBuilder
xbreizh Apr 30, 2021
4fb40c5
Added expiration_policer
xbreizh Apr 30, 2021
4b05423
Fixed policer transfer
xbreizh Apr 30, 2021
a93fa8d
Added internal_process_failed_dependent_jobs on deleteOrExpireJob()
xbreizh Apr 30, 2021
bebfde0
Added default expiration_time on contract
xbreizh Apr 30, 2021
d01b41b
cleaned contract
xbreizh Apr 30, 2021
047cb8c
Merge branch 'develop' into SCMOD-8730
xbreizh May 6, 2021
0158d92
Fixed test
xbreizh May 6, 2021
66e5575
Fixed test
xbreizh May 6, 2021
a336cdf
Merge remote-tracking branch 'origin/SCMOD-8730' into SCMOD-8730
xbreizh May 6, 2021
845543c
Fixed tests
xbreizh May 6, 2021
21b8fc0
Refactored apply_job_expiration_policy()
xbreizh May 28, 2021
b41dad3
Hard-coded PROP_DEPENDENT_JOB_FAILURES to True
xbreizh May 28, 2021
504fb26
Merge branch 'SCMOD-8780-bf-merge' into SCMOD-8730
xbreizh May 28, 2021
87e6406
Merge branch 'develop' into SCMOD-8730
xbreizh May 28, 2021
7b53b68
Fixed failing test
xbreizh May 28, 2021
f8dce69
Formatting and removed obsolete description
xbreizh Jun 11, 2021
970efaf
Removed propagateDependentJobFailures
xbreizh Jun 14, 2021
6e051be
Removed fd
xbreizh Jun 14, 2021
f3783c4
Merge branch 'develop' into SCMOD-8730
xbreizh Jun 14, 2021
9ac8631
Removed LEFT
xbreizh Jun 14, 2021
655d63e
Added default_job_expiration_policy table
xbreizh Jun 14, 2021
b699967
Added columns
xbreizh Jun 16, 2021
c3b0eba
Updated release notes
xbreizh Jun 16, 2021
e852efd
Merge branch 'develop' into SCMOD-8730
xbreizh Jun 16, 2021
b6597d7
Added insert_default_expiry
xbreizh Jun 16, 2021
4779ec4
Added refresh_default_expiry()
xbreizh Jun 16, 2021
1231e86
Removed policy building
xbreizh Jun 17, 2021
ba3ef1e
Removing policer
xbreizh Jun 17, 2021
a8a9c84
Updated internal_upsert_job_policy()
xbreizh Jun 17, 2021
ee73941
Added basic_policy
xbreizh Jun 17, 2021
8b4cc95
Using sub-composite
xbreizh Jun 18, 2021
1d5f410
Merge branch 'develop' into SCMOD-8730
xbreizh Jun 18, 2021
a6737ab
Updated apply_job_expiration_policy()
xbreizh Jun 21, 2021
03ceed2
Refactoring
xbreizh Jun 22, 2021
1045e66
formatting
xbreizh Jun 22, 2021
028790b
Removed propagate_failure
xbreizh Jun 22, 2021
c2e0802
Removed propagate_failures
xbreizh Jun 23, 2021
8ad751b
Refactoring applyJobExpirationPolicy()
xbreizh Jun 23, 2021
1a795fb
cleanup
xbreizh Jun 23, 2021
67f2766
Restored policer on get_job()
xbreizh Jun 23, 2021
0639162
Fixed get_jobs()
xbreizh Jun 23, 2021
42a91d1
Updated architecture doc
xbreizh Jun 23, 2021
e0a4c0a
Adding explanations
xbreizh Jun 23, 2021
17f96e9
More refactoring
xbreizh Jun 23, 2021
3ba3e87
Corrected typo
xbreizh Jun 23, 2021
ab59a3c
Formatting
xbreizh Jun 23, 2021
ed10b71
doc
xbreizh Jun 23, 2021
e137d2c
More formatting
xbreizh Jun 23, 2021
257ee06
doc
xbreizh Jun 23, 2021
7a0833f
Added constraints
xbreizh Jun 24, 2021
e87336a
Added getDefaultSystemExpiry()
xbreizh Jun 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Manifest of the components which make up the Job Service:
* [job-service](job-service)
* [job-service-acceptance-tests](job-service-acceptance-tests)
* [job-service-caller](job-service-caller)
* [job-service-client](job-service-client)
* [job-service-internal-client](job-service-internal-client)
* [job-service-container](job-service-container)
* [job-service-contract](job-service-contract)
* [job-service-db](job-service-db)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@
import com.hpe.caf.services.job.client.ApiClient;
import com.hpe.caf.services.job.client.ApiException;
import com.hpe.caf.services.job.client.api.JobsApi;
import com.hpe.caf.services.job.client.model.Action;
import com.hpe.caf.services.job.client.model.ExpirationPolicy;
import com.hpe.caf.services.job.client.model.Job;
import com.hpe.caf.services.job.client.model.NewJob;
import com.hpe.caf.services.job.client.model.Policy;
import com.hpe.caf.services.job.client.model.WorkerAction;
import com.hpe.caf.worker.batch.BatchWorkerConstants;
import com.hpe.caf.worker.batch.BatchWorkerTask;
Expand Down Expand Up @@ -1268,6 +1271,12 @@ private NewJob constructNewJob(String jobId, final boolean useTaskDataObject) th
String jobName = "Job_" + jobId;
NewJob newJob = new NewJob();
newJob.setName(jobName);
final Policy policyActive = new Policy();
policyActive.setAction(Action.delete);
policyActive.setExpiryTime(new Date());
final ExpirationPolicy expirationPolicy = new ExpirationPolicy();
expirationPolicy.setActive(policyActive);
newJob.setExpirationPolicy(expirationPolicy);
newJob.setDescription(jobName + " description");
newJob.setExternalData(jobName + " external data");
newJob.setTask(batchWorkerAction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ definitions:
description:
type: string
description: The description of the job
expirationPolicy:
dermot-hardy marked this conversation as resolved.
Show resolved Hide resolved
$ref: "#/definitions/expirationPolicy"
externalData:
# TODO: Should we make this more structured than just string
# Name/Value Pairs perhaps
Expand All @@ -323,7 +325,7 @@ definitions:
delay:
type: integer
format: int32
default: 0
default: 0
description: The time in seconds after the prerequisite job identifiers have completed before this job is eligible for running.
labels:
type: object
Expand All @@ -335,6 +337,41 @@ definitions:
example:
"tag:4": "4"
owner: "bob"
expirationPolicy:
dermot-hardy marked this conversation as resolved.
Show resolved Hide resolved
dermot-hardy marked this conversation as resolved.
Show resolved Hide resolved
type: object
properties:
dermot-hardy marked this conversation as resolved.
Show resolved Hide resolved
"Active":
$ref: "#/definitions/policy"
dermot-hardy marked this conversation as resolved.
Show resolved Hide resolved
"Completed":
$ref: "#/definitions/policy"
"Failed":
$ref: "#/definitions/policy"
"Cancelled":
$ref: "#/definitions/policy"
"Waiting":
$ref: "#/definitions/policy"
"Paused":
$ref: "#/definitions/policy"
"Default":
dermot-hardy marked this conversation as resolved.
Show resolved Hide resolved
$ref: "#/definitions/policy"
description: The expiration policy to be applied on the job
dermot-hardy marked this conversation as resolved.
Show resolved Hide resolved
policy:
type: object
properties:
expiryTime:
type: string
format: date-time
dermot-hardy marked this conversation as resolved.
Show resolved Hide resolved
default: 2222-04-12T23:20:50.52Z
dermot-hardy marked this conversation as resolved.
Show resolved Hide resolved
action:
$ref: "#/definitions/action"
description: The expiration details to be applied on the job
action:
dermot-hardy marked this conversation as resolved.
Show resolved Hide resolved
type: string
enum:
- expire
- delete
default: expire
description: The action to apply on expired jobs
worker-action:
type: object
required:
Expand Down Expand Up @@ -372,6 +409,8 @@ definitions:
description:
type: string
description: The description of the job
expirationPolicy:
$ref: "#/definitions/expirationPolicy"
externalData:
type: string
description: |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright 2016-2021 Micro Focus or one of its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hpe.caf.services.job.api.generated.model;

/**
* The action to apply on expired jobs
**/
public enum Action {
expire, delete
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
/*
* Copyright 2016-2021 Micro Focus or one of its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hpe.caf.services.job.api.generated.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Objects;

@ApiModel(
description = "The expiration policy to be applied on the job"
)
public class ExpirationPolicy {
private Policy active = null;
private Policy completed = null;
private Policy failed = null;
private Policy cancelled = null;
private Policy waiting = null;
private Policy paused = null;
private Policy _default = null;

public ExpirationPolicy() {
}

@ApiModelProperty("")
@JsonProperty("Active")
public Policy getActive() {
return this.active;
}

public void setActive(Policy active) {
this.active = active;
}

@ApiModelProperty("")
@JsonProperty("Completed")
public Policy getCompleted() {
return this.completed;
}

public void setCompleted(Policy completed) {
this.completed = completed;
}

@ApiModelProperty("")
@JsonProperty("Failed")
public Policy getFailed() {
return this.failed;
}

public void setFailed(Policy failed) {
this.failed = failed;
}

@ApiModelProperty("")
@JsonProperty("Cancelled")
public Policy getCancelled() {
return this.cancelled;
}

public void setCancelled(Policy cancelled) {
this.cancelled = cancelled;
}

@ApiModelProperty("")
@JsonProperty("Waiting")
public Policy getWaiting() {
return this.waiting;
}

public void setWaiting(Policy waiting) {
this.waiting = waiting;
}

@ApiModelProperty("")
@JsonProperty("Paused")
public Policy getPaused() {
return this.paused;
}

public void setPaused(Policy paused) {
this.paused = paused;
}

@ApiModelProperty("")
@JsonProperty("Default")
public Policy getDefault() {
return this._default;
}

public void setDefault(Policy _default) {
this._default = _default;
}

public boolean equals(Object o) {
if (this == o) {
return true;
} else if (o != null && this.getClass() == o.getClass()) {
ExpirationPolicy expirationPolicy = (ExpirationPolicy)o;
return Objects.equals(this.active, expirationPolicy.active) && Objects.equals(this.completed, expirationPolicy.completed) && Objects.equals(this.failed, expirationPolicy.failed) && Objects.equals(this.cancelled, expirationPolicy.cancelled) && Objects.equals(this.waiting, expirationPolicy.waiting) && Objects.equals(this.paused, expirationPolicy.paused) && Objects.equals(this._default, expirationPolicy._default);
} else {
return false;
}
}

public int hashCode() {
return Objects.hash(new Object[]{this.active, this.completed, this.failed, this.cancelled, this.waiting, this.paused, this._default});
}

public String toString() {
dermot-hardy marked this conversation as resolved.
Show resolved Hide resolved
StringBuilder sb = new StringBuilder();
sb.append("class ExpirationPolicy {\n");
sb.append(" active: ").append(this.toIndentedString(this.active)).append("\n");
sb.append(" completed: ").append(this.toIndentedString(this.completed)).append("\n");
sb.append(" failed: ").append(this.toIndentedString(this.failed)).append("\n");
sb.append(" cancelled: ").append(this.toIndentedString(this.cancelled)).append("\n");
sb.append(" waiting: ").append(this.toIndentedString(this.waiting)).append("\n");
sb.append(" paused: ").append(this.toIndentedString(this.paused)).append("\n");
sb.append(" _default: ").append(this.toIndentedString(this._default)).append("\n");
sb.append("}");
return sb.toString();
}

private String toIndentedString(Object o) {
return o == null ? "null" : o.toString().replace("\n", "\n ");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class Job {
private String id = null;
private String name = null;
private String description = null;
private ExpirationPolicy expirationPolicy = null;
/**
* @deprecated 21/01/2020 - Replaced by labels functionality.
*/
Expand Down Expand Up @@ -126,6 +127,15 @@ public void setDescription(String description) {
this.description = description;
}

@ApiModelProperty("")
@JsonProperty("expirationPolicy")
public ExpirationPolicy getExpirationPolicy() {
return this.expirationPolicy;
}

public void setExpirationPolicy(ExpirationPolicy expirationPolicy) {
this.expirationPolicy = expirationPolicy;
}

/**
* External data can be associated with the job for use by other components
Expand Down Expand Up @@ -260,6 +270,7 @@ public boolean equals(Object o) {
return Objects.equals(id, job.id) &&
Objects.equals(name, job.name) &&
Objects.equals(description, job.description) &&
Objects.equals(this.expirationPolicy, job.expirationPolicy) &&
Objects.equals(externalData, job.externalData) &&
Objects.equals(createTime, job.createTime) &&
Objects.equals(this.lastUpdateTime, job.lastUpdateTime) &&
Expand All @@ -270,7 +281,8 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return Objects.hash(id, name, description, externalData, createTime, lastUpdateTime, status, percentageComplete, failures);
return Objects.hash(id, name, description, this.expirationPolicy, externalData, createTime, lastUpdateTime, status,
percentageComplete, failures);
}

@Override
Expand All @@ -281,6 +293,7 @@ public String toString() {
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" expirationPolicy: ").append(this.toIndentedString(this.expirationPolicy)).append("\n");
sb.append(" externalData: ").append(toIndentedString(externalData)).append("\n");
sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n");
sb.append(" lastUpdateTime: ").append(toIndentedString(lastUpdateTime)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class NewJob {

private String name = null;
private String description = null;
private ExpirationPolicy expirationPolicy = null;
/**
* @deprecated 21/01/2020 - Replaced by labels functionality.
*/
Expand Down Expand Up @@ -84,6 +85,19 @@ public void setDescription(String description) {
this.description = description;
}

/**
**/

@ApiModelProperty(value = "")
@JsonProperty("expirationPolicy")
public ExpirationPolicy getExpirationPolicy() {
return expirationPolicy;
}
public void setExpirationPolicy(ExpirationPolicy expirationPolicy) {
this.expirationPolicy = expirationPolicy;
}



/**
* External data can be associated with the job for use by other components
Expand Down Expand Up @@ -221,6 +235,7 @@ public boolean equals(Object o) {
NewJob newJob = (NewJob) o;
return Objects.equals(name, newJob.name) &&
Objects.equals(description, newJob.description) &&
Objects.equals(expirationPolicy, newJob.expirationPolicy) &&
Objects.equals(externalData, newJob.externalData) &&
Objects.equals(task, newJob.task) &&
Objects.equals(prerequisiteJobIds, newJob.prerequisiteJobIds) &&
Expand All @@ -229,7 +244,7 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return Objects.hash(name, description, externalData, task, prerequisiteJobIds, delay);
return Objects.hash(name, description, expirationPolicy, externalData, task, prerequisiteJobIds, delay);
}

@Override
Expand All @@ -239,6 +254,7 @@ public String toString() {

sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" expirationPolicy: ").append(toIndentedString(expirationPolicy)).append("\n");
sb.append(" externalData: ").append(toIndentedString(externalData)).append("\n");
sb.append(" task: ").append(toIndentedString(task)).append("\n");
sb.append(" prerequisiteJobIds: ").append(toIndentedString(prerequisiteJobIds)).append("\n");
Expand Down
Loading