diff --git a/src/main/java/org/gcube/common/workspacetaskexecutor/ConfigurableTask.java b/src/main/java/org/gcube/common/workspacetaskexecutor/ConfigurableTask.java index 4b62e88..75623bf 100644 --- a/src/main/java/org/gcube/common/workspacetaskexecutor/ConfigurableTask.java +++ b/src/main/java/org/gcube/common/workspacetaskexecutor/ConfigurableTask.java @@ -4,7 +4,6 @@ package org.gcube.common.workspacetaskexecutor; import org.gcube.common.workspacetaskexecutor.shared.ItemNotExecutable; -import org.gcube.common.workspacetaskexecutor.shared.TaskConfiguration; /** diff --git a/src/main/java/org/gcube/common/workspacetaskexecutor/shared/TaskConfiguration.java b/src/main/java/org/gcube/common/workspacetaskexecutor/TaskConfiguration.java similarity index 63% rename from src/main/java/org/gcube/common/workspacetaskexecutor/shared/TaskConfiguration.java rename to src/main/java/org/gcube/common/workspacetaskexecutor/TaskConfiguration.java index 96b38c6..271adb3 100644 --- a/src/main/java/org/gcube/common/workspacetaskexecutor/shared/TaskConfiguration.java +++ b/src/main/java/org/gcube/common/workspacetaskexecutor/TaskConfiguration.java @@ -1,10 +1,12 @@ /** * */ -package org.gcube.common.workspacetaskexecutor.shared; +package org.gcube.common.workspacetaskexecutor; import java.util.Map; +import org.apache.http.HttpRequest; + /** * The Interface DoTaskConfiguration. * @@ -21,14 +23,6 @@ public interface TaskConfiguration { */ String getTaskId(); - - /** - * Gets the item id. - * - * @return the item id - */ - String getItemId(); - /** * Gets the task description. * @@ -36,6 +30,7 @@ public interface TaskConfiguration { */ String getTaskDescription(); + /** * Gets the map parameters. * @@ -44,4 +39,23 @@ public interface TaskConfiguration { Map getMapParameters(); + /** + * Gets the workspace item id where execute the Task + * + * @return the workspace item id + */ + String getWorkspaceItemId(); + + + + /** + * Gets the http request. + * + * @return the http request + */ + HttpRequest getHttpRequest(); + + + + } diff --git a/src/main/java/org/gcube/common/workspacetaskexecutor/shared/homelibrary/AlgorithmConfiguration.java b/src/main/java/org/gcube/common/workspacetaskexecutor/shared/homelibrary/AlgorithmConfiguration.java new file mode 100644 index 0000000..1365031 --- /dev/null +++ b/src/main/java/org/gcube/common/workspacetaskexecutor/shared/homelibrary/AlgorithmConfiguration.java @@ -0,0 +1,182 @@ +/** + * + */ + +package org.gcube.common.workspacetaskexecutor.shared.homelibrary; + +import java.io.Serializable; +import java.util.Map; + +import org.apache.http.HttpRequest; +import org.gcube.common.workspacetaskexecutor.TaskConfiguration; + + + +/** + * The Class DataMinerAlgorithmConfiguration. + * + * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it + * Apr 26, 2018 + */ +public class AlgorithmConfiguration implements TaskConfiguration, Serializable { + + /** + * + */ + private static final long serialVersionUID = -3380573762288127547L; + private String taskId; + private String taskDescription; + private String token; + private String workspaceItemId; + private Map mapParameters; + + /** + * Instantiates a new run algorithm configuration. + */ + public AlgorithmConfiguration() { + + } + + /** + * @param taskId + * @param taskDescription + * @param token + * @param workspaceItemId + * @param mapParameters + */ + public AlgorithmConfiguration( + String taskId, String taskDescription, String token, + String workspaceItemId, Map mapParameters) { + + super(); + this.taskId = taskId; + this.taskDescription = taskDescription; + this.token = token; + this.workspaceItemId = workspaceItemId; + this.mapParameters = mapParameters; + } + + + /** + * @return the taskId + */ + public String getTaskId() { + + return taskId; + } + + + /** + * @return the taskDescription + */ + public String getTaskDescription() { + + return taskDescription; + } + + + /** + * @return the token + */ + public String getToken() { + + return token; + } + + + /** + * @return the workspaceItemId + */ + public String getWorkspaceItemId() { + + return workspaceItemId; + } + + + /** + * @return the mapParameters + */ + public Map getMapParameters() { + + return mapParameters; + } + + + /** + * @param taskId the taskId to set + */ + public void setTaskId(String taskId) { + + this.taskId = taskId; + } + + + /** + * @param taskDescription the taskDescription to set + */ + public void setTaskDescription(String taskDescription) { + + this.taskDescription = taskDescription; + } + + + /** + * @param token the token to set + */ + public void setToken(String token) { + + this.token = token; + } + + + /** + * @param workspaceItemId the workspaceItemId to set + */ + public void setWorkspaceItemId(String workspaceItemId) { + + this.workspaceItemId = workspaceItemId; + } + + + /** + * @param mapParameters the mapParameters to set + */ + public void setMapParameters(Map mapParameters) { + + this.mapParameters = mapParameters; + } + + /* (non-Javadoc) + * @see org.gcube.common.workspacetaskexecutor.TaskConfiguration#getHttpRequest() + */ + @Override + public HttpRequest getHttpRequest() { + + // TODO Auto-generated method stub + return null; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + + StringBuilder builder = new StringBuilder(); + builder.append("AlgorithmConfiguration [taskId="); + builder.append(taskId); + builder.append(", taskDescription="); + builder.append(taskDescription); + builder.append(", token="); + builder.append(token); + builder.append(", workspaceItemId="); + builder.append(workspaceItemId); + builder.append(", mapParameters="); + builder.append(mapParameters); + builder.append("]"); + return builder.toString(); + } + + + +}