public class ActionInvoker extends java.lang.Object implements RequestProcessor, HttpConstants
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
actionName |
protected CallProcessor |
afterCall |
protected CallProcessor |
beforeCall |
protected static byte[] |
EMPTY_RESPONSE |
protected services.moleculer.eventbus.Eventbus |
eventbus |
protected java.util.concurrent.ExecutorService |
executor |
protected int[] |
indexes |
protected io.datatree.dom.TreeWriter |
jsonSerializer |
protected static org.slf4j.Logger |
logger |
protected java.util.concurrent.ConcurrentHashMap<java.lang.String,CachedMessages> |
messageCache |
protected MessageLoader |
messageLoader |
protected java.lang.String[] |
names |
protected java.lang.String |
nodeID |
protected services.moleculer.context.CallOptions.Options |
opts |
protected java.lang.String |
pathPattern |
protected java.lang.String |
pathPrefix |
protected Route |
route |
protected services.moleculer.service.ServiceInvoker |
serviceInvoker |
protected AbstractTemplateEngine |
templateEngine |
protected services.moleculer.uid.UidGenerator |
uidGenerator |
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 and Description |
|---|
ActionInvoker(java.lang.String actionName,
java.lang.String pathPattern,
java.lang.String pathPrefix,
int[] indexes,
java.lang.String[] names,
services.moleculer.context.CallOptions.Options opts,
services.moleculer.service.ServiceInvoker serviceInvoker,
AbstractTemplateEngine templateEngine,
Route route,
CallProcessor beforeCall,
CallProcessor afterCall,
java.util.concurrent.ExecutorService executor,
services.moleculer.eventbus.Eventbus eventbus) |
| Modifier and Type | Method and Description |
|---|---|
RequestProcessor |
getParent()
Returns the next RequestProcessor in the invocation chain.
|
protected io.datatree.Tree |
insertMessages(io.datatree.Tree data,
io.datatree.Tree meta) |
protected io.datatree.Tree |
parsePostBody(io.datatree.Tree params,
byte[] bytes,
java.lang.String contentType) |
protected void |
parseQueryString(io.datatree.Tree params,
java.lang.String query) |
protected void |
parseTextPlain(io.datatree.Tree params,
java.lang.String query) |
protected void |
sendResponse(WebRequest req,
WebResponse rsp,
io.datatree.Tree data) |
void |
service(WebRequest req,
WebResponse rsp)
Handles request of the HTTP client.
|
protected static final byte[] EMPTY_RESPONSE
protected static final org.slf4j.Logger logger
protected final java.lang.String actionName
protected final java.lang.String pathPattern
protected final java.lang.String pathPrefix
protected final int[] indexes
protected final java.lang.String[] names
protected final services.moleculer.context.CallOptions.Options opts
protected final java.lang.String nodeID
protected final services.moleculer.service.ServiceInvoker serviceInvoker
protected final io.datatree.dom.TreeWriter jsonSerializer
protected final Route route
protected final CallProcessor beforeCall
protected final CallProcessor afterCall
protected final java.util.concurrent.ExecutorService executor
protected final AbstractTemplateEngine templateEngine
protected final MessageLoader messageLoader
protected final services.moleculer.eventbus.Eventbus eventbus
protected final services.moleculer.uid.UidGenerator uidGenerator
protected final java.util.concurrent.ConcurrentHashMap<java.lang.String,CachedMessages> messageCache
public ActionInvoker(java.lang.String actionName,
java.lang.String pathPattern,
java.lang.String pathPrefix,
int[] indexes,
java.lang.String[] names,
services.moleculer.context.CallOptions.Options opts,
services.moleculer.service.ServiceInvoker serviceInvoker,
AbstractTemplateEngine templateEngine,
Route route,
CallProcessor beforeCall,
CallProcessor afterCall,
java.util.concurrent.ExecutorService executor,
services.moleculer.eventbus.Eventbus eventbus)
public void service(WebRequest req, WebResponse rsp) throws java.lang.Exception
service in interface RequestProcessorreq - WebRequest object that contains the request the client made of
the ApiGatewayrsp - WebResponse object that contains the response the ApiGateway
returns to the clientjava.lang.Exception - if an input or output error occurs while the ApiGateway is
handling the HTTP requestprotected io.datatree.Tree parsePostBody(io.datatree.Tree params,
byte[] bytes,
java.lang.String contentType)
throws java.lang.Exception
java.lang.Exceptionprotected void parseTextPlain(io.datatree.Tree params,
java.lang.String query)
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingExceptionprotected void parseQueryString(io.datatree.Tree params,
java.lang.String query)
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingExceptionprotected void sendResponse(WebRequest req, WebResponse rsp, io.datatree.Tree data) throws java.lang.Exception
java.lang.Exceptionprotected io.datatree.Tree insertMessages(io.datatree.Tree data,
io.datatree.Tree meta)
public RequestProcessor getParent()
RequestProcessorgetParent in interface RequestProcessor