Package org.hcjf.io.net.http
Class RestContext
- java.lang.Object
-
- org.hcjf.io.net.http.Context
-
- org.hcjf.io.net.http.RestContext
-
public class RestContext extends Context
This class provides an abstraction to implements a simple rest end point that join any rest rule with some layer implementation.- Author:
- javaito
-
-
Field Summary
-
Fields inherited from class org.hcjf.io.net.http.Context
END_CONTEXT, START_CONTEXT, URI_FOLDER_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description RestContext(java.lang.String baseContext)RestContext(java.lang.String baseContext, java.util.List<java.util.regex.Pattern> idRegexList)
-
Method Summary
Modifier and Type Method Description HttpResponseonContext(HttpRequest request)This method receive the http request and delegate each request for the different method depends of the http method and the request body.protected HttpResponseonError(HttpRequest request, java.lang.Throwable throwable)This method generate error response all the times that the request generates an throwable instance.-
Methods inherited from class org.hcjf.io.net.http.Context
addDefaultResponseHeaders, createDefaultErrorResponse, getContextRegex, getPattern, getTimeout, setTimeout
-
-
-
-
Method Detail
-
onContext
public HttpResponse onContext(HttpRequest request)
This method receive the http request and delegate each request for the different method depends of the http method and the request body.
-
onError
protected HttpResponse onError(HttpRequest request, java.lang.Throwable throwable)
This method generate error response all the times that the request generates an throwable instance.
-
-