Enhancement on Project Activity #11690

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/Common/workspace-task-executor-library@167321 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2018-05-04 12:24:26 +00:00
parent f966114e8f
commit 23a7289c78
2 changed files with 35 additions and 17 deletions

View File

@ -35,6 +35,7 @@ public class TaskConfiguration implements BaseTaskConfiguration, Serializable {
* The encrypted VRE Token of the user in the VRE where submit the * The encrypted VRE Token of the user in the VRE where submit the
* computation * computation
*/ */
private String scope;
private String maskedToken; private String maskedToken;
private String workspaceItemId; private String workspaceItemId;
@JsonIgnoreProperties @JsonIgnoreProperties
@ -51,32 +52,46 @@ public class TaskConfiguration implements BaseTaskConfiguration, Serializable {
/** /**
* Instantiates a new task configuration. * Instantiates a new task configuration.
* *
* @param configurationKey * @param configurationKey the configuration key
* the configuration key * @param taskId the task id
* @param taskId * @param taskDescription the task description
* the task id * @param scope the scope
* @param taskDescription * @param maskedToken the token
* the task description * @param workspaceItemId the workspace item id
* @param maskedToken * @param mapParameters the map parameters
* the token
* @param workspaceItemId
* the workspace item id
* @param mapParameters
* the map parameters
*/ */
public TaskConfiguration( public TaskConfiguration(
String configurationKey, String taskId, String taskDescription, String configurationKey, String taskId, String taskDescription, String scope,
String maskedToken, String workspaceItemId, String maskedToken, String workspaceItemId,
Map<String, String> mapParameters) { Map<String, String> mapParameters) {
setConfigurationKey(configurationKey); setConfigurationKey(configurationKey);
this.taskId = taskId; this.taskId = taskId;
this.taskDescription = taskDescription; this.taskDescription = taskDescription;
this.scope = scope;
this.maskedToken = maskedToken; this.maskedToken = maskedToken;
this.workspaceItemId = workspaceItemId; this.workspaceItemId = workspaceItemId;
this.mapParameters = mapParameters; 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) * (non-Javadoc)
* @see org.gcube.common.workspacetaskexecutor.shared.BaseTaskConfiguration# * @see org.gcube.common.workspacetaskexecutor.shared.BaseTaskConfiguration#
@ -219,8 +234,7 @@ public class TaskConfiguration implements BaseTaskConfiguration, Serializable {
this.maskedToken = maskedToken; this.maskedToken = maskedToken;
} }
/* /* (non-Javadoc)
* (non-Javadoc)
* @see java.lang.Object#toString() * @see java.lang.Object#toString()
*/ */
@Override @Override
@ -231,7 +245,9 @@ public class TaskConfiguration implements BaseTaskConfiguration, Serializable {
builder.append(taskId); builder.append(taskId);
builder.append(", taskDescription="); builder.append(", taskDescription=");
builder.append(taskDescription); builder.append(taskDescription);
builder.append(", token="); builder.append(", scope=");
builder.append(scope);
builder.append(", maskedToken=");
builder.append(maskedToken); builder.append(maskedToken);
builder.append(", workspaceItemId="); builder.append(", workspaceItemId=");
builder.append(workspaceItemId); builder.append(workspaceItemId);
@ -242,4 +258,6 @@ public class TaskConfiguration implements BaseTaskConfiguration, Serializable {
builder.append("]"); builder.append("]");
return builder.toString(); return builder.toString();
} }
} }

View File

@ -220,7 +220,7 @@ public class TestDataMinerTaskExecutor {
public static TaskConfiguration createDummyConfiguration(int index){ public static TaskConfiguration createDummyConfiguration(int index){
Map<String, String> mapParameters = new HashMap<String, String>(); Map<String, String> mapParameters = new HashMap<String, String>();
mapParameters.put("publiclink", "this is the public link "+index); 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);
} }