Module io.inverno.mod.web.server
Package io.inverno.mod.web.server.spi
Interface Route<A extends ExchangeContext,B extends Exchange<A>>
- Type Parameters:
A
- the type of the exchange contextB
- the type of exchange handled by the route
- All Known Subinterfaces:
ErrorWebRoute<A>
,InterceptableRoute<A,
,B> WebRoute<A>
,WebSocketRoute<A>
public interface Route<A extends ExchangeContext,B extends Exchange<A>>
Base route interface.
A route specifies an exchange handler and a set of criteria used by a router to determine the exchange handler to execute in response of a particular request matching these criteria.
A route defines then a path to a resource, it is used by a router to route a request to the handler matching the resource being requested.
A route is defined in a router using a route manager.
- Since:
- 1.0
- Author:
- Jeremy Kuhn
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
disable()
Disables the route.void
enable()
Enables the route.Returns the route handler used to process a request matching the route's criteria.boolean
Determines whether the route is disabled.void
remove()
Removes the route from the router that contains it.
-
Method Details
-
getHandler
ReactiveExchangeHandler<A,B> getHandler()Returns the route handler used to process a request matching the route's criteria.
- Returns:
- an exchange handler
-
enable
void enable()Enables the route.
-
disable
void disable()Disables the route.
-
isDisabled
boolean isDisabled()Determines whether the route is disabled.
- Returns:
- true if the route is disabled, false otherwise
-
remove
void remove()Removes the route from the router that contains it.
-