public abstract class AbstractTask extends java.lang.Object implements Task
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
adhocQuery |
protected com.marklogic.xcc.ContentSource |
cs |
protected static int |
DEFAULT_CONNECTION_RETRY_INTERVAL |
protected static int |
DEFAULT_CONNECTION_RETRY_LIMIT |
protected static int |
DEFAULT_QUERY_RETRY_INTERVAL |
protected static int |
DEFAULT_QUERY_RETRY_LIMIT |
protected java.lang.String |
exportDir |
protected boolean |
failOnError |
protected static java.lang.String |
FALSE |
protected java.lang.String[] |
inputUris |
protected java.lang.String |
language |
protected static java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
MODULE_PROPS |
protected java.lang.String |
moduleType |
protected java.lang.String |
moduleUri |
protected static byte[] |
NEWLINE |
protected java.util.Properties |
properties |
protected int |
retryCount |
protected static java.lang.String |
TRUE |
Constructor and Description |
---|
AbstractTask() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
asString(java.lang.String[] uris) |
java.lang.String[] |
call() |
protected void |
cleanup() |
java.lang.String |
getExportDir() |
protected int |
getIntProperty(java.lang.String key)
Retrieves an int value.
|
java.lang.String |
getProperty(java.lang.String key) |
protected byte[] |
getValueAsBytes(com.marklogic.xcc.types.XdmItem item) |
protected java.lang.String[] |
handleRequestException(com.marklogic.xcc.exceptions.RequestException requestException) |
protected boolean |
hasRetryableMessage(com.marklogic.xcc.exceptions.RequestException requestException) |
protected java.lang.String[] |
invokeModule() |
com.marklogic.xcc.Session |
newSession() |
protected abstract java.lang.String |
processResult(com.marklogic.xcc.ResultSequence seq) |
void |
setAdhocQuery(java.lang.String adhocQuery) |
void |
setContentSource(com.marklogic.xcc.ContentSource cs) |
void |
setExportDir(java.lang.String exportFileDir) |
void |
setFailOnError(boolean failOnError) |
void |
setInputURI(java.lang.String[] inputUri) |
void |
setModuleType(java.lang.String moduleType)
XQUERY-MODULE,PRE-BATCH-MODULE,POST-BATCH-MODULE,INIT-MODULE
|
void |
setModuleURI(java.lang.String moduleUri) |
void |
setProperties(java.util.Properties properties)
If additional data is sent from CUSTOM URI module, it is available in
properties with key URIS_BATCH_REF
|
void |
setQueryLanguage(java.lang.String language) |
protected boolean |
shouldRetry(com.marklogic.xcc.exceptions.QueryException queryException) |
protected boolean |
shouldRetry(com.marklogic.xcc.exceptions.RequestException requestException) |
protected boolean |
shouldRetry(com.marklogic.xcc.exceptions.RequestPermissionException requestPermissionException) |
protected static final java.lang.String TRUE
protected static final java.lang.String FALSE
protected static final byte[] NEWLINE
protected com.marklogic.xcc.ContentSource cs
protected java.lang.String moduleType
protected java.lang.String moduleUri
protected java.util.Properties properties
protected java.lang.String[] inputUris
protected java.lang.String adhocQuery
protected java.lang.String language
protected java.lang.String exportDir
protected static final java.util.Map<java.lang.String,java.util.Set<java.lang.String>> MODULE_PROPS
protected static final int DEFAULT_CONNECTION_RETRY_LIMIT
protected static final int DEFAULT_CONNECTION_RETRY_INTERVAL
protected static final int DEFAULT_QUERY_RETRY_LIMIT
protected static final int DEFAULT_QUERY_RETRY_INTERVAL
protected int retryCount
protected boolean failOnError
public void setContentSource(com.marklogic.xcc.ContentSource cs)
setContentSource
in interface Task
public void setModuleType(java.lang.String moduleType)
Task
setModuleType
in interface Task
public void setModuleURI(java.lang.String moduleUri)
setModuleURI
in interface Task
public void setAdhocQuery(java.lang.String adhocQuery)
setAdhocQuery
in interface Task
public void setQueryLanguage(java.lang.String language)
setQueryLanguage
in interface Task
public void setProperties(java.util.Properties properties)
Task
setProperties
in interface Task
public void setInputURI(java.lang.String[] inputUri)
setInputURI
in interface Task
public void setFailOnError(boolean failOnError)
setFailOnError
in interface Task
public void setExportDir(java.lang.String exportFileDir)
setExportDir
in interface Task
public java.lang.String getExportDir()
public com.marklogic.xcc.Session newSession()
public java.lang.String[] call() throws java.lang.Exception
call
in interface java.util.concurrent.Callable<java.lang.String[]>
java.lang.Exception
protected java.lang.String[] invokeModule() throws CorbException
CorbException
protected boolean shouldRetry(com.marklogic.xcc.exceptions.RequestException requestException)
protected boolean hasRetryableMessage(com.marklogic.xcc.exceptions.RequestException requestException)
protected boolean shouldRetry(com.marklogic.xcc.exceptions.QueryException queryException)
protected boolean shouldRetry(com.marklogic.xcc.exceptions.RequestPermissionException requestPermissionException)
protected java.lang.String[] handleRequestException(com.marklogic.xcc.exceptions.RequestException requestException) throws CorbException
CorbException
protected java.lang.String asString(java.lang.String[] uris)
protected abstract java.lang.String processResult(com.marklogic.xcc.ResultSequence seq) throws CorbException
CorbException
protected void cleanup()
public java.lang.String getProperty(java.lang.String key)
protected byte[] getValueAsBytes(com.marklogic.xcc.types.XdmItem item)
protected int getIntProperty(java.lang.String key)
key
- The key name.-1
if not found or could not
parse value as int).