Class ActionInvoker
java.lang.Object
services.moleculer.web.router.ActionInvoker
- All Implemented Interfaces:
HttpConstants, RequestProcessor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected final CallProcessorprotected final CallProcessorprotected static final byte[]protected final services.moleculer.eventbus.Eventbusprotected final ExecutorServiceprotected final io.datatree.dom.TreeWriterprotected static final org.slf4j.Loggerprotected final ConcurrentHashMap<String, CachedMessages> protected final MessageLoaderprotected final Stringprotected final services.moleculer.context.CallOptions.Optionsprotected final Patternprotected final Routeprotected final services.moleculer.service.ServiceInvokerprotected final AbstractTemplateEngineprotected final services.moleculer.uid.UidGeneratorprotected final IndexedVariable[]Fields inherited from interface HttpConstants
ACCEPT, ACCEPT_ENCODING, AUTHORIZATION, CACHE_CONTROL, CHUNKED, CLOSE, CONNECT, CONNECTION, CONTENT_ENCODING, CONTENT_LENGTH, CONTENT_TYPE, CONTENT_TYPE_HTML, CONTENT_TYPE_JSON, COOKIE, DEFLATE, DELETE, ETAG, GET, GZIP, HEAD, IF_NONE_MATCH, KEEP_ALIVE, LOCATION, META_CONTENT_TYPE, META_HEADERS, META_LOCALE, META_LOCATION, META_SESSION, META_STATUS, META_TEMPLATE, NO_CACHE, OPTIONS, PATCH, POST, PROPERTY_COOKIES, PROPERTY_SESSION_ID, PROPERTY_USER, PUT, SET_COOKIE, TRACE, TRANSFER_ENCODING, WWW_AUTHENTICATE, X_FORWARDED_FOR -
Constructor Summary
ConstructorsConstructorDescriptionActionInvoker(String actionName, Pattern pattern, io.datatree.dom.Cache<String, Matcher> cache, IndexedVariable[] variables, services.moleculer.context.CallOptions.Options opts, services.moleculer.service.ServiceInvoker serviceInvoker, AbstractTemplateEngine templateEngine, Route route, CallProcessor beforeCall, CallProcessor afterCall, ExecutorService executor, services.moleculer.eventbus.Eventbus eventbus) -
Method Summary
Modifier and TypeMethodDescriptionReturns the next RequestProcessor in the invocation chain.protected io.datatree.TreeinsertMessages(io.datatree.Tree data, io.datatree.Tree meta) protected booleaninvokeBeforeCall(WebRequest req, WebResponse rsp, io.datatree.Tree data) protected io.datatree.TreeparsePostBody(io.datatree.Tree params, byte[] bytes, String contentType) protected voidparseQueryString(io.datatree.Tree params, String query) protected voidparseTextPlain(io.datatree.Tree params, String query) protected voidsendResponse(WebRequest req, WebResponse rsp, io.datatree.Tree data) voidservice(WebRequest req, WebResponse rsp) Handles request of the HTTP client.
-
Field Details
-
EMPTY_RESPONSE
protected static final byte[] EMPTY_RESPONSE -
logger
protected static final org.slf4j.Logger logger -
actionName
-
pattern
-
cache
-
variables
-
opts
protected final services.moleculer.context.CallOptions.Options opts -
nodeID
-
serviceInvoker
protected final services.moleculer.service.ServiceInvoker serviceInvoker -
jsonSerializer
protected final io.datatree.dom.TreeWriter jsonSerializer -
route
-
beforeCall
-
afterCall
-
executor
-
templateEngine
-
messageLoader
-
eventbus
protected final services.moleculer.eventbus.Eventbus eventbus -
uidGenerator
protected final services.moleculer.uid.UidGenerator uidGenerator -
messageCache
-
-
Constructor Details
-
ActionInvoker
public ActionInvoker(String actionName, Pattern pattern, io.datatree.dom.Cache<String, Matcher> cache, IndexedVariable[] variables, services.moleculer.context.CallOptions.Options opts, services.moleculer.service.ServiceInvoker serviceInvoker, AbstractTemplateEngine templateEngine, Route route, CallProcessor beforeCall, CallProcessor afterCall, ExecutorService executor, services.moleculer.eventbus.Eventbus eventbus)
-
-
Method Details
-
service
Handles request of the HTTP client.- Specified by:
servicein interfaceRequestProcessor- Parameters:
req- WebRequest object that contains the request the client made of the ApiGatewayrsp- WebResponse object that contains the response the ApiGateway returns to the client- Throws:
Exception- if an input or output error occurs while the ApiGateway is handling the HTTP request
-
invokeBeforeCall
-
parsePostBody
-
parseTextPlain
protected void parseTextPlain(io.datatree.Tree params, String query) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
parseQueryString
protected void parseQueryString(io.datatree.Tree params, String query) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
sendResponse
protected void sendResponse(WebRequest req, WebResponse rsp, io.datatree.Tree data) throws Exception - Throws:
Exception
-
insertMessages
protected io.datatree.Tree insertMessages(io.datatree.Tree data, io.datatree.Tree meta) -
getParent
Description copied from interface:RequestProcessorReturns the next RequestProcessor in the invocation chain.- Specified by:
getParentin interfaceRequestProcessor- Returns:
- parent processor
-