Package org.swisspush.gateleen.hook
Class Route
- java.lang.Object
-
- org.swisspush.gateleen.hook.Route
-
public class Route extends Object
Represents a Route for a specific hook. Each source (eg. listener) has its own Route! The Route forwards a request for a source (eg. listener) to the destination specified by the HttpHook.- Author:
- https://github.com/ljucam [Mario Ljuca]
-
-
Constructor Summary
Constructors Constructor Description Route(io.vertx.core.Vertx vertx, org.swisspush.gateleen.core.storage.ResourceStorage storage, org.swisspush.gateleen.logging.LoggingResourceManager loggingResourceManager, org.swisspush.gateleen.monitoring.MonitoringHandler monitoringHandler, String userProfilePath, HttpHook httpHook, String urlPattern, io.vertx.core.http.HttpClient selfClient)Creates a new instance of a Route.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanup()Closes the http client of the route.voidforward(io.vertx.core.http.HttpServerRequest request)Handles the request and forwards it to the hook specific destination.voidforward(io.vertx.core.http.HttpServerRequest request, io.vertx.core.buffer.Buffer requestBody)Handles the request (consumed) and forwards it to the hook specific destination.HttpHookgetHook()Returns the hook associated with this route.org.swisspush.gateleen.routing.RulegetRule()
-
-
-
Constructor Detail
-
Route
public Route(io.vertx.core.Vertx vertx, org.swisspush.gateleen.core.storage.ResourceStorage storage, org.swisspush.gateleen.logging.LoggingResourceManager loggingResourceManager, org.swisspush.gateleen.monitoring.MonitoringHandler monitoringHandler, String userProfilePath, HttpHook httpHook, String urlPattern, io.vertx.core.http.HttpClient selfClient)Creates a new instance of a Route.- Parameters:
vertx- vertxstorage- storageloggingResourceManager- loggingResourceManagermonitoringHandler- monitoringHandleruserProfilePath- userProfilePathhttpHook- httpHookurlPattern- - this can be a listener or a normal urlPattern (eg. for a route)
-
-
Method Detail
-
getRule
public org.swisspush.gateleen.routing.Rule getRule()
-
forward
public void forward(io.vertx.core.http.HttpServerRequest request, io.vertx.core.buffer.Buffer requestBody)Handles the request (consumed) and forwards it to the hook specific destination.- Parameters:
request- - the original but already consumed requestrequestBody- - saved buffer with the data of body from the original request
-
forward
public void forward(io.vertx.core.http.HttpServerRequest request)
Handles the request and forwards it to the hook specific destination.- Parameters:
request- request
-
cleanup
public void cleanup()
Closes the http client of the route.
-
getHook
public HttpHook getHook()
Returns the hook associated with this route.- Returns:
- the hook
-
-