Class OrientDBPersistenceConnector
- java.lang.Object
-
- org.gcube.vremanagement.executor.plugin.PluginStateNotification
-
- org.gcube.vremanagement.executor.persistence.SmartExecutorPersistenceConnector
-
- org.gcube.vremanagement.executor.persistence.orientdb.OrientDBPersistenceConnector
-
- All Implemented Interfaces:
ScheduledTaskPersistence
public class OrientDBPersistenceConnector extends SmartExecutorPersistenceConnector
- Author:
- Luca Frosini (ISTI - CNR)
-
-
Constructor Summary
Constructors Constructor Description OrientDBPersistenceConnector(SmartExecutorPersistenceConfiguration configuration)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddScheduledTask(ScheduledTask scheduledTask)Create a Scheduled Task on persistencevoidclose()Close the connection to DBorg.gcube.vremanagement.executor.plugin.PluginStateEvolutiongetPluginInstanceState(UUID uuid, Integer iterationNumber)Retrieve the status of the iterationNumber (passed as parameter) of a running/runPluginwhich is/was identified by the UUID passed as parameterScheduledTaskgetScheduledTask(UUID uuid)Return the Scheduled Task if any, null otherwiseprotected com.orientechnologies.orient.core.record.impl.ODocumentgetScheduledTaskDocument(UUID uuid)List<ScheduledTask>getScheduledTasks(Collection<String> plugins)Retrieve from the #SmartExecutorPersistenceConnector the orphaned Scheduled tasksvoidpluginStateEvolution(org.gcube.vremanagement.executor.plugin.PluginStateEvolution pluginStateEvolution, Exception exception)protected voidprepareConnection(SmartExecutorPersistenceConfiguration configuration)voidreleaseScheduledTask(UUID uuid)Release the Scheduled Task leaving it as orphan on persistencevoidreleaseScheduledTask(ScheduledTask scheduledTask)Release the Scheduled Task leaving it as orphan on persistencevoidremoveScheduledTask(UUID uuid)Remove from persistence the Scheduled Task.voidremoveScheduledTask(ScheduledTask scheduledTask)Remove from persistence the Scheduled Task.voidreserveScheduledTask(ScheduledTask scheduledTask)Reserve an orphan Scheduled tasksstatic voidshutdown()-
Methods inherited from class org.gcube.vremanagement.executor.persistence.SmartExecutorPersistenceConnector
isOrphan
-
-
-
-
Field Detail
-
CONTEXT
protected static final String CONTEXT
- See Also:
- Constant Field Values
-
UUID
protected static final String UUID
- See Also:
- Constant Field Values
-
ITERATION
protected static final String ITERATION
- See Also:
- Constant Field Values
-
TIMESTAMP
protected static final String TIMESTAMP
- See Also:
- Constant Field Values
-
RUN_ON
protected final String RUN_ON
- See Also:
- Constant Field Values
-
oDatabasePool
protected com.orientechnologies.orient.core.db.ODatabasePool oDatabasePool
-
-
Constructor Detail
-
OrientDBPersistenceConnector
public OrientDBPersistenceConnector(SmartExecutorPersistenceConfiguration configuration) throws Exception
- Throws:
Exception
-
-
Method Detail
-
prepareConnection
protected void prepareConnection(SmartExecutorPersistenceConfiguration configuration) throws Exception
- Throws:
Exception
-
close
public void close() throws ExceptionDescription copied from class:SmartExecutorPersistenceConnectorClose the connection to DB- Specified by:
closein classSmartExecutorPersistenceConnector- Throws:
Exception- if fails
-
getPluginInstanceState
public org.gcube.vremanagement.executor.plugin.PluginStateEvolution getPluginInstanceState(UUID uuid, Integer iterationNumber) throws org.gcube.vremanagement.executor.exception.PluginInstanceNotFoundException, org.gcube.vremanagement.executor.exception.ExecutorException
Description copied from class:SmartExecutorPersistenceConnectorRetrieve the status of the iterationNumber (passed as parameter) of a running/runPluginwhich is/was identified by the UUID passed as parameter- Specified by:
getPluginInstanceStatein classSmartExecutorPersistenceConnector- Parameters:
uuid- the execution identifier of the running/runPluginiterationNumber- the iterationNumber (null to get the last)- Returns:
- the actual/last
PluginStateof the Plugin - Throws:
org.gcube.vremanagement.executor.exception.PluginInstanceNotFoundExceptionorg.gcube.vremanagement.executor.exception.ExecutorException
-
pluginStateEvolution
public void pluginStateEvolution(org.gcube.vremanagement.executor.plugin.PluginStateEvolution pluginStateEvolution, Exception exception) throws Exception- Specified by:
pluginStateEvolutionin classorg.gcube.vremanagement.executor.plugin.PluginStateNotification- Throws:
Exception
-
addScheduledTask
public void addScheduledTask(ScheduledTask scheduledTask) throws SchedulePersistenceException
Description copied from interface:ScheduledTaskPersistenceCreate a Scheduled Task on persistence- Parameters:
scheduledTask- to create on persistence- Throws:
SchedulePersistenceException- if fails
-
getScheduledTasks
public List<ScheduledTask> getScheduledTasks(Collection<String> plugins) throws SchedulePersistenceException
Description copied from interface:ScheduledTaskPersistenceRetrieve from the #SmartExecutorPersistenceConnector the orphaned Scheduled tasks- Returns:
- the list of orphaned Scheduled
- Throws:
SchedulePersistenceException- if fails
-
getScheduledTaskDocument
protected com.orientechnologies.orient.core.record.impl.ODocument getScheduledTaskDocument(UUID uuid) throws SchedulePersistenceException
- Throws:
SchedulePersistenceException
-
getScheduledTask
public ScheduledTask getScheduledTask(UUID uuid) throws SchedulePersistenceException
Description copied from interface:ScheduledTaskPersistenceReturn the Scheduled Task if any, null otherwise- Parameters:
uuid- which identify the Scheduled Task- Returns:
- LaunchParameter of the Scheduled task if any, null otherwise
- Throws:
SchedulePersistenceException- if fails
-
reserveScheduledTask
public void reserveScheduledTask(ScheduledTask scheduledTask) throws SchedulePersistenceException
Description copied from interface:ScheduledTaskPersistenceReserve an orphan Scheduled tasks- Throws:
SchedulePersistenceException- if fails
-
removeScheduledTask
public void removeScheduledTask(UUID uuid) throws SchedulePersistenceException
Description copied from interface:ScheduledTaskPersistenceRemove from persistence the Scheduled Task.- Parameters:
uuid- the uuid which (will) identify the task on the SmartExecutor instance- Throws:
SchedulePersistenceException
-
removeScheduledTask
public void removeScheduledTask(ScheduledTask scheduledTask) throws SchedulePersistenceException
Description copied from interface:ScheduledTaskPersistenceRemove from persistence the Scheduled Task.- Throws:
SchedulePersistenceException
-
releaseScheduledTask
public void releaseScheduledTask(UUID uuid) throws SchedulePersistenceException
Description copied from interface:ScheduledTaskPersistenceRelease the Scheduled Task leaving it as orphan on persistence- Parameters:
uuid- the uuid which (will) identify the task on the SmartExecutor instance- Throws:
SchedulePersistenceException
-
releaseScheduledTask
public void releaseScheduledTask(ScheduledTask scheduledTask) throws SchedulePersistenceException
Description copied from interface:ScheduledTaskPersistenceRelease the Scheduled Task leaving it as orphan on persistence- Throws:
SchedulePersistenceException
-
shutdown
public static void shutdown()
-
-