public class FileScheduledTaskConfiguration extends Object implements ScheduledTaskConfiguration
| Modifier and Type | Field and Description |
|---|---|
static String |
CONFIG_TASK_FILENAME |
protected String |
configurationFileLocation |
protected List<org.gcube.vremanagement.executor.api.types.LaunchParameter> |
configuredTasks |
SCOPE| Constructor and Description |
|---|
FileScheduledTaskConfiguration() |
FileScheduledTaskConfiguration(String location) |
| Modifier and Type | Method and Description |
|---|---|
void |
addLaunch(JSONLaunchParameter parameter) |
void |
addScheduledTask(UUID uuid,
String consumerID,
org.gcube.vremanagement.executor.api.types.LaunchParameter parameter)
Create a Scheduled Task on persistence
|
protected static String |
configurationFileName(String configurationFileLocation) |
protected void |
emptyConfigurationFile(String fileName) |
List<org.gcube.vremanagement.executor.api.types.LaunchParameter> |
getAvailableScheduledTasks()
Retrieve from the #SmartExecutorPersistenceConnector the orphaned
Scheduled tasks
|
List<org.gcube.vremanagement.executor.api.types.LaunchParameter> |
getConfiguredTasks() |
org.gcube.vremanagement.executor.api.types.LaunchParameter |
getScheduledTask(UUID uuid)
Return the Scheduled Task if any, null otherwise
|
protected org.gcube.vremanagement.executor.api.types.Scheduling |
getScheduling(org.json.JSONObject jsonObject) |
void |
releaseLaunch(org.gcube.vremanagement.executor.api.types.LaunchParameter parameter) |
void |
releaseScheduledTask(UUID uuid)
Release the Scheduled Task leaving it as orphan on persistence
|
protected void |
removeLaunch(JSONLaunchParameter parameter) |
void |
removeScheduledTask(UUID uuid)
Remove from persistence the Scheduled Task.
|
void |
reserveScheduledTask(UUID uuid,
String consumerID)
Reserve an orphan Scheduled tasks
|
List<org.gcube.vremanagement.executor.api.types.LaunchParameter> |
retriveConfiguredTask() |
void |
setConfiguredTasks(List<org.gcube.vremanagement.executor.api.types.LaunchParameter> configuredTasks) |
protected void |
writeOnConfigurationFile() |
protected String configurationFileLocation
protected List<org.gcube.vremanagement.executor.api.types.LaunchParameter> configuredTasks
public static final String CONFIG_TASK_FILENAME
public FileScheduledTaskConfiguration()
throws Exception
Exceptionpublic FileScheduledTaskConfiguration(String location) throws IOException, org.json.JSONException
IOExceptionorg.json.JSONExceptionprotected org.gcube.vremanagement.executor.api.types.Scheduling getScheduling(org.json.JSONObject jsonObject)
throws org.json.JSONException,
ParseException,
ScopeNotMatchException
org.json.JSONExceptionParseExceptionScopeNotMatchExceptionprotected static String configurationFileName(String configurationFileLocation)
public List<org.gcube.vremanagement.executor.api.types.LaunchParameter> retriveConfiguredTask() throws IOException, org.json.JSONException
IOExceptionorg.json.JSONExceptionprotected void emptyConfigurationFile(String fileName) throws FileNotFoundException
FileNotFoundExceptionprotected void writeOnConfigurationFile()
throws org.json.JSONException,
IOException,
ParseException
org.json.JSONExceptionIOExceptionParseExceptionpublic void addScheduledTask(UUID uuid, String consumerID, org.gcube.vremanagement.executor.api.types.LaunchParameter parameter) throws SchedulePersistenceException
ScheduledTaskConfigurationaddScheduledTask in interface ScheduledTaskConfigurationuuid - the uuid which (will) identify the task on the SmartExecutor instanceSchedulePersistenceException - if failspublic void addLaunch(JSONLaunchParameter parameter) throws SchedulePersistenceException
SchedulePersistenceExceptionpublic void releaseLaunch(org.gcube.vremanagement.executor.api.types.LaunchParameter parameter)
throws SchedulePersistenceException
SchedulePersistenceExceptionprotected void removeLaunch(JSONLaunchParameter parameter) throws ParseException, org.json.JSONException, IOException
ParseExceptionorg.json.JSONExceptionIOExceptionpublic List<org.gcube.vremanagement.executor.api.types.LaunchParameter> getConfiguredTasks()
public void setConfiguredTasks(List<org.gcube.vremanagement.executor.api.types.LaunchParameter> configuredTasks)
configuredTasks - the configuredTasks to setpublic List<org.gcube.vremanagement.executor.api.types.LaunchParameter> getAvailableScheduledTasks() throws SchedulePersistenceException
getAvailableScheduledTasks in interface ScheduledTaskConfigurationSchedulePersistenceException - if failspublic void reserveScheduledTask(UUID uuid, String consumerID) throws SchedulePersistenceException
reserveScheduledTask in interface ScheduledTaskConfigurationuuid - the uuid which (will) identify the task on the SmartExecutor instanceSchedulePersistenceException - if failspublic void removeScheduledTask(UUID uuid) throws SchedulePersistenceException
removeScheduledTask in interface ScheduledTaskConfigurationuuid - the uuid which (will) identify the task on the SmartExecutor instanceSchedulePersistenceExceptionpublic void releaseScheduledTask(UUID uuid) throws SchedulePersistenceException
releaseScheduledTask in interface ScheduledTaskConfigurationuuid - the uuid which (will) identify the task on the SmartExecutor
instanceSchedulePersistenceExceptionpublic org.gcube.vremanagement.executor.api.types.LaunchParameter getScheduledTask(UUID uuid) throws SchedulePersistenceException
ScheduledTaskConfigurationgetScheduledTask in interface ScheduledTaskConfigurationuuid - which identify the Scheduled TaskSchedulePersistenceException - if failsCopyright © 2016. All Rights Reserved.