refs #508: Support Config File to run task at service startup

https://support.d4science.org/issues/508

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/vre-management/smart-executor-api@117761 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2015-09-01 15:59:08 +00:00
parent 888ce28828
commit 97fb6fc64c
2 changed files with 40 additions and 10 deletions

View File

@ -18,7 +18,7 @@ import org.gcube.vremanagement.executor.api.types.adapter.MapAdapter;
*/
@XmlRootElement()
@XmlAccessorType(XmlAccessType.FIELD)
public class LaunchParameter implements Comparable<LaunchParameter> {
public class LaunchParameter {
@XmlElement
protected String pluginName;
@ -137,17 +137,22 @@ public class LaunchParameter implements Comparable<LaunchParameter> {
this.persist = persist;
}
/**
* {@inheritDoc}
*/
@Override
public int compareTo(LaunchParameter launchParameter) {
int compare = pluginName.compareTo(launchParameter.pluginName);
if(compare!=0){
return pluginName.compareTo(launchParameter.pluginName);
public boolean equals(LaunchParameter launchParameter){
if(this.persist!=launchParameter.persist){
return false;
}
return 0;
if(!pluginName.equals(launchParameter.pluginName)){
return false;
}
if(!scheduling.equals(launchParameter.scheduling)){
return false;
}
return this.inputs.equals(launchParameter.inputs);
}
}

View File

@ -172,5 +172,30 @@ public class Scheduling {
return String.format("CronExpression %s, Delay %d, SchedulingTimes %d, FirstStartTime %d, EndTime %d, PreviuosExecutionsMustBeCompleted %b",
cronExpression, delay, schedulingTimes, firstStartTime, endTime, previuosExecutionsMustBeCompleted);
}
public boolean equals(Scheduling scheduling) {
if(cronExpression.equals(scheduling.cronExpression)){
return false;
}
if(delay.equals(scheduling.delay)){
return false;
}
if(schedulingTimes != scheduling.schedulingTimes){
return false;
}
if(firstStartTime.equals(scheduling.firstStartTime)){
return false;
}
if(endTime.equals(scheduling.endTime)){
return false;
}
return previuosExecutionsMustBeCompleted==scheduling.previuosExecutionsMustBeCompleted;
}
}