Package org.restheart.plugins
Interface Service<R extends ServiceRequest<?>,S extends ServiceResponse<?>>
-
- Type Parameters:
R- the request typeS- the response type
- All Superinterfaces:
ConfigurablePlugin,ExchangeTypeResolver<R,S>,HandlingPlugin<R,S>,Plugin
- All Known Subinterfaces:
BsonService,ByteArrayService,JsonService
public interface Service<R extends ServiceRequest<?>,S extends ServiceResponse<?>> extends HandlingPlugin<R,S>, ConfigurablePlugin
Interface to implement services- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidhandle(R request, S response)handle the requestdefault voidhandleOptions(R request)helper method to handle OPTIONS requestsFunction<io.undertow.server.HttpServerExchange,R>request()Consumer<io.undertow.server.HttpServerExchange>requestInitializer()Function<io.undertow.server.HttpServerExchange,S>response()Consumer<io.undertow.server.HttpServerExchange>responseInitializer()-
Methods inherited from interface org.restheart.plugins.ExchangeTypeResolver
requestType, responseType
-
-
-
-
Method Detail
-
handle
void handle(R request, S response) throws Exception
handle the request- Parameters:
request-response-- Throws:
Exception
-
requestInitializer
Consumer<io.undertow.server.HttpServerExchange> requestInitializer()
- Returns:
- the function used to instantiate the request object
-
responseInitializer
Consumer<io.undertow.server.HttpServerExchange> responseInitializer()
- Returns:
- the function used to instantiate the response object
-
request
Function<io.undertow.server.HttpServerExchange,R> request()
- Returns:
- the function used to retrieve the request object
-
response
Function<io.undertow.server.HttpServerExchange,S> response()
- Returns:
- the function used to retrieve the response object
-
-