Francesco Mangiacrapa 2018-04-26 10:01:20 +00:00
parent 8a9d8d27e6
commit 4e4441ec5d
7 changed files with 260 additions and 0 deletions

View File

@ -0,0 +1,29 @@
/*
*
*/
package org.gcube.common.workspacetaskexecutor;
import org.gcube.common.workspacetaskexecutor.shared.ItemNotExecutable;
/**
* The Interface DoCheckTask.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Apr 26, 2018
* @param <T> the generic type
*/
public interface CheckableTask<T> {
/**
* Check item executable.
*
* @param itemId the item id
* @return the t
* @throws ItemNotExecutable the item not executable
* @throws Exception the exception
*/
T checkItemExecutable(String itemId) throws ItemNotExecutable, Exception;
}

View File

@ -0,0 +1,40 @@
/**
*
*/
package org.gcube.common.workspacetaskexecutor;
import org.gcube.common.workspacetaskexecutor.shared.ItemNotExecutable;
import org.gcube.common.workspacetaskexecutor.shared.TaskConfiguration;
/**
* The Interface ConfigurableTask.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Apr 26, 2018
*/
public interface ConfigurableTask {
/**
* Removes the task config.
*
* @param config the config
* @return the boolean
* @throws ItemNotExecutable the item not executable
* @throws Exception the exception
*/
Boolean removeTaskConfig(TaskConfiguration config) throws ItemNotExecutable, Exception;
/**
* Adds the task config.
*
* @param config the config
* @return the boolean
* @throws ItemNotExecutable the item not executable
* @throws Exception the exception
*/
Boolean addTaskConfig(TaskConfiguration config) throws ItemNotExecutable, Exception;
}

View File

@ -0,0 +1,57 @@
package org.gcube.common.workspacetaskexecutor;
import org.gcube.common.workspacetaskexecutor.shared.ItemNotExecutable;
/**
* The Interface DoExcecutorTask.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Apr 26, 2018
* @param <O> the generic type
*/
public interface ExecutableTask<O> {
/**
* Do run.
*
* @param itemId the item id
* @return the o
* @throws ItemNotExecutable the item not executable
* @throws Exception the exception
*/
O doRun(String itemId) throws ItemNotExecutable, Exception;
/**
* Stop run.
*
* @param itemId the item id
* @return the boolean
* @throws ItemNotExecutable the item not executable
* @throws Exception the exception
*/
Boolean stopRun(String itemId) throws ItemNotExecutable, Exception;
/**
* Monitor run status.
*
* @param itemId the item id
* @return the o
* @throws ItemNotExecutable the item not executable
* @throws Exception the exception
*/
O monitorRunStatus(String itemId) throws ItemNotExecutable, Exception;
/**
* Register callback for id.
*
* @param itemId the item id
* @throws Exception the exception
*/
void registerCallbackForId(String itemId) throws Exception;
}

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='workspacetaskexecutor'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<!-- Specify the paths for translatable code -->
<source path='client' />
<source path='shared' />
</module>

View File

@ -0,0 +1,32 @@
package org.gcube.common.workspacetaskexecutor.shared;
// TODO: Auto-generated Javadoc
/**
* The Class ItemNotSynched.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Feb 8, 2018
*/
public class ItemNotExecutable extends Exception {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 3965350221961538838L;
/**
* Instantiates a new item not synched.
*/
public ItemNotExecutable() {
super();
}
/**
* Instantiates a new item not synched.
*
* @param arg0 the arg 0
*/
public ItemNotExecutable(String arg0) {
super(arg0);
}
}

View File

@ -0,0 +1,47 @@
/**
*
*/
package org.gcube.common.workspacetaskexecutor.shared;
import java.util.Map;
/**
* The Interface DoTaskConfiguration.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Apr 26, 2018
*/
public interface TaskConfiguration {
/**
* Gets the task id.
*
* @return the task id
*/
String getTaskId();
/**
* Gets the item id.
*
* @return the item id
*/
String getItemId();
/**
* Gets the task description.
*
* @return the task description
*/
String getTaskDescription();
/**
* Gets the map parameters.
*
* @return the map parameters
*/
Map<String, String> getMapParameters();
}

View File

@ -0,0 +1,45 @@
package org.gcube.common.workspacetaskexecutor.shared;
/**
* The Class WorkspaceFolderLocked.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Mar 13, 2018
*/
public class WorkspaceFolderLocked extends Exception {
/**
*
*/
private static final long serialVersionUID = -778037901117579435L;
private String folderId;
/**
* Instantiates a new item not synched.
*/
public WorkspaceFolderLocked() {
super();
}
/**
* Instantiates a new item not synched.
*
* @param arg0 the arg 0
*/
public WorkspaceFolderLocked(String folderId, String arg0) {
super(arg0);
this.folderId = folderId;
}
/**
* @return the folderId
*/
public String getFolderId() {
return folderId;
}
}