Removed comment

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/vre-management/smart-executor-api@124073 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2016-02-10 15:52:32 +00:00
parent d0c0058993
commit b675b65c79
3 changed files with 6 additions and 113 deletions

View File

@ -20,7 +20,7 @@ import org.gcube.vremanagement.executor.utils.ObjectCompare;
*/
@XmlRootElement()
@XmlAccessorType(XmlAccessType.FIELD)
public class LaunchParameter implements Comparable<LaunchParameter>{
public class LaunchParameter implements Comparable<LaunchParameter> {
@XmlElement
/**
@ -61,15 +61,6 @@ public class LaunchParameter implements Comparable<LaunchParameter>{
*/
protected Scheduling scheduling;
@XmlElement
/**
* Used only for scheduled tasks. Indicate if the task has to be persisted
* so that if the SmartExectuor Service instance die, another one take in
* charge that execution.
*/
@Deprecated
protected boolean persist;
protected LaunchParameter(){}
public LaunchParameter(String pluginName, Map<String, Object> inputs) {
@ -96,54 +87,6 @@ public class LaunchParameter implements Comparable<LaunchParameter>{
this.scheduling = scheduling;
}
@Deprecated
public LaunchParameter(String pluginName, Map<String, Object> inputs, Scheduling scheduling, boolean persist) {
this(pluginName, null, null, inputs, scheduling);
setPersist(persist);
}
@Deprecated
public LaunchParameter(String pluginName, Map<String, String> pluginCapabilities, Map<String, Object> inputs, Scheduling scheduling, boolean persist) {
this(pluginName, null, pluginCapabilities, inputs, scheduling);
setPersist(persist);
}
/**
* @return the persist
*/
@Deprecated
public boolean isPersist() {
return persist;
}
/**
* This method is deprecated, use {@link Scheduling#setGlobal(Boolean)}
* instead. This method has no side effect if scheduling is null.
* Moreover has no side effect when {@link Scheduling#global} has been
* already initialized.
* @param persist the persist to set
*/
@Deprecated
public void setPersist(boolean persist) {
if(scheduling==null){
return;
}
if(this.scheduling.global==null){
this.scheduling.global = persist;
this.persist = persist;
}else{
this.persist = this.scheduling.global;
}
}
/**
* @return the name
*/
@Deprecated
public String getName() {
return getPluginName();
}
/**
* @return the name
*/
@ -165,7 +108,6 @@ public class LaunchParameter implements Comparable<LaunchParameter>{
this.pluginCapabilities = pluginCapabilities;
}
/**
* @return the inputs
*/
@ -173,7 +115,6 @@ public class LaunchParameter implements Comparable<LaunchParameter>{
return inputs;
}
/**
* @return the scheduling
*/
@ -190,17 +131,16 @@ public class LaunchParameter implements Comparable<LaunchParameter>{
@Override
public String toString(){
return String.format("%s : { Plugin : { Name: %s , Capabilites : %s}, Persist : %b, Scheduling : {%s}, Inputs : %s}",
return String.format("%s : { Plugin : { Name: %s , Capabilites : %s}, Scheduling : {%s}, Inputs : %s}",
this.getClass().getSimpleName(), pluginName, pluginCapabilities,
persist, scheduling, inputs);
scheduling, inputs);
}
/** {@inheritDoc} */
/** {@inheritDoc} */
@Override
public int compareTo(LaunchParameter launchParameter) {
int compareResult = 0;
compareResult = new ObjectCompare<Boolean>().compare(new Boolean(persist),new Boolean(launchParameter.persist));
if(compareResult!=0){
return compareResult;
}
@ -218,5 +158,4 @@ public class LaunchParameter implements Comparable<LaunchParameter>{
return new MapCompare<Map<String, Object>, String, Object>().compareMaps(inputs, launchParameter.inputs);
}
}

View File

@ -2,9 +2,6 @@ package org.gcube.vremanagement.executor.plugin;
import java.util.Map;
import org.gcube.vremanagement.executor.persistence.Persistence;
import org.gcube.vremanagement.executor.persistence.PersistenceConnector;
/**
* This interface represent the contract for a plugin runnable by the executor.
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
@ -14,11 +11,6 @@ public abstract class Plugin<T extends PluginDeclaration> {
private T pluginDeclaration;
@Deprecated
public Plugin(T pluginDeclaration, Persistence<? extends PersistenceConnector> persistence){
this.pluginDeclaration = pluginDeclaration;
}
public Plugin(T pluginDeclaration){
this.pluginDeclaration = pluginDeclaration;
}

View File

@ -41,8 +41,9 @@ public class LaunchParameterTest {
long sleepTime = 10000;
inputs.put("sleepTime", sleepTime);
Scheduling scheduling = new Scheduling(20);
scheduling.setGlobal(true);
LaunchParameter launchParameter = new LaunchParameter("HelloWorld", inputs, scheduling, true);
LaunchParameter launchParameter = new LaunchParameter("HelloWorld", inputs, scheduling);
logger.debug("{} to be serialized : {}", launchParameter.getClass().getSimpleName(), launchParameter);
@ -67,43 +68,4 @@ public class LaunchParameterTest {
}
/*
private int check(Boolean a, Boolean b){
if(a==null){
if(b==null){
return 0;
}
return -1;
}
if(b==null){
return 1;
}
return a.compareTo(b);
}
@Test
public void test(){
List<Boolean> values = new ArrayList<Boolean>();
values.add(null);
values.add(true);
values.add(false);
for(Boolean valueA : values){
Boolean a = valueA;
for(Boolean valueB : values){
Boolean b = valueB;
logger.debug("a : {}, b : {}, a.compareTo(b) : {}", a, b, check(a, b));
logger.debug("a : {}, b : {}, b.compareTo(a) : {}", b, a, check(b, a));
logger.debug("---");
}
}
}
*/
}