public class BulkbuilderBurstHandler extends JsonBulkRequestHandler
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,java.lang.Boolean> |
_microBulkHasData
mark if records where actually pushed for a bulk.
|
protected java.lang.ThreadLocal<java.lang.String> |
_microBulkId
The micro bulk id.
|
protected BulkbuilderService |
_service
Reference to the BulkBuilder.
|
protected java.lang.ThreadLocal<java.util.Collection<WorkflowRunInfo>> |
_workflowRunDataToReturn
The collected workflow run data data to return when calling finish.
|
static java.lang.String |
KEY_WORKFLOW_RUNS
The key for the workflows in the result.
|
FACTORY, HTTP_UTILS| Constructor and Description |
|---|
BulkbuilderBurstHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendIntermediateWorkflowRunInfo(WorkflowRunInfo workflowRunInfo)
appends the workflow run info to the list if the workflow run id has not already been set.
|
protected java.lang.Object |
createResultObject(java.util.Collection<WorkflowRunInfo> workflowInfos)
convert collected WorkflowRunInfos to Any.
|
void |
end(java.lang.String method,
java.lang.String requestUri,
HttpExchange exchange)
Called after processing and finishing is done.
|
java.lang.Object |
finish(java.lang.String method,
java.lang.String requestUri,
HttpExchange exchange)
Called after the complete input bulk has been processed successfully.
|
protected int |
getErrorStatus(java.lang.String method,
java.lang.String requestUri,
java.lang.Throwable ex)
Gets the HTTP error status code depending on the method, request URI and throwable.
|
protected java.lang.String |
getJobName(java.lang.String requestUri)
Extracts the job name from the requestURI.
|
void |
process(java.lang.String method,
java.lang.String requestUri,
Record inputRecord,
HttpExchange exchange)
process input record and return result record.
|
void |
setBulkbuilderService(BulkbuilderService service)
Sets the bulk builder.
|
void |
start(java.lang.String method,
java.lang.String requestUri,
HttpExchange exchange)
Called before processing.
|
void |
unsetBulkbuilderService(BulkbuilderService service)
Unset the bulk builder.
|
getRequestHost, getSuccessStatus, handle, isValidMethod, writeErrorResult, writeResultObject, writeSuccessResultactivate, getDynamicUriParts, getRootContextPath, getStaticUriParts, getUriPattern, matches, urlDecodepublic static final java.lang.String KEY_WORKFLOW_RUNS
protected final java.lang.ThreadLocal<java.util.Collection<WorkflowRunInfo>> _workflowRunDataToReturn
protected final java.lang.ThreadLocal<java.lang.String> _microBulkId
protected final java.util.Map<java.lang.String,java.lang.Boolean> _microBulkHasData
protected BulkbuilderService _service
public void start(java.lang.String method,
java.lang.String requestUri,
HttpExchange exchange)
throws java.lang.Exception
start in class JsonBulkRequestHandlermethod - the request method.requestUri - the request URI.exchange - http exchange object, contains e.g. the http header fieldsjava.lang.Exception - any failure during processing.public void process(java.lang.String method,
java.lang.String requestUri,
Record inputRecord,
HttpExchange exchange)
throws java.lang.Exception
process in class JsonBulkRequestHandlermethod - the HTTP method of this request.requestUri - the request URIinputRecord - input Record, may be nullexchange - http exchange object, contains e.g. the http header fieldsjava.lang.Exception - any failure during processing.public java.lang.Object finish(java.lang.String method,
java.lang.String requestUri,
HttpExchange exchange)
throws java.lang.Exception
finish in class JsonBulkRequestHandlermethod - the request method.requestUri - the request URI.exchange - http exchange object, contains e.g. the http header fieldsjava.lang.Exception - any failure during finishing.protected java.lang.Object createResultObject(java.util.Collection<WorkflowRunInfo> workflowInfos) throws java.net.MalformedURLException
java.net.MalformedURLExceptionpublic void end(java.lang.String method,
java.lang.String requestUri,
HttpExchange exchange)
throws java.lang.Exception
end in class JsonBulkRequestHandlermethod - the request method.requestUri - the request URI.exchange - http exchange object, contains e.g. the http header fieldsjava.lang.Exceptionprotected void appendIntermediateWorkflowRunInfo(WorkflowRunInfo workflowRunInfo)
workflowRunInfo - protected java.lang.String getJobName(java.lang.String requestUri)
requestUri - the request URIprotected int getErrorStatus(java.lang.String method,
java.lang.String requestUri,
java.lang.Throwable ex)
getErrorStatus in class JsonBulkRequestHandlerHTTP_UTILS#getErrorStatus(Throwable)public void setBulkbuilderService(BulkbuilderService service)
service - the new BulkBuilderpublic void unsetBulkbuilderService(BulkbuilderService service)
service - the BulkBuilder to unset