Modifier and Type | Method and Description |
---|---|
static <T> Response<T> |
Response.forPayload(T payload)
Creates a 200 OK
Response with the given payload of type T . |
static <T> Response<T> |
Response.forStatus(StatusType statusCode)
Creates a
Response with the given status code. |
static <T> Response<T> |
Response.of(StatusType statusCode,
T payload)
Creates a
Response with the given status code and a payload with type T . |
static <T> Response<T> |
Response.ok()
Returns a typed 200 OK
Response . |
Response<T> |
Response.withHeader(String header,
String value)
Creates a new
Response based on this, but with an additional header. |
Response<T> |
Response.withHeaders(Map<String,String> headers)
Creates a new
Response based on this, but with additional headers. |
<P> Response<P> |
Response.withPayload(P newPayload)
Creates a new
Response based on this, but with a different payload. |
Modifier and Type | Method and Description |
---|---|
CompletionStage<Response<okio.ByteString>> |
Client.send(Request request)
Send a Request and get an asynchronous Response as a CompletionStage.
|
Modifier and Type | Method and Description |
---|---|
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 |
---|---|
CompletionStage<Response<okio.ByteString>> |
Endpoint.invoke(RequestContext requestContext) |
Modifier and Type | Method and Description |
---|---|
CompletionStage<Response<okio.ByteString>> |
IncomingRequestAwareClient.send(Request request,
Optional<Request> incoming)
Send a Request with an optional originating Request and get an asynchronous Response as a
CompletionStage.
|
Modifier and Type | Method and Description |
---|---|
CompletionStage<Response<okio.ByteString>> |
OutgoingCallsGatheringClient.send(Request request,
Optional<Request> incoming) |
Modifier and Type | Method and Description |
---|---|
void |
OngoingRequest.reply(Response<okio.ByteString> response)
Reply to the request with a
Response . |
void |
ForwardingOngoingRequest.reply(Response<okio.ByteString> response) |
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 <T> AsyncHandler<Response<okio.ByteString>> |
Middlewares.autoSerialize(AsyncHandler<T> inner)
Converts an AsyncHandler with unspecified return type to one that returns
Response<ByteString> . |
Stream<Route<AsyncHandler<Response<okio.ByteString>>>> |
Versions.expand(Stream<VersionedRoute> versionedRouteStream) |
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<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 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. |
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<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.
|
Route<AsyncHandler<Response<okio.ByteString>>> |
VersionedRoute.route()
Base route that should be mapped to some versions.
|
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.
|
Modifier and Type | Method and Description |
---|---|
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. |
static VersionedRoute |
VersionedRoute.of(Route<AsyncHandler<Response<okio.ByteString>>> route)
Create a new com.spotify.apollo.route.VersionedRoute, which is valid from version 0.
|
Modifier and Type | Method and Description |
---|---|
abstract Response<okio.ByteString> |
StubClient.RequestResponsePair.response() |
Modifier and Type | Method and Description |
---|---|
CompletionStage<Response<okio.ByteString>> |
FakeOngoingRequest.getReply()
Get a future holding the reply.
|
CompletionStage<Response<okio.ByteString>> |
ServiceHelper.request(Request request)
Make a call to the running application and return a
CompletionStage of the response. |
CompletionStage<Response<okio.ByteString>> |
ServiceHelper.request(String method,
String uri)
Makes a call on the given uri.
|
CompletionStage<Response<okio.ByteString>> |
ServiceHelper.request(String method,
String uri,
okio.ByteString payload)
Makes a call on the given uri.
|
CompletionStage<Response<okio.ByteString>> |
ServiceHelper.request(String method,
URI uri)
Makes a call on the given uri.
|
CompletionStage<Response<okio.ByteString>> |
ServiceHelper.request(String method,
URI uri,
okio.ByteString payload)
Makes a call on the given uri.
|
CompletionStage<Response<okio.ByteString>> |
StubClient.send(Request request) |
Modifier and Type | Method and Description |
---|---|
static StubClient.RequestResponsePair |
StubClient.RequestResponsePair.create(Request request,
Response<okio.ByteString> response) |
void |
FakeOngoingRequest.reply(Response<okio.ByteString> response) |
StubClient.StubbedResponseBuilder |
StubClient.respond(Response<okio.ByteString> response)
Configure a constant (i.e., all matching requests will always result in the same response)
response for some request.
|
Modifier and Type | Method and Description |
---|---|
Response<okio.ByteString> |
ResponseWithDelay.getResponse() |
Modifier and Type | Method and Description |
---|---|
static ResponseWithDelay |
ResponseWithDelay.forResponse(Response<okio.ByteString> response) |
static ResponseWithDelay |
ResponseWithDelay.forResponse(Response<okio.ByteString> response,
long delay,
TimeUnit unit) |
Modifier and Type | Method and Description |
---|---|
static <T> org.hamcrest.Matcher<Response<T>> |
ResponseMatchers.doesNotHaveHeader(String header)
Builds a matcher for
Response s without specific header. |
static <T> org.hamcrest.Matcher<Response<T>> |
ResponseMatchers.hasHeader(String header,
org.hamcrest.Matcher<String> valueMatcher)
Builds a matcher for
Response s with matching header. |
static <T> org.hamcrest.Matcher<Response<T>> |
ResponseMatchers.hasNoHeaders()
Builds a matcher for
Response s with no headers. |
static <T> org.hamcrest.Matcher<Response<T>> |
ResponseMatchers.hasNoPayload()
Builds a matcher for
Response s with no payload. |
static <T> org.hamcrest.Matcher<Response<T>> |
ResponseMatchers.hasPayload(org.hamcrest.Matcher<? super T> payloadMatcher)
Builds a matcher for
Response s with matching payload. |
static <T> org.hamcrest.Matcher<Response<T>> |
ResponseMatchers.hasStatus(org.hamcrest.Matcher<StatusType> statusMatcher)
Builds a matcher for
Response s with matching status. |
Copyright © 2016. All rights reserved.