public abstract class AProcessHandler extends JsonRequestHandler
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AProcessHandler.EmptyQueryException
special exception to denote empty queries ( -> BAD_REQUEST, not SERVER_ERROR).
|
FACTORY, HEADER_REQUEST_HOST, HTTP_UTILS| Constructor and Description |
|---|
AProcessHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract java.lang.String[] |
doProcess(java.lang.String elementName,
Blackboard blackboard,
java.lang.String[] strings) |
protected void |
ensureQueryId(java.lang.String pipeletName,
Record query)
ensure that the query object has a Id set.
|
protected java.lang.String |
getElementName(java.lang.String requestUri)
get name of processing element to use.
|
protected int |
getErrorStatus(java.lang.String method,
java.lang.String requestUri,
java.lang.Throwable ex)
Return a status code for an exception.
|
protected boolean |
isValidMethod(java.lang.String method,
java.lang.String requestUri)
Checks if the handler allows the HTTP method.
|
java.lang.Object |
process(java.lang.String method,
java.lang.String requestUri,
Record inputRecord)
process input record and return result object.
|
void |
setBlackboardFactory(BlackboardFactory factory)
set blackboard factory reference (used by DS).
|
void |
unsetBlackboardFactory(BlackboardFactory factory)
remove blackboard factory reference (used by DS).
|
getRequestHost, getSuccessStatus, getSuccessStatus, handle, process, writeErrorResult, writeResultObject, writeSuccessResultactivate, getDynamicUriParts, getRootContextPath, getStaticUriParts, getUriPattern, matches, urlDecodepublic java.lang.Object process(java.lang.String method,
java.lang.String requestUri,
Record inputRecord)
throws java.lang.Exception
process in class JsonRequestHandlermethod - HTTP methodrequestUri - request URI.inputRecord - input record parsed either from request body, if it has content, or from request URI parameters.Record, you have to provide a
JsonRequestHandler.writeResultObject(OutputStream, Object) method, too.java.lang.Exception - any failure during processing.protected abstract java.lang.String[] doProcess(java.lang.String elementName,
Blackboard blackboard,
java.lang.String[] strings)
throws BlackboardAccessException,
ProcessingException
protected java.lang.String getElementName(java.lang.String requestUri)
public void setBlackboardFactory(BlackboardFactory factory)
public void unsetBlackboardFactory(BlackboardFactory factory)
protected boolean isValidMethod(java.lang.String method,
java.lang.String requestUri)
isValidMethod in class JsonRequestHandlermethod - HTTP methodrequestUri - request URIprotected int getErrorStatus(java.lang.String method,
java.lang.String requestUri,
java.lang.Throwable ex)
getErrorStatus in class JsonRequestHandlerHTTP_UTILS#getErrorStatus(String, String, Throwable)protected void ensureQueryId(java.lang.String pipeletName,
Record query)
UUID as key.pipeletName - pipeline namequery - query record.