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 |
TYPE_JSON_FIELD |
protected static String |
USED_BY_FIELD |
| 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) |
void |
close()
Close the connection to DB
|
protected void |
createItem(org.codehaus.jackson.JsonNode node,
String id) |
protected void |
createItem(String id,
org.json.JSONObject obj) |
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.PluginState |
getLastPluginInstanceState(UUID uuid)
Deprecated.
|
protected org.json.JSONObject |
getObjectByID(String id) |
org.gcube.vremanagement.executor.plugin.PluginState |
getPluginInstanceState(UUID uuid,
int iterationNumber)
Deprecated.
|
protected org.ektorp.http.HttpClient |
initHttpClient(URL url,
String username,
String password) |
void |
pluginStateEvolution(org.gcube.vremanagement.executor.plugin.PluginStateEvolution pluginStateEvolution) |
protected void |
prepareConnection(SmartExecutorPersistenceConfiguration configuration) |
protected org.ektorp.ViewResult |
query(org.ektorp.ViewQuery query) |
protected org.gcube.vremanagement.executor.plugin.PluginState |
reallyQuery(org.gcube.vremanagement.executor.plugin.PluginDeclaration pluginDeclaration,
UUID uuid,
int iterationNumber) |
void |
releaseScheduledTask(UUID uuid) |
void |
removeScheduledTask(UUID uuid) |
void |
reserveScheduledTask(UUID uuid,
String consumerID) |
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 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(String id, org.json.JSONObject obj) 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)
throws Exception
pluginStateEvolution in interface org.gcube.vremanagement.executor.plugin.PluginStateNotificationException@Deprecated public org.gcube.vremanagement.executor.plugin.PluginState 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.PluginState 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.PluginState 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 identify the task on the SmartExecutor instanceSchedulePersistenceExceptionpublic void reserveScheduledTask(UUID uuid, String consumerID) throws SchedulePersistenceException
reserveScheduledTask in interface ScheduledTaskConfigurationSchedulePersistenceExceptionpublic void removeScheduledTask(UUID uuid) throws SchedulePersistenceException
removeScheduledTask in interface ScheduledTaskConfigurationuuid - the uuid which identify the task on the SmartExecutor instanceSchedulePersistenceExceptionpublic void releaseScheduledTask(UUID uuid) throws SchedulePersistenceException
releaseScheduledTask in interface ScheduledTaskConfigurationSchedulePersistenceExceptionCopyright © 2015. All Rights Reserved.