diff --git a/src/main/java/org/gcube/common/workspacetaskexecutor/CheckableTask.java b/src/main/java/org/gcube/common/workspacetaskexecutor/CheckableTask.java new file mode 100644 index 0000000..8d306a9 --- /dev/null +++ b/src/main/java/org/gcube/common/workspacetaskexecutor/CheckableTask.java @@ -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 the generic type + */ +public interface CheckableTask { + + + /** + * 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; + +} diff --git a/src/main/java/org/gcube/common/workspacetaskexecutor/ConfigurableTask.java b/src/main/java/org/gcube/common/workspacetaskexecutor/ConfigurableTask.java new file mode 100644 index 0000000..4b62e88 --- /dev/null +++ b/src/main/java/org/gcube/common/workspacetaskexecutor/ConfigurableTask.java @@ -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; +} diff --git a/src/main/java/org/gcube/common/workspacetaskexecutor/ExecutableTask.java b/src/main/java/org/gcube/common/workspacetaskexecutor/ExecutableTask.java new file mode 100644 index 0000000..710be39 --- /dev/null +++ b/src/main/java/org/gcube/common/workspacetaskexecutor/ExecutableTask.java @@ -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 the generic type + */ +public interface ExecutableTask { + + + /** + * 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; + + +} diff --git a/src/main/java/org/gcube/common/workspacetaskexecutor/WorkspaceTaskExecutor.gwt.xml b/src/main/java/org/gcube/common/workspacetaskexecutor/WorkspaceTaskExecutor.gwt.xml new file mode 100644 index 0000000..410bc37 --- /dev/null +++ b/src/main/java/org/gcube/common/workspacetaskexecutor/WorkspaceTaskExecutor.gwt.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/main/java/org/gcube/common/workspacetaskexecutor/shared/ItemNotExecutable.java b/src/main/java/org/gcube/common/workspacetaskexecutor/shared/ItemNotExecutable.java new file mode 100644 index 0000000..e777a7e --- /dev/null +++ b/src/main/java/org/gcube/common/workspacetaskexecutor/shared/ItemNotExecutable.java @@ -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); + } + +} diff --git a/src/main/java/org/gcube/common/workspacetaskexecutor/shared/TaskConfiguration.java b/src/main/java/org/gcube/common/workspacetaskexecutor/shared/TaskConfiguration.java new file mode 100644 index 0000000..96b38c6 --- /dev/null +++ b/src/main/java/org/gcube/common/workspacetaskexecutor/shared/TaskConfiguration.java @@ -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 getMapParameters(); + + +} diff --git a/src/main/java/org/gcube/common/workspacetaskexecutor/shared/WorkspaceFolderLocked.java b/src/main/java/org/gcube/common/workspacetaskexecutor/shared/WorkspaceFolderLocked.java new file mode 100644 index 0000000..3aa9848 --- /dev/null +++ b/src/main/java/org/gcube/common/workspacetaskexecutor/shared/WorkspaceFolderLocked.java @@ -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; + } + +}