public class CouchDBPersistenceConnector extends SmartExecutorPersistenceConnector implements ScheduledTaskConfiguration
| Modifier and Type | Field and Description |
|---|---|
protected static String |
_ID_JSON_FIELD |
protected static String |
_REV_JSON_FIELD |
protected static String |
ACTIVE_VIEW |
protected org.ektorp.CouchDbConnector |
couchDbConnector |
protected org.ektorp.CouchDbInstance |
couchDbInstance |
protected static String |
DB_NAME |
protected static int |
LAST |
protected static String |
MAP_REDUCE__DESIGN |
protected static String |
ORPHAN_VIEW |
protected static String |
PLUGIN_STATE |
protected static String |
PLUGIN_STATE_DOCUMENT |
protected static String |
PLUGIN_STATE_VIEW_ABANDONED |
protected static String |
PREVIOUSLY_USED_BY |
protected static String |
RESERVATION_TIMESTAMP |
protected static String |
RESERVED_BY |
protected static String |
SCHEDULED_TASK_TYPE |
protected static String |
SCHEDULED_TASKS_DOCUMENT |
protected static String |
STOPPED |
protected static String |
TYPE_JSON_FIELD |
protected static String |
USED_BY_FIELD |
SCOPE| Constructor and Description |
|---|
CouchDBPersistenceConnector(SmartExecutorPersistenceConfiguration configuration) |
| Modifier and Type | Method and Description |
|---|---|
void |
addScheduledTask(UUID uuid,
String consumerID,
org.gcube.vremanagement.executor.api.types.LaunchParameter parameter)
Create a Scheduled Task on persistence
|
void |
close()
Close the connection to DB
|
protected void |
createItem(org.codehaus.jackson.JsonNode node,
String id) |
protected void |
createItem(org.json.JSONObject obj,
String id) |
protected void |
deleteItem(String id,
String revision) |
protected List<org.gcube.vremanagement.executor.api.types.LaunchParameter> |
findOrphanedScheduledTasks() |
protected void |
freeOrphanedScheduledTasks() |
List<org.gcube.vremanagement.executor.api.types.LaunchParameter> |
getAvailableScheduledTasks()
Retrieve from the #SmartExecutorPersistenceConnector the orphaned
Scheduled tasks
|
org.gcube.vremanagement.executor.plugin.PluginStateEvolution |
getLastPluginInstanceState(UUID uuid)
Deprecated.
|
protected org.json.JSONObject |
getObjectByID(String id) |
org.gcube.vremanagement.executor.plugin.PluginStateEvolution |
getPluginInstanceState(UUID uuid,
int iterationNumber)
Deprecated.
|
org.gcube.vremanagement.executor.api.types.LaunchParameter |
getScheduledTask(UUID uuid)
Return the Scheduled Task if any, null otherwise
|
protected org.ektorp.http.HttpClient |
initHttpClient(URL url,
String username,
String password) |
void |
pluginStateEvolution(org.gcube.vremanagement.executor.plugin.PluginStateEvolution pluginStateEvolution,
Exception e) |
protected void |
prepareConnection(SmartExecutorPersistenceConfiguration configuration) |
protected org.ektorp.ViewResult |
query(org.ektorp.ViewQuery query) |
protected org.gcube.vremanagement.executor.plugin.PluginStateEvolution |
reallyQuery(org.gcube.vremanagement.executor.plugin.PluginDeclaration pluginDeclaration,
UUID uuid,
int iterationNumber) |
void |
releaseScheduledTask(UUID uuid)
Release the Scheduled Task leaving it as orphan on persistence
|
void |
removeScheduledTask(UUID uuid)
Remove from persistence the Scheduled Task.
|
void |
reserveScheduledTask(UUID uuid,
String consumerID)
Reserve an orphan Scheduled tasks
|
protected void |
updateItem(org.json.JSONObject obj) |
protected org.ektorp.CouchDbInstance couchDbInstance
protected org.ektorp.CouchDbConnector couchDbConnector
protected static final String DB_NAME
protected static final String _ID_JSON_FIELD
protected static final String _REV_JSON_FIELD
protected static final String TYPE_JSON_FIELD
protected static final int LAST
protected static final String MAP_REDUCE__DESIGN
protected static final String PLUGIN_STATE_DOCUMENT
protected static final String PLUGIN_STATE
protected static final String PLUGIN_STATE_VIEW_ABANDONED
protected static final String SCHEDULED_TASKS_DOCUMENT
protected static final String ACTIVE_VIEW
protected static final String ORPHAN_VIEW
protected static final String USED_BY_FIELD
protected static final String STOPPED
protected static final String RESERVED_BY
protected static final String PREVIOUSLY_USED_BY
protected static final String RESERVATION_TIMESTAMP
protected static final String SCHEDULED_TASK_TYPE
public CouchDBPersistenceConnector(SmartExecutorPersistenceConfiguration configuration) throws Exception
Exceptionprotected org.ektorp.http.HttpClient initHttpClient(URL url, String username, String password)
protected void prepareConnection(SmartExecutorPersistenceConfiguration configuration) throws Exception
Exceptionprotected org.ektorp.ViewResult query(org.ektorp.ViewQuery query)
public void close()
throws Exception
SmartExecutorPersistenceConnectorclose in class SmartExecutorPersistenceConnectorException - if failsprotected org.json.JSONObject getObjectByID(String id) throws Exception
Exceptionprotected void createItem(org.json.JSONObject obj,
String id)
throws Exception
Exceptionprotected void createItem(org.codehaus.jackson.JsonNode node,
String id)
throws Exception
Exceptionprotected void deleteItem(String id, String revision) throws org.ektorp.UpdateConflictException, Exception
org.ektorp.UpdateConflictExceptionExceptionpublic void pluginStateEvolution(org.gcube.vremanagement.executor.plugin.PluginStateEvolution pluginStateEvolution,
Exception e)
throws Exception
pluginStateEvolution in class org.gcube.vremanagement.executor.plugin.PluginStateNotificationException@Deprecated public org.gcube.vremanagement.executor.plugin.PluginStateEvolution getPluginInstanceState(UUID uuid, int iterationNumber) throws Exception
Plugin which is/was identified
by the UUID passed as parametergetPluginInstanceState in class SmartExecutorPersistenceConnectoruuid - the execution identifier of the running/run PluginiterationNumber - thePluginState of the PluginException - if fails@Deprecated public org.gcube.vremanagement.executor.plugin.PluginStateEvolution getLastPluginInstanceState(UUID uuid) throws Exception
Plugin which is/was identified
by the UUID passed as parametergetLastPluginInstanceState in class SmartExecutorPersistenceConnectoruuid - the execution identifier of the running/run PluginPluginState of the PluginException - if failsprotected org.gcube.vremanagement.executor.plugin.PluginStateEvolution reallyQuery(org.gcube.vremanagement.executor.plugin.PluginDeclaration pluginDeclaration,
UUID uuid,
int iterationNumber)
throws Exception
uuid - iterationNumber - -1 means LASTExceptionprotected List<org.gcube.vremanagement.executor.api.types.LaunchParameter> findOrphanedScheduledTasks()
protected void freeOrphanedScheduledTasks()
public List<org.gcube.vremanagement.executor.api.types.LaunchParameter> getAvailableScheduledTasks() throws SchedulePersistenceException
getAvailableScheduledTasks in interface ScheduledTaskConfigurationSchedulePersistenceException - if failspublic void addScheduledTask(UUID uuid, String consumerID, org.gcube.vremanagement.executor.api.types.LaunchParameter parameter) throws SchedulePersistenceException
addScheduledTask in interface ScheduledTaskConfigurationuuid - the uuid which (will) identify the task on the SmartExecutor instanceSchedulePersistenceException - 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
getScheduledTask in interface ScheduledTaskConfigurationuuid - which identify the Scheduled TaskSchedulePersistenceException - if failsCopyright © 2016. All Rights Reserved.