SMILA (incubation) API documentation

org.eclipse.smila.bulkbuilder.httphandler
Class BulkbuilderBurstHandler

java.lang.Object
  extended by org.eclipse.smila.http.server.util.ARequestHandler
      extended by org.eclipse.smila.http.server.json.JsonBulkRequestHandler
          extended by org.eclipse.smila.bulkbuilder.httphandler.BulkbuilderBurstHandler
All Implemented Interfaces:
HttpHandler, RequestHandler

public class BulkbuilderBurstHandler
extends JsonBulkRequestHandler

Implements the processing of HTTP requests for the bulk processing.


Field Summary
static java.lang.String KEY_WORKFLOW_RUNS
          The key for the workflows in the result.
 
Fields inherited from class org.eclipse.smila.http.server.json.JsonBulkRequestHandler
FACTORY
 
Constructor Summary
BulkbuilderBurstHandler()
           
 
Method Summary
 void end(java.lang.String method, java.lang.String requestUri)
          Called after processing and finishing is done.
 java.lang.Object finish(java.lang.String method, java.lang.String requestUri)
          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.
 void process(java.lang.String method, java.lang.String requestUri, Record inputRecord)
          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)
          Called before processing.
 void unsetBulkbuilderService(BulkbuilderService service)
          Unset the bulk builder.
 
Methods inherited from class org.eclipse.smila.http.server.json.JsonBulkRequestHandler
getRequestHost, getSuccessStatus, handle, isValidMethod, writeErrorResult, writeResultObject, writeSuccessResult
 
Methods inherited from class org.eclipse.smila.http.server.util.ARequestHandler
activate, getDynamicUriParts, getRootContextPath, getStaticUriParts, getUriPattern, matches, urlDecode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_WORKFLOW_RUNS

public static final java.lang.String KEY_WORKFLOW_RUNS
The key for the workflows in the result.

See Also:
Constant Field Values
Constructor Detail

BulkbuilderBurstHandler

public BulkbuilderBurstHandler()
Method Detail

start

public void start(java.lang.String method,
                  java.lang.String requestUri)
           throws java.lang.Exception
Called before processing.

Specified by:
start in class JsonBulkRequestHandler
Parameters:
method - the request method.
requestUri - the request URI.
Throws:
java.lang.Exception - any failure during processing.

process

public void process(java.lang.String method,
                    java.lang.String requestUri,
                    Record inputRecord)
             throws java.lang.Exception
process input record and return result record.

Specified by:
process in class JsonBulkRequestHandler
Parameters:
method - the HTTP method of this request.
requestUri - the request URI
inputRecord - input Record, may be null
Throws:
java.lang.Exception - any failure during processing.

finish

public java.lang.Object finish(java.lang.String method,
                               java.lang.String requestUri)
                        throws java.lang.Exception
Called after the complete input bulk has been processed successfully.

Specified by:
finish in class JsonBulkRequestHandler
Parameters:
method - the request method.
requestUri - the request URI.
Returns:
result object, may be null.
Throws:
java.lang.Exception - any failure during finishing.

end

public void end(java.lang.String method,
                java.lang.String requestUri)
         throws java.lang.Exception
Called after processing and finishing is done. This method can be used to clean up resources.

Specified by:
end in class JsonBulkRequestHandler
Parameters:
method - the request method.
requestUri - the request URI.
Throws:
java.lang.Exception

getErrorStatus

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.

Overrides:
getErrorStatus in class JsonBulkRequestHandler
Returns:
HTTP error code matching the exception type.
See Also:
JsonHttpUtils.getErrorStatus(Throwable)

setBulkbuilderService

public void setBulkbuilderService(BulkbuilderService service)
Sets the bulk builder.

Parameters:
service - the new BulkBuilder

unsetBulkbuilderService

public void unsetBulkbuilderService(BulkbuilderService service)
Unset the bulk builder.

Parameters:
service - the BulkBuilder to unset

SMILA (incubation) API documentation