Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
[BZ 1120418] Transform domain classes to a fluid interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Negrea committed Jul 24, 2014
1 parent 8bc3786 commit 23e0ef3
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,32 +90,36 @@ public int getId() {
return id;
}

public void setId(int id) {
public MaintenanceJob setId(int id) {
this.id = id;
return this;
}

public String getName() {
return name;
}

public void setName(String name) {
public MaintenanceJob setName(String name) {
this.name = name;
return this;
}

public int getType() {
return type;
}

public void setType(int type) {
public MaintenanceJob setType(int type) {
this.type = type;
return this;
}

public List<MaintenanceStep> getMaintenanceSteps() {
return steps;
}

public void setAgents(List<MaintenanceStep> steps) {
public MaintenanceJob setSteps(List<MaintenanceStep> steps) {
this.steps = steps;
return this;
}

public int getMaintenanceStepCount() {
Expand All @@ -130,8 +134,9 @@ public long getMtime() {
return mtime;
}

public void setMtime(long mtime) {
public MaintenanceJob setMtime(long mtime) {
this.mtime = mtime;
return this;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
Expand Down Expand Up @@ -77,7 +79,8 @@ public class MaintenanceStep implements Serializable {
//TODO: have to change to full Enum once the types settle to
// a finite few
@Column(name = "TYPE", nullable = false)
private String type;
@Enumerated(EnumType.STRING)
private Type type;

// the time this maintenance workflow was created
@Column(name = "CTIME", nullable = false)
Expand Down Expand Up @@ -109,48 +112,54 @@ public int getId() {
return id;
}

public void setId(int id) {
public MaintenanceStep setId(int id) {
this.id = id;
return this;
}

public MaintenanceJob getMaintenanceJob() {
return maintenanceJob;
}

public void setMaintenanceJob(MaintenanceJob maintenanceJob) {
public MaintenanceStep setMaintenanceJob(MaintenanceJob maintenanceJob) {
this.maintenanceJob = maintenanceJob;
return this;
}

public int getStep() {
return step;
}

public void setStep(int step) {
public MaintenanceStep setStep(int step) {
this.step = step;
return this;
}

public String getNodeAddress() {
return nodeAddress;
}

public void setNodeAddress(String nodeAddress) {
public MaintenanceStep setNodeAddress(String nodeAddress) {
this.nodeAddress = nodeAddress;
return this;
}

public String getOperationName() {
return name;
}

public void setName(String name) {
public MaintenanceStep setName(String name) {
this.name = name;
return this;
}

public String getType() {
public Type getType() {
return type;
}

public void setType(String type) {
public MaintenanceStep setType(Type type) {
this.type = type;
return this;
}

public long getCtime() {
Expand All @@ -161,40 +170,45 @@ public long getMtime() {
return mtime;
}

public void setMtime(long mtime) {
public MaintenanceStep setMtime(long mtime) {
this.mtime = mtime;
return this;
}

public boolean isSequential() {
return sequential;
}

public void setSequential(boolean sequential) {
public MaintenanceStep setSequential(boolean sequential) {
this.sequential = sequential;
return this;
}

public long getTimeout() {
return timeout;
}

public void setTimeout(long timeout) {
public MaintenanceStep setTimeout(long timeout) {
this.timeout = timeout;
return this;
}

public String getArgs() {
return args;
}

public void setArgs(String args) {
public MaintenanceStep setArgs(String args) {
this.args = args;
return this;
}

public String getOnFailure() {
return onFailure;
}

public void setOnFailure(String onFailure) {
public MaintenanceStep setOnFailure(String onFailure) {
this.onFailure = onFailure;
return this;
}

@Override
Expand Down Expand Up @@ -237,4 +251,11 @@ public boolean equals(Object obj) {

return true;
}

public enum Type {
ResourceUpdate,
EntityUpdate,
ResourceOperation,
ServerUpdate
}
}

0 comments on commit 23e0ef3

Please sign in to comment.