Package com.shri.restinpeace
package com.shri.restinpeace
-
ClassDescriptionPer-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 aBulkheadConfig.Escape hatch forRipClientConfig.Builder.bulkhead(BulkheadProvider)- delegates the actual admission decision to an already-running bulkhead instance (resilience4j or otherwise) instead of RIP's own built-inBulkheadConfig-drivenSemaphore.CallAdapter<T>Adapts a@RestClientcall's outcome into a consumer-chosen return typeT, for a return-type shape RIP itself has no built-in support for (e.g.Recognizes a method's declared return type and produces aCallAdapterfor it, or declines.Per-client circuit breaker forRIP.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 aCircuitBreakerConfig.Whether the sliding window counts the last N calls or the last N seconds.Escape hatch forRipClientConfig.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-inCircuitBreakerConfig-driven state machine.Page<T>One page of a@Paginated(orPaginationStrategy<T>) method's results, for manual, page-at-a-time iteration - seedocs/design/pagination-helper.md§6.4.Adapts a@Paginatedmethod's page sequence into a consumer-chosen return typeT- the pagination-aware counterpart ofCallAdapter, for a return type built around fetching more than one page over time (e.g.Recognizes a@Paginatedmethod's return type and produces aPaginatedCallAdapterfor it - the pagination-aware counterpart ofCallAdapterFactory, consulted only for a method actually annotated@Paginated(never for aPaginationStrategy<T>-parameter method, and never for a plain, non-paginated call - seeCallAdapterFactoryfor that).The single page's items and metadata aPaginationStrategyis consulted with after every fetch - seedocs/design/pagination-helper.md§6.8.What aPaginationStrategy'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 viaPaginationRequest.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 programmatic escape hatch for a pagination shape@Paginated's closed annotation vocabulary can't express - seedocs/design/pagination-helper.md§6.8 and §10 for exactly which cases require it.Per-client default retry policy forRIP.getClient(Class, RipClientConfig)- applied to any call whose method has no@Retryof its own (and whose interface has no interface-level@Retrydefault 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@Retryannotations declare for production).Builds aRetryConfig.Entry point for REST-in-peace: turns an annotated@RestClientinterface into a working HTTP client backed by a JDK dynamic proxy, viaRIP.getClient(Class).Per-client settings forRIP.getClient(Class, RipClientConfig)- base URL, connect/read timeout, proxy, JSONObjectMapper, cache, interceptors, and a default retry policy - for a@RestClientwhose environment differs from every other client's, sincekong.unirest.Unirest's own global config is shared by every RIP client that doesn't ask for its own.Builds aRipClientConfig.RipResponse<T>Wraps a successful response's decoded body together with its status code and headers, for a method that needs more than just the body.