2017-02-01 17:01:15 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
package org.gcube.vremanagement.executor.scheduledtask;
|
|
|
|
|
2017-02-10 16:57:10 +01:00
|
|
|
import java.util.Collection;
|
2017-02-01 17:01:15 +01:00
|
|
|
import java.util.List;
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
import org.gcube.vremanagement.executor.exception.SchedulePersistenceException;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Luca Frosini (ISTI - CNR)
|
|
|
|
*/
|
|
|
|
public interface ScheduledTaskPersistence {
|
2019-09-24 14:59:25 +02:00
|
|
|
|
2017-02-01 17:01:15 +01:00
|
|
|
/**
|
|
|
|
* Retrieve from the #SmartExecutorPersistenceConnector the orphaned
|
|
|
|
* Scheduled tasks
|
2020-09-30 11:19:49 +02:00
|
|
|
* @param plugins
|
2017-02-01 17:01:15 +01:00
|
|
|
* @return the list of orphaned Scheduled
|
|
|
|
* @throws SchedulePersistenceException
|
|
|
|
* if fails
|
|
|
|
*/
|
2021-05-27 09:28:36 +02:00
|
|
|
public List<ScheduledTask> getScheduledTasks(Collection<String> plugins)
|
2017-02-01 17:01:15 +01:00
|
|
|
throws SchedulePersistenceException;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the Scheduled Task if any, null otherwise
|
|
|
|
*
|
|
|
|
* @param uuid
|
|
|
|
* which identify the Scheduled Task
|
|
|
|
* @return LaunchParameter of the Scheduled task if any, null otherwise
|
|
|
|
* @throws SchedulePersistenceException
|
|
|
|
* if fails
|
|
|
|
*/
|
|
|
|
public ScheduledTask getScheduledTask(UUID uuid)
|
|
|
|
throws SchedulePersistenceException;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a Scheduled Task on persistence
|
|
|
|
*
|
2017-10-27 14:07:42 +02:00
|
|
|
* @param scheduledTask to create on persistence
|
2017-02-01 17:01:15 +01:00
|
|
|
* @throws SchedulePersistenceException
|
|
|
|
* if fails
|
|
|
|
*/
|
|
|
|
public void addScheduledTask(ScheduledTask scheduledTask)
|
|
|
|
throws SchedulePersistenceException;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Release the Scheduled Task leaving it as orphan on persistence
|
|
|
|
*
|
|
|
|
* @param uuid
|
|
|
|
* the uuid which (will) identify the task on the SmartExecutor
|
|
|
|
* instance
|
|
|
|
* @throws SchedulePersistenceException
|
|
|
|
*/
|
|
|
|
public void releaseScheduledTask(UUID uuid)
|
|
|
|
throws SchedulePersistenceException;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove from persistence the Scheduled Task.
|
|
|
|
*
|
|
|
|
* @param scheduledTask
|
|
|
|
* @throws SchedulePersistenceException
|
|
|
|
*/
|
|
|
|
public void removeScheduledTask(ScheduledTask scheduledTask)
|
|
|
|
throws SchedulePersistenceException;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove from persistence the Scheduled Task.
|
|
|
|
*
|
|
|
|
* @param uuid
|
|
|
|
* the uuid which (will) identify the task on the SmartExecutor
|
|
|
|
* instance
|
|
|
|
* @throws SchedulePersistenceException
|
|
|
|
*/
|
|
|
|
public void removeScheduledTask(UUID uuid)
|
|
|
|
throws SchedulePersistenceException;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Release the Scheduled Task leaving it as orphan on persistence
|
|
|
|
*
|
|
|
|
* @param scheduledTask
|
|
|
|
* @throws SchedulePersistenceException
|
|
|
|
*/
|
|
|
|
public void releaseScheduledTask(ScheduledTask scheduledTask)
|
|
|
|
throws SchedulePersistenceException;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reserve an orphan Scheduled tasks
|
|
|
|
*
|
|
|
|
* @param scheduledTask
|
|
|
|
* @throws SchedulePersistenceException
|
|
|
|
* if fails
|
|
|
|
*/
|
|
|
|
public void reserveScheduledTask(ScheduledTask scheduledTask)
|
|
|
|
throws SchedulePersistenceException;
|
|
|
|
}
|