All Classes and Interfaces
Class
Description
Declares the base URL for every relative method URL on a
@RestClient interface, so
@GET/@POST/etc. can use a path (e.g.Sends the annotated parameter as the request body.
Per-client concurrency cap for
RIP.getClient(Class, RipClientConfig) -
bounds how many calls to this client can be in flight at once, so one slow
or hung downstream can't starve every other call sharing the same
connection pool/thread capacity.Builds a
BulkheadConfig.Thrown instead of making a call when its client's
bulkhead has no free permit
(and, if BulkheadConfig.getMaxWaitDurationMillis()
is set, none freed up within that wait either) - too many calls to this
client are already in flight.Escape hatch for
RipClientConfig.Builder.bulkhead(BulkheadProvider) -
delegates the actual admission decision to an already-running bulkhead
instance (resilience4j or otherwise) instead of RIP's own built-in
BulkheadConfig-driven Semaphore.A pluggable store for
GET response caching, attached via
RipClientConfig.Builder.cache(Cache) (one
client) or RIP.setCache(Cache) (the shared
default for every client without its own).A stored
GET response, as handed to and returned from a
Cache implementation.Adapts a
@RestClient call's outcome into a consumer-chosen return
type T, for a return-type shape RIP itself has no built-in
support for (e.g.Recognizes a method's declared return type and produces a
CallAdapter for it, or declines.Per-client circuit breaker for
RIP.getClient(Class, RipClientConfig) -
stops even attempting calls to a downstream that's shown itself to be
failing, for a cooldown period, once its failure rate crosses a threshold.Builds a
CircuitBreakerConfig.Whether the sliding window counts the last N calls or the last N seconds.
Escape hatch for
RipClientConfig.Builder.circuitBreaker(CircuitBreakerProvider) -
delegates the actual open/closed decision to an already-running circuit
breaker instance (resilience4j or otherwise) instead of RIP's own
built-in CircuitBreakerConfig-driven state machine.Thrown instead of making a call when its client's
circuit breaker is open -
the downstream has recently shown a high enough failure rate that this
call is refused immediately, without attempting the network call (or even
a cache lookup), rather than paying the cost of finding out it would have
failed too.Pre-built interceptor that attaches a fresh correlation/request ID to
every request - useful for tracing a call across service boundaries or
correlating client-side logs with server-side logs.
Marks a method as issuing an HTTP DELETE request to the given URL template.
Marks the
java.io.File parameter a File-returning method
writes its response body into, instead of buffering the whole body into a
byte[]:Notified as a
byte[]- or File-returning method's response
body streams in, for surfacing download progress (a progress bar, a
percentage log line) on a large download.Declares what class to deserialize a method's error response body into.
One name/value pair of a
@FormUrlEncoded method's
form-urlencoded body.A
Map<String, ?> parameter of a @FormUrlEncoded
method adding one form field per entry, for a set of field names not known
until runtime - the @FieldMap counterpart to @QueryMap
and @PartMap.Marks a method as sending an
application/x-www-form-urlencoded
body built from its @Field/@FieldMap-annotated
parameters, instead of the JSON/raw-string body a @Body
parameter would send, or the multipart/form-data body
@Multipart would send.Marks a method as issuing an HTTP GET request to the given URL template.
Marks a method as issuing an HTTP HEAD request to the given URL template.
Pre-built interceptor that injects one or more headers into every request -
the common "attach an auth token (or a batch of fixed headers) to every
call" use case.
Sets an HTTP header for each entry of the annotated
Map<String, ?>
parameter, for a set of headers whose names aren't known until runtime -
e.g. caller-supplied headers in a multi-tenant app.Sets an HTTP header on the request from the annotated parameter's value.
Sets one or more fixed HTTP headers on every call of the annotated method,
each given as a
"Name: Value" string - for a header whose value is
always the same (e.g.The HTTP methods supported by REST-in-peace's method annotations.
Internal meta-annotation applied to each HTTP-verb annotation (e.g.
The kinds of request parameter binding supported by REST-in-peace's parameter annotations.
Internal meta-annotation applied to each request-parameter annotation
(e.g.
The default
Cache implementation: an unbounded, process-local
ConcurrentHashMap - fine for most single-process uses, but not
shared across JVMs.Pre-built interceptor that logs a line before a request goes out and
another when its response comes back, including the elapsed time.
Pre-built interceptor that times every request and reports it, once its
response comes back, to a
MetricsSink - the metrics counterpart of
LoggingInterceptor, following the exact same "bring your own sink"
shape so RIP doesn't have to depend on Micrometer or any other metrics
library to support one.Receives one completed call's metrics from
MetricsInterceptor -
implement this to route them into Micrometer, a homegrown registry, or
anything else, without RIP itself depending on a metrics library.A canned response for
MockRestServer to send back for a matching
request.A real, local HTTP server for unit-testing code that calls a
@RestClient interface, without depending on a real network - point
RIP.getClient(Class, String) at
MockRestServer.baseUrl() and this server stands in for the real one.A JUnit 5 extension that starts one
MockRestServer for a whole test
class and resets it before each test -
register it with @ExtendWith and receive the server as a test (or
@BeforeEach) method parameter, instead of wiring up
@BeforeAll/@AfterAll/@BeforeEach boilerplate by
hand.Opts a single
GET method out of response caching, even when its
client has a Cache configured (via
RipClientConfig.Builder.cache or
RIP.setCache(com.shri.restinpeace.cache.Cache)) - every call always hits the
network, regardless of the response's own Cache-Control/
ETag headers.Generates a
@RestClient interface (annotations and all) from an
OpenAPI 3.x document - the opposite direction of this library's own
compile-time proxy generation, which turns a hand-written interface into
an implementation.Marks a method as issuing an HTTP OPTIONS request to the given URL template.
One page of a
@Paginated (or PaginationStrategy<T>)
method's results, for manual, page-at-a-time iteration - see
docs/design/pagination-helper.md §6.4.Declares that a method's response is paginated - following a next-page
pointer automatically, extracting each page's items into a
Page<T>, instead of leaving the fetch-extract-repeat loop to
hand-written code.Adapts a
@Paginated method's page sequence into a consumer-chosen
return type T - the pagination-aware counterpart of
CallAdapter, for a return type built around fetching more than one
page over time (e.g.Recognizes a
@Paginated method's return type and produces a
PaginatedCallAdapter for it - the pagination-aware counterpart of
CallAdapterFactory, consulted only for a method actually annotated
@Paginated (never for a PaginationStrategy<T>-parameter
method, and never for a plain, non-paginated call - see
CallAdapterFactory for that).How the client advances to the next page on its own, when
pointerSource = NONE (no server-given pointer at all) - offset or
page-number arithmetic instead of following an extracted value.The single page's items and metadata a
PaginationStrategy is
consulted with after every fetch - see
docs/design/pagination-helper.md §6.8.Marks a parameter - already annotated
@QueryParam/@PathParam/
@HeaderParam/@Body - as the carrier a @Paginated
fetch re-populates with the freshly extracted next-page pointer before
every subsequent call.What a
PaginationStrategy's next request should look like - built
exclusively via the static factory methods below (this interface isn't
meant to be implemented directly), and combinable via PaginationRequest.and(com.shri.restinpeace.PaginationRequest) when
more than one override applies at once (a composite keyset needing two
request-body fields set, for instance).The sole implementation of
PaginationRequest - constructed only via
its static factory methods (which this class's own statics back) and
PaginationRequestImpl.and(com.shri.restinpeace.PaginationRequest).Where one particular
@Paginated signal comes from - reused across
pointerSource, hasMoreSource, totalSource, and
totalPagesSource (one enum, four uses, not four renamed
near-duplicates) per docs/design/pagination-helper.md §6.1.The programmatic escape hatch for a pagination shape
@Paginated's
closed annotation vocabulary can't express - see
docs/design/pagination-helper.md §6.8 and §10 for exactly which
cases require it.One field of a
@Multipart method's multipart body.A
Map<String, ?> parameter of a @Multipart
method adding one part per entry, for a set of field names not known
until runtime - the @Part counterpart to @QueryMap
and @HeaderMap.Wraps a
File, byte[], or InputStream with an
explicit file name, for use as a @PartMap entry's value
when the default file name (the entry's key) isn't the one to send.Marks a method as issuing an HTTP PATCH request to the given URL template.
Substitutes a
{name} placeholder in the method's URL template with
the annotated parameter's value.Whether a
@Paginated method's extracted next-page pointer is a
complete URL to follow verbatim, or a bare value to re-inject into the
next request via a @PaginationCursor carrier.Marks a method as issuing an HTTP POST request to the given URL template.
Marks a method as issuing an HTTP PUT request to the given URL template.
Appends a query string parameter for each entry of the annotated
Map<String, ?> parameter, for a set of query params whose names
aren't known until runtime - e.g. a search endpoint's open-ended filter
set.Appends a query string parameter to the request from the annotated
parameter's value.
A single request
MockRestServer actually received, for a test to
assert against after making a call through a @RestClient
interface.One part of a decoded
multipart/form-data request body, as
returned by RecordedRequest.getParts().A
LoggingInterceptor-style pre-built interceptor that also logs the
request and response bodies, masking a configured set of field names
(case-insensitively) instead of printing them verbatim - so logging bodies
is safe by default instead of a footgun.Validates a
@RestClient interface before
RIP.getClient(Class) hands back a proxy for
it, so a misconfigured interface fails fast with a complete list of
problems instead of failing later on the first call.Per-call state passed to a
RequestInterceptor's
beforeRequest/afterResponse, sharing one instance across
both so an interceptor can correlate state between them (e.g. a start
timestamp for measuring request duration, via RequestContext.setAttribute(java.lang.String, java.lang.Object)).How much extra diagnostic detail
RequestContext.toCurlCommand(CurlVerbosity)
asks curl itself to print, via curl's own flags - RIP
doesn't invent its own verbosity scheme, it just picks which standard
curl flag(s) to include.Builds and executes the actual HTTP request for a
@RestClient
method call, applying path/query/header/body parameters and registered
RequestInterceptors.Global hook into every request/response made through RIP, registered via
RIP.addInterceptor(RequestInterceptor).Marks an interface as a REST client whose methods declare HTTP calls via
@GET/@POST/etc.JDK dynamic proxy handler backing every client returned by
RIP.getClient(Class).Generates a compile-time implementation (
<Interface>_RipImpl) of
every @RestClient interface with at least one method that falls
within the currently-supported shape: a single fixed HTTP verb,
@PathParam/@QueryParam/@HeaderParam/
@QueryMap/@HeaderMap/@Body/@Url/
@Part/@PartMap/@Field/@FieldMap/
@Destination/an UploadProgressListener/
DownloadProgressListener parameter, optional @Timeout/
@Retry/@Headers/@ErrorType/@Multipart/
@FormUrlEncoded, and a void, String, non-generic
POJO, byte[], File, or RipResponse<T> (for any of
the previous return-type shapes) return type.Unchecked exception thrown for any REST-in-peace runtime error - a
@RestClient interface missing @RestClient or failing
validation (see RestInPeaceValidationException for the underlying
validation errors), a missing required parameter value, or an
unsupported HTTP method/annotation combination.Unchecked exception thrown when a
@RestClient method's response
has a non-2xx HTTP status - the request reached the server and got a
response, it's just not a success.Checked exception thrown by
ReflectiveRestClientValidator.validate(Class)
when a @RestClient interface fails validation.Re-issues a request that fails with a transport error (a connection
refused, a timeout) or with one of
Retry.retryOnStatus(), up to
Retry.times() attempts total, waiting Retry.delayMillis() between
attempts and multiplying that wait by Retry.backoffMultiplier() after
each one - unless the failed response itself carries a Retry-After
header, which takes priority over the computed delay for that one wait
(see Retry.delayMillis()), and Retry.jitterFactor() randomizes each
computed delay to avoid many callers retrying in lockstep.Per-client default retry policy for
RIP.getClient(Class, RipClientConfig) -
applied to any call whose method has no @Retry of its own (and
whose interface has no interface-level @Retry default either -
see that annotation's own javadoc for the interface-level shape), for a
client whose retry policy is only known at runtime instead of fixed at
compile time (e.g. more aggressive retries against a known-flakier
staging environment than what the interface's own @Retry
annotations declare for production).Builds a
RetryConfig.Entry point for REST-in-peace: turns an annotated
@RestClient
interface into a working HTTP client backed by a JDK dynamic proxy, via
RIP.getClient(Class).Per-client settings for
RIP.getClient(Class, RipClientConfig) -
base URL, connect/read timeout, proxy, JSON ObjectMapper, cache,
interceptors, and a default retry policy - for a @RestClient
whose environment differs from every other client's,
since kong.unirest.Unirest's own global config is shared by every
RIP client that doesn't ask for its own.Builds a
RipClientConfig.Internal shared constants used as annotation attribute defaults.
Wraps a successful response's decoded body together with its status code
and headers, for a method that needs more than just the body.
A synthetic response a
RequestInterceptor.shortCircuit(com.shri.restinpeace.interceptor.RequestContext) can hand
back to skip the network call entirely - the request is never sent, and
this response is decoded exactly as if it had come back from a real one
(including throwing RestInPeaceHttpException
for a non-2xx status, and being visible to every registered interceptor's
own afterResponse).Overrides the connect/read timeout, taking priority over both the shared
client's configured default and a
RipClientConfig's
timeout - for one endpoint whose expected latency doesn't match the rest
of the client (a report-export endpoint that's expected to be slow, a
health check that should fail fast).Notified as a
@Multipart method's File/InputStream
parts are written to the request body, for surfacing upload progress on a
large file.Uses the annotated
String parameter as the method's entire URL,
instead of resolving one from the HTTP method annotation's template
(with @BaseUrl/a runtime base URL and @PathParams).Accumulates validation errors found while checking a
@RestClient
interface, so ReflectiveRestClientValidator
can report every problem at once instead of failing on the first one.