public class Mapping 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 io.datatree.dom.Cache<java.lang.String,java.util.regex.Matcher> |
cache |
protected io.datatree.Tree |
config |
protected int |
hashCode |
protected java.lang.String |
httpMethod |
protected java.util.Set<HttpMiddleware> |
installedMiddlewares |
protected boolean |
isStatic |
protected RequestProcessor |
lastProcessor |
protected java.lang.String |
pathPattern |
protected java.lang.String |
pathPrefix |
protected java.util.regex.Pattern |
pattern |
protected Route |
route |
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 |
|---|
Mapping(services.moleculer.ServiceBroker broker,
java.lang.String httpMethod,
java.lang.String pathPattern,
java.lang.String actionName,
services.moleculer.context.CallOptions.Options opts,
AbstractTemplateEngine templateEngine,
Route route,
CallProcessor beforeCall,
CallProcessor afterCall,
java.util.concurrent.ExecutorService executor) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
protected io.datatree.Tree |
getActionConfig(RequestProcessor parent) |
java.lang.String |
getHttpMethod() |
RequestProcessor |
getParent()
Returns the next RequestProcessor in the invocation chain.
|
java.lang.String |
getPathPattern() |
java.lang.String |
getPathPrefix() |
int |
hashCode() |
boolean |
isStatic() |
boolean |
matches(java.lang.String httpMethod,
java.lang.String path) |
void |
service(WebRequest req,
WebResponse rsp)
Handles request of the HTTP client.
|
void |
use(java.util.Collection<HttpMiddleware> middlewares) |
protected final java.lang.String httpMethod
protected final java.lang.String actionName
protected final io.datatree.Tree config
protected final Route route
protected final CallProcessor beforeCall
protected final CallProcessor afterCall
protected RequestProcessor lastProcessor
protected final boolean isStatic
protected final java.lang.String pathPrefix
protected final java.lang.String pathPattern
protected final int hashCode
protected final java.util.regex.Pattern pattern
protected final io.datatree.dom.Cache<java.lang.String,java.util.regex.Matcher> cache
protected final java.util.Set<HttpMiddleware> installedMiddlewares
public Mapping(services.moleculer.ServiceBroker broker,
java.lang.String httpMethod,
java.lang.String pathPattern,
java.lang.String actionName,
services.moleculer.context.CallOptions.Options opts,
AbstractTemplateEngine templateEngine,
Route route,
CallProcessor beforeCall,
CallProcessor afterCall,
java.util.concurrent.ExecutorService executor)
public boolean matches(java.lang.String httpMethod,
java.lang.String path)
public void use(java.util.Collection<HttpMiddleware> middlewares)
protected io.datatree.Tree getActionConfig(RequestProcessor parent)
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 requestpublic RequestProcessor getParent()
RequestProcessorgetParent in interface RequestProcessorpublic boolean isStatic()
public java.lang.String getPathPrefix()
public java.lang.String getHttpMethod()
public java.lang.String getPathPattern()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object