Removed needless object
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/Common/workspace-task-executor-library@167334 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
d45eeef5fe
commit
3e6a514b97
|
@ -7,7 +7,6 @@ import org.apache.commons.lang.Validate;
|
|||
import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
|
||||
import org.gcube.common.workspacetaskexecutor.shared.ExecutableItem;
|
||||
import org.gcube.common.workspacetaskexecutor.shared.ExecutableTask;
|
||||
import org.gcube.common.workspacetaskexecutor.shared.TaskParameterAvailableTypes;
|
||||
import org.gcube.common.workspacetaskexecutor.shared.TaskParameterType;
|
||||
import org.gcube.common.workspacetaskexecutor.shared.dataminer.TaskComputation;
|
||||
import org.gcube.common.workspacetaskexecutor.shared.dataminer.TaskConfiguration;
|
||||
|
@ -320,19 +319,18 @@ public class WorkspaceDataMinerTaskExecutor implements ExecutableTask<TaskConfig
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the parameter types.
|
||||
*
|
||||
* @return the parameter types
|
||||
*/
|
||||
public TaskParameterAvailableTypes getParameterTypes(){
|
||||
public List<TaskParameterType> getParameterTypes(){
|
||||
String[] typeNames = Converter.convertEnumNamesToArraString(ParameterType.class);
|
||||
List<TaskParameterType> types = new ArrayList<TaskParameterType>();
|
||||
for (String string : typeNames) {
|
||||
types.add(new TaskParameterType(string));
|
||||
}
|
||||
return new TaskParameterAvailableTypes(types);
|
||||
return types;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
package org.gcube.common.workspacetaskexecutor.shared;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* The Class TaskParameterAvailableTypes.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* May 7, 2018
|
||||
*/
|
||||
public class TaskParameterAvailableTypes implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 5005902773845652944L;
|
||||
public List<TaskParameterType> parametersTypes;
|
||||
|
||||
/**
|
||||
* Instantiates a new base task parameter types.
|
||||
*/
|
||||
public TaskParameterAvailableTypes() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new task parameter available types.
|
||||
*
|
||||
* @param availableParameterTypes the available parameter types
|
||||
*/
|
||||
public TaskParameterAvailableTypes(List<TaskParameterType> availableParameterTypes) {
|
||||
|
||||
this.parametersTypes = availableParameterTypes;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the parameters types.
|
||||
*
|
||||
* @return the parameters types
|
||||
*/
|
||||
public List<TaskParameterType> getParametersTypes() {
|
||||
|
||||
return parametersTypes;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("TaskParameterTypes [parametersTypes=");
|
||||
builder.append(parametersTypes);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -19,7 +19,6 @@ import org.gcube.common.homelibrary.home.workspace.exceptions.WorkspaceFolderNot
|
|||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.common.workspacetaskexecutor.dataminer.WorkspaceDataMinerTaskExecutor;
|
||||
import org.gcube.common.workspacetaskexecutor.shared.TaskParameter;
|
||||
import org.gcube.common.workspacetaskexecutor.shared.TaskParameterAvailableTypes;
|
||||
import org.gcube.common.workspacetaskexecutor.shared.TaskParameterType;
|
||||
import org.gcube.common.workspacetaskexecutor.shared.dataminer.TaskConfiguration;
|
||||
import org.gcube.common.workspacetaskexecutor.util.Converter;
|
||||
|
@ -230,8 +229,7 @@ public class TestDataMinerTaskExecutor {
|
|||
types.add(new TaskParameterType(string));
|
||||
}
|
||||
|
||||
TaskParameterAvailableTypes tpt = new TaskParameterAvailableTypes(types);
|
||||
System.out.println(tpt.toString());
|
||||
System.out.println(types.toString());
|
||||
|
||||
// for (String availableType : tpt.getParametersTypes()) {
|
||||
// System.out.println(availableType);
|
||||
|
@ -249,7 +247,7 @@ public class TestDataMinerTaskExecutor {
|
|||
TaskParameter tp2 = new TaskParameter();
|
||||
tp2.setKey("key"+index);
|
||||
tp2.setValue("value "+index);
|
||||
tp2.setType(tpt.getParametersTypes().get(new Random().nextInt(tpt.getParametersTypes().size())));
|
||||
tp2.setType(types.get(new Random().nextInt(types.size())));
|
||||
mapParameters.put("publiclink", tp2);
|
||||
|
||||
return new TaskConfiguration(index+"", UUID.randomUUID().toString(), null, SCOPE, "my token", WORKSPACE_FOLDER_ID, mapParameters);
|
||||
|
|
Loading…
Reference in New Issue