Package | Description |
---|---|
com.spotify.apollo | |
com.spotify.apollo.meta | |
com.spotify.apollo.route |
Modifier and Type | Method and Description |
---|---|
Environment.RoutingEngine |
Environment.RoutingEngine.registerAutoRoute(Route<? extends AsyncHandler<?>> route)
Registers a
Route . |
Environment.RoutingEngine |
Environment.RoutingEngine.registerRoute(Route<? extends AsyncHandler<? extends Response<okio.ByteString>>> route)
Registers a
Route . |
Environment.RoutingEngine |
Environment.RoutingEngine.registerRoutes(Stream<? extends Route<? extends AsyncHandler<? extends Response<okio.ByteString>>>> routes)
Registers routes.
|
Modifier and Type | Method and Description |
---|---|
Stream<Route<? extends AsyncHandler<?>>> |
MetaApplication.routes() |
Modifier and Type | Method and Description |
---|---|
static <T> AsyncHandler<Response<okio.ByteString>> |
Middlewares.autoSerialize(AsyncHandler<T> inner)
Converts an AsyncHandler with unspecified return type to one that returns
Response<ByteString> . |
default <V> AsyncHandler<V> |
AsyncHandler.flatMap(Function<? super T,? extends AsyncHandler<? extends V>> mapFunction)
Create a new
AsyncHandler that will map the return value of
invoke(RequestContext) through the given map function. |
default <V> AsyncHandler<V> |
AsyncHandler.flatMapSync(Function<? super T,? extends SyncHandler<? extends V>> mapFunction)
Synchronous version of
flatMap(Function) . |
static <T> AsyncHandler<T> |
Middleware.guavaToAsync(ListenableFutureHandler<T> listenableFutureHandler) |
static AsyncHandler<Response<okio.ByteString>> |
Middlewares.httpPayloadSemantics(AsyncHandler<Response<okio.ByteString>> inner)
Applies logic to the inner
AsyncHandler that makes it conform to the semantics
specified in HTTP regarding when to return response bodies, Content-Length headers, etc. |
default <V> AsyncHandler<V> |
AsyncHandler.map(Function<? super T,? extends V> mapFunction)
Create a new
AsyncHandler that will map the return value of
invoke(RequestContext) through the given map function. |
static <T> AsyncHandler<T> |
Middleware.syncToAsync(SyncHandler<T> handler) |
Modifier and Type | Method and Description |
---|---|
static Middleware<AsyncHandler<?>,AsyncHandler<Response<okio.ByteString>>> |
Middlewares.apolloDefaults()
Returns the default middlewares applied by Apollo to routes supplied by a
RouteProvider . |
static Middleware<AsyncHandler<?>,AsyncHandler<Response<okio.ByteString>>> |
Middlewares.apolloDefaults()
Returns the default middlewares applied by Apollo to routes supplied by a
RouteProvider . |
static <T> Route<AsyncHandler<T>> |
Route.async(String method,
String uri,
AsyncHandler<T> handler) |
Stream<Route<AsyncHandler<Response<okio.ByteString>>>> |
Versions.expand(Stream<VersionedRoute> versionedRouteStream) |
static <T> Route<AsyncHandler<T>> |
Route.future(String method,
String uri,
ListenableFutureHandler<T> handler) |
static <T> Middleware<AsyncHandler<T>,AsyncHandler<Response<okio.ByteString>>> |
HtmlSerializerMiddlewares.htmlSerialize(String templateName)
Async middleware for POJO.
|
static <T> Middleware<AsyncHandler<T>,AsyncHandler<Response<okio.ByteString>>> |
HtmlSerializerMiddlewares.htmlSerialize(String templateName)
Async middleware for POJO.
|
static <T> Middleware<AsyncHandler<Response<T>>,AsyncHandler<Response<okio.ByteString>>> |
HtmlSerializerMiddlewares.htmlSerializeResponse(String templateName)
Async middleware for a Response object.
|
static <T> Middleware<AsyncHandler<Response<T>>,AsyncHandler<Response<okio.ByteString>>> |
HtmlSerializerMiddlewares.htmlSerializeResponse(String templateName)
Async middleware for a Response object.
|
static <T> Middleware<SyncHandler<Response<T>>,AsyncHandler<Response<okio.ByteString>>> |
HtmlSerializerMiddlewares.htmlSerializeResponseSync(String templateName)
Sync middleware for a Response object.
|
static <T> Middleware<SyncHandler<T>,AsyncHandler<Response<okio.ByteString>>> |
HtmlSerializerMiddlewares.htmlSerializeSync(String templateName)
Sync middleware for POJO.
|
static <T> Middleware<AsyncHandler<T>,AsyncHandler<Response<okio.ByteString>>> |
JsonSerializerMiddlewares.jsonSerialize(com.fasterxml.jackson.databind.ObjectWriter objectWriter)
Middleware that serializes the result of the inner handler using the supplied
ObjectWriter , and sets the Content-Type header to application/json. |
static <T> Middleware<AsyncHandler<T>,AsyncHandler<Response<okio.ByteString>>> |
JsonSerializerMiddlewares.jsonSerialize(com.fasterxml.jackson.databind.ObjectWriter objectWriter)
Middleware that serializes the result of the inner handler using the supplied
ObjectWriter , and sets the Content-Type header to application/json. |
static <T> Middleware<AsyncHandler<Response<T>>,AsyncHandler<Response<okio.ByteString>>> |
JsonSerializerMiddlewares.jsonSerializeResponse(com.fasterxml.jackson.databind.ObjectWriter objectWriter)
Middleware that serializes the payload of the result response of the inner handler using
the supplied
ObjectWriter , and sets the Content-Type header to application/json. |
static <T> Middleware<AsyncHandler<Response<T>>,AsyncHandler<Response<okio.ByteString>>> |
JsonSerializerMiddlewares.jsonSerializeResponse(com.fasterxml.jackson.databind.ObjectWriter objectWriter)
Middleware that serializes the payload of the result response of the inner handler using
the supplied
ObjectWriter , and sets the Content-Type header to application/json. |
static <T> Middleware<SyncHandler<Response<T>>,AsyncHandler<Response<okio.ByteString>>> |
JsonSerializerMiddlewares.jsonSerializeResponseSync(com.fasterxml.jackson.databind.ObjectWriter objectWriter) |
static <T> Middleware<SyncHandler<T>,AsyncHandler<Response<okio.ByteString>>> |
JsonSerializerMiddlewares.jsonSerializeSync(com.fasterxml.jackson.databind.ObjectWriter objectWriter) |
static Middleware<AsyncHandler<?>,AsyncHandler<Response<?>>> |
Middlewares.replyContentType(String contentType)
Middleware that adds the ability to set the response's Content-Type header to a defined
value.
|
static Middleware<AsyncHandler<?>,AsyncHandler<Response<?>>> |
Middlewares.replyContentType(String contentType)
Middleware that adds the ability to set the response's Content-Type header to a defined
value.
|
Route<AsyncHandler<Response<okio.ByteString>>> |
VersionedRoute.route()
Base route that should be mapped to some versions.
|
Stream<? extends Route<? extends AsyncHandler<?>>> |
RouteProvider.routes() |
static Middleware<AsyncHandler<?>,AsyncHandler<Response<okio.ByteString>>> |
Middlewares.serialize(Serializer serializer)
Middleware that applies the supplied serializer to the result of the inner handler,
changing the payload and optionally the Content-Type header.
|
static Middleware<AsyncHandler<?>,AsyncHandler<Response<okio.ByteString>>> |
Middlewares.serialize(Serializer serializer)
Middleware that applies the supplied serializer to the result of the inner handler,
changing the payload and optionally the Content-Type header.
|
static <T> Route<AsyncHandler<T>> |
Route.sync(String method,
String uri,
SyncHandler<T> handler) |
Modifier and Type | Method and Description |
---|---|
static <T> Route<AsyncHandler<T>> |
Route.async(String method,
String uri,
AsyncHandler<T> handler) |
static <T> AsyncHandler<Response<okio.ByteString>> |
Middlewares.autoSerialize(AsyncHandler<T> inner)
Converts an AsyncHandler with unspecified return type to one that returns
Response<ByteString> . |
static AsyncHandler<Response<okio.ByteString>> |
Middlewares.httpPayloadSemantics(AsyncHandler<Response<okio.ByteString>> inner)
Applies logic to the inner
AsyncHandler that makes it conform to the semantics
specified in HTTP regarding when to return response bodies, Content-Length headers, etc. |
Modifier and Type | Method and Description |
---|---|
default <V> AsyncHandler<V> |
AsyncHandler.flatMap(Function<? super T,? extends AsyncHandler<? extends V>> mapFunction)
Create a new
AsyncHandler that will map the return value of
invoke(RequestContext) through the given map function. |
static VersionedRoute |
VersionedRoute.of(Route<AsyncHandler<Response<okio.ByteString>>> route)
Create a new com.spotify.apollo.route.VersionedRoute, which is valid from version 0.
|
Copyright © 2016. All rights reserved.