diff --git a/src/main/java/org/gcube/common/workspacetaskexecutor/shared/dataminer/TaskConfiguration.java b/src/main/java/org/gcube/common/workspacetaskexecutor/shared/dataminer/TaskConfiguration.java index 38c244a..ec7cce8 100644 --- a/src/main/java/org/gcube/common/workspacetaskexecutor/shared/dataminer/TaskConfiguration.java +++ b/src/main/java/org/gcube/common/workspacetaskexecutor/shared/dataminer/TaskConfiguration.java @@ -35,6 +35,7 @@ public class TaskConfiguration implements BaseTaskConfiguration, Serializable { * The encrypted VRE Token of the user in the VRE where submit the * computation */ + private String scope; private String maskedToken; private String workspaceItemId; @JsonIgnoreProperties @@ -51,32 +52,46 @@ public class TaskConfiguration implements BaseTaskConfiguration, Serializable { /** * Instantiates a new task configuration. * - * @param configurationKey - * the configuration key - * @param taskId - * the task id - * @param taskDescription - * the task description - * @param maskedToken - * the token - * @param workspaceItemId - * the workspace item id - * @param mapParameters - * the map parameters + * @param configurationKey the configuration key + * @param taskId the task id + * @param taskDescription the task description + * @param scope the scope + * @param maskedToken the token + * @param workspaceItemId the workspace item id + * @param mapParameters the map parameters */ public TaskConfiguration( - String configurationKey, String taskId, String taskDescription, + String configurationKey, String taskId, String taskDescription, String scope, String maskedToken, String workspaceItemId, Map mapParameters) { setConfigurationKey(configurationKey); this.taskId = taskId; this.taskDescription = taskDescription; + this.scope = scope; this.maskedToken = maskedToken; this.workspaceItemId = workspaceItemId; this.mapParameters = mapParameters; } + + /** + * @return the scope + */ + public String getScope() { + + return scope; + } + + + /** + * @param scope the scope to set + */ + public void setScope(String scope) { + + this.scope = scope; + } + /* * (non-Javadoc) * @see org.gcube.common.workspacetaskexecutor.shared.BaseTaskConfiguration# @@ -219,8 +234,7 @@ public class TaskConfiguration implements BaseTaskConfiguration, Serializable { this.maskedToken = maskedToken; } - /* - * (non-Javadoc) + /* (non-Javadoc) * @see java.lang.Object#toString() */ @Override @@ -231,7 +245,9 @@ public class TaskConfiguration implements BaseTaskConfiguration, Serializable { builder.append(taskId); builder.append(", taskDescription="); builder.append(taskDescription); - builder.append(", token="); + builder.append(", scope="); + builder.append(scope); + builder.append(", maskedToken="); builder.append(maskedToken); builder.append(", workspaceItemId="); builder.append(workspaceItemId); @@ -242,4 +258,6 @@ public class TaskConfiguration implements BaseTaskConfiguration, Serializable { builder.append("]"); return builder.toString(); } + + } diff --git a/src/test/java/org/gcube/common/workspacetaskexecutor/TestDataMinerTaskExecutor.java b/src/test/java/org/gcube/common/workspacetaskexecutor/TestDataMinerTaskExecutor.java index e0526f4..1f07242 100644 --- a/src/test/java/org/gcube/common/workspacetaskexecutor/TestDataMinerTaskExecutor.java +++ b/src/test/java/org/gcube/common/workspacetaskexecutor/TestDataMinerTaskExecutor.java @@ -220,7 +220,7 @@ public class TestDataMinerTaskExecutor { public static TaskConfiguration createDummyConfiguration(int index){ Map mapParameters = new HashMap(); mapParameters.put("publiclink", "this is the public link "+index); - return new TaskConfiguration(index+"", UUID.randomUUID().toString(), null, "my token", WORKSPACE_FOLDER_ID, mapParameters); + return new TaskConfiguration(index+"", UUID.randomUUID().toString(), null, SCOPE, "my token", WORKSPACE_FOLDER_ID, mapParameters); }