Skip to content

Commit

Permalink
Update daily job and properties to support OpCon Rest-API 21
Browse files Browse the repository at this point in the history
  • Loading branch information
Bertievh committed Feb 13, 2023
1 parent 976bc53 commit 872c95a
Show file tree
Hide file tree
Showing 7 changed files with 375 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.smatechnologies</groupId>
<artifactId>opcon-rest-api-client</artifactId>
<version>1.0.7</version>
<version>1.0.8</version>

<name>SMA OpCon Library Rest Api Client</name>
<description>SMA OpCon Library Rest Api Client</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class WsMasterJobs {
private final WsFactory wsFactory;

public WsMasterJobs(WsFactory wsFactory) {
this.wsFactory = wsFactory.path("masterjobs");
this.wsFactory = wsFactory.path("MasterJobs/v2");
}

public List<MasterJob> get(MasterJobsCriteria masterJobsCriteria) throws WsException {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
package com.smatechnologies.opcon.restapiclient.model;

import java.util.Objects;

public class Dependency {

public static final String RESOURCE = "dependency";

public static final String PROPERTY_IS_SATISIFIED = "isSatisfied";
public static final String PROPERTY_ID = "id";
public static final String PROPERTY_TYPE = "type";
public static final String PROPERTY_PREDECESSOR = "predecessor";

private Boolean isSatisfied;
private Integer id;
private DependencyType type;
private DependencyPredecessor predecessor;

public Boolean getIsSatisfied() {
return isSatisfied;
}

public void setIsSatisfied(Boolean isSatisfied) {
this.isSatisfied = isSatisfied;
}

public Integer getId() {
return id;
}

public void setId(Integer id) {
this.id = id;
}

public DependencyType getType() {
return type;
}

public void setType(DependencyType type) {
this.type = type;
}

public DependencyPredecessor getPredecessor() {
return predecessor;
}

public void setPredecessor(DependencyPredecessor predecessor) {
this.predecessor = predecessor;
}

@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Dependency that = (Dependency) o;
return Objects.equals(isSatisfied, that.isSatisfied) &&
Objects.equals(id, that.id) &&
Objects.equals(type, that.type) &&
Objects.equals(predecessor, that.predecessor);
}

@Override
public int hashCode() {
return Objects.hash(isSatisfied, id, type, predecessor);
}

public static class DependencyType {

public static final String PROPERTY_ID = "id";
public static final String PROPERTY_NAME = "name";
public static final String PROPERTY_CONDITION = "condition";
public static final String PROPERTY_OFFSET = "offset";

private Integer id;
private String name;
private String condition;
private Integer offset;

public Integer getId() {
return id;
}

public void setId(Integer id) {
this.id = id;
}

public String getName() {
return name;
}

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

public String getCondition() {
return condition;
}

public void setCondition(String condition) {
this.condition = condition;
}

public Integer getOffset() {
return offset;
}

public void setOffset(Integer offset) {
this.offset = offset;
}

@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
DependencyType that = (DependencyType) o;
return Objects.equals(id, that.id) &&
Objects.equals(name, that.name) &&
Objects.equals(condition, that.condition) &&
Objects.equals(offset, that.offset);
}

@Override
public int hashCode() {
return Objects.hash(id, name, condition, offset);
}
}

public static class DependencyPredecessor {

public static final String PROPERTY_SCHEDULE = "schedule";
public static final String PROPERTY_ID = "id";
public static final String PROPERTY_NAME = "name";
public static final String PROPERTY_CONDITION = "status";

private DependencyPredecessorSchedule schedule;
private String id;
private String name;
private String status;

public DependencyPredecessorSchedule getSchedule() {
return schedule;
}

public void setSchedule(DependencyPredecessorSchedule schedule) {
this.schedule = schedule;
}

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public String getName() {
return name;
}

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

public String getStatus() {
return status;
}

public void setStatus(String status) {
this.status = status;
}

@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
DependencyPredecessor that = (DependencyPredecessor) o;
return Objects.equals(schedule, that.schedule) &&
Objects.equals(id, that.id) &&
Objects.equals(name, that.name) &&
Objects.equals(status, that.status);
}

@Override
public int hashCode() {
return Objects.hash(schedule, id, name, status);
}
}

public static class DependencyPredecessorSchedule {

public static final String PROPERTY_ID = "id";
public static final String PROPERTY_DATE = "date";
public static final String PROPERTY_NAME = "name";

private String id;
private String date;
private String name;

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public String getDate() {
return date;
}

public void setDate(String date) {
this.date = date;
}

public String getName() {
return name;
}

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

@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
DependencyPredecessorSchedule that = (DependencyPredecessorSchedule) o;
return Objects.equals(id, that.id) &&
Objects.equals(date, that.date) &&
Objects.equals(name, that.name);
}

@Override
public int hashCode() {
return Objects.hash(id, date, name);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* @author Matthieu COELHO
*/
public class EventTrigger {
public class Event {

public static final String RESOURCE = "eventTrigger";

Expand Down Expand Up @@ -138,9 +138,9 @@ public void setFrequencyLevel(Boolean frequencyLevel) {
public boolean equals(Object o) {
if (this == o)
return true;
if (!(o instanceof EventTrigger))
if (!(o instanceof Event))
return false;
EventTrigger that = (EventTrigger) o;
Event that = (Event) o;
return Objects.equals(getId(), that.getId()) &&
getType() == that.getType() &&
getStatus() == that.getStatus() &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,26 @@ public class Frequency {
public static final String RESOURCE = "frequency";

public static final String PROPERTY_NAME = "name";
public static final String PROPERTY_IN_USE = "inUse";
public static final String PROPERTY_AOBN = "aobn";
public static final String PROPERTY_FREQUENCY_PRIORITY = "frequencyPriority";
public static final String PROPERTY_JOB_EXECUTION = "jobExecution";
public static final String PROPERTY_FINISH_OK_BEHAVIOR = "finishOkBehavior";
public static final String PROPERTY_START_TIME_ESTIMATION = "startTimeEstimation";
public static final String PROPERTY_RETRY_BEHAVIOR = "retryBehavior";
public static final String PROPERTY_JOB_TIMES_ESTIMATION = "jobTimesEstimation";

/*
* "inUse": 0,
"aobn": "Unknown",
"name": "SMASun-SatO7",
"frequencyPriority": 0,
*/

private String name;
private Integer inUse;
private Integer aobn;
private Integer frequencyPriority;
private JobExecution jobExecution;
private FinishOkBehavior finishOkBehavior;
private StartTimeEstimation startTimeEstimation;
Expand All @@ -36,7 +49,31 @@ public void setName(String name) {
this.name = name;
}

public JobExecution getJobExecution() {
public Integer getInUse() {
return inUse;
}

public void setInUse(Integer inUse) {
this.inUse = inUse;
}

public Integer getAobn() {
return aobn;
}

public void setAobn(Integer aobn) {
this.aobn = aobn;
}

public Integer getFrequencyPriority() {
return frequencyPriority;
}

public void setFrequencyPriority(Integer frequencyPriority) {
this.frequencyPriority = frequencyPriority;
}

public JobExecution getJobExecution() {
return jobExecution;
}

Expand Down
Loading

0 comments on commit 872c95a

Please sign in to comment.