Added jackson support for json marshalling/unmarshalling refs #5109

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/vre-management/smart-executor-api@152809 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2017-09-06 15:52:50 +00:00
parent 858f31a6ef
commit 0dcebedb03
4 changed files with 16 additions and 1 deletions

View File

@ -2,7 +2,7 @@
<!DOCTYPE xml> <!DOCTYPE xml>
<ReleaseNotes> <ReleaseNotes>
<Changeset component="org.gcube.vre-management.smart-executor.1.6.0" date="${buildDate}"> <Changeset component="org.gcube.vre-management.smart-executor.1.6.0" date="${buildDate}">
<Change></Change> <Change>Added jackson support for json marshalling/unmarshalling</Change>
</Changeset> </Changeset>
<Changeset component="org.gcube.vre-management.smart-executor-api.1.5.0" date="2017-03-16"> <Changeset component="org.gcube.vre-management.smart-executor-api.1.5.0" date="2017-03-16">
<Change>Provided access to UUID and iteration number fro a plugin (refs #6733)</Change> <Change>Provided access to UUID and iteration number fro a plugin (refs #6733)</Change>

View File

@ -13,6 +13,7 @@ import javax.xml.bind.annotation.XmlRootElement;
import org.gcube.vremanagement.executor.utils.ObjectCompare; import org.gcube.vremanagement.executor.utils.ObjectCompare;
import org.quartz.CronExpression; import org.quartz.CronExpression;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeInfo;
/** /**
@ -30,6 +31,7 @@ public class Scheduling implements Comparable<Scheduling> {
* This field is not valid when using delay * This field is not valid when using delay
*/ */
@XmlElement @XmlElement
@JsonProperty
protected String cronExpression; protected String cronExpression;
/** /**
@ -37,6 +39,7 @@ public class Scheduling implements Comparable<Scheduling> {
* This field is not valid when using cronExpression * This field is not valid when using cronExpression
*/ */
@XmlElement @XmlElement
@JsonProperty
protected Integer delay; protected Integer delay;
/** /**
@ -44,12 +47,14 @@ public class Scheduling implements Comparable<Scheduling> {
* 0 means indefinitely. * 0 means indefinitely.
*/ */
@XmlElement @XmlElement
@JsonProperty
protected int schedulingTimes; protected int schedulingTimes;
/** /**
* The first instant when the scheduling can start * The first instant when the scheduling can start
*/ */
@XmlElement @XmlElement
@JsonProperty
protected Long firstStartTime; // O or null means immediately protected Long firstStartTime; // O or null means immediately
/** /**
@ -57,6 +62,7 @@ public class Scheduling implements Comparable<Scheduling> {
* has remaining repeats. * has remaining repeats.
*/ */
@XmlElement @XmlElement
@JsonProperty
protected Long endTime; // O or null means never protected Long endTime; // O or null means never
/** /**
@ -67,6 +73,7 @@ public class Scheduling implements Comparable<Scheduling> {
* happened. * happened.
*/ */
@XmlElement @XmlElement
@JsonProperty
protected boolean previuosExecutionsMustBeCompleted; protected boolean previuosExecutionsMustBeCompleted;
/** /**
@ -74,6 +81,7 @@ public class Scheduling implements Comparable<Scheduling> {
* SmartExecutor instance if the initial one die. * SmartExecutor instance if the initial one die.
*/ */
@XmlElement @XmlElement
@JsonProperty
protected boolean global; protected boolean global;

View File

@ -5,6 +5,7 @@ package org.gcube.vremanagement.executor.plugin;
import org.gcube.vremanagement.executor.api.types.Scheduling; import org.gcube.vremanagement.executor.api.types.Scheduling;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonTypeName;
@ -12,7 +13,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
@JsonTypeName(value="Ref") @JsonTypeName(value="Ref")
public class Ref { public class Ref {
@JsonProperty
protected String id; protected String id;
@JsonProperty
protected String address; protected String address;
protected Ref() {} protected Ref() {}

View File

@ -5,6 +5,7 @@ package org.gcube.vremanagement.executor.plugin;
import org.gcube.vremanagement.executor.api.types.Scheduling; import org.gcube.vremanagement.executor.api.types.Scheduling;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonTypeName;
@ -48,6 +49,7 @@ public class RunOn {
/** /**
* @return the eServiceID * @return the eServiceID
*/ */
@JsonIgnore
public Ref getEService() { public Ref getEService() {
return eService; return eService;
} }
@ -55,6 +57,7 @@ public class RunOn {
/** /**
* @param eServiceID the eServiceID to set * @param eServiceID the eServiceID to set
*/ */
@JsonIgnore
public void setEService(Ref eService) { public void setEService(Ref eService) {
this.eService = eService; this.eService = eService;
} }