Package | Description |
---|---|
ratpack.exec |
The execution management.
|
ratpack.handling |
The handling of application requests.
|
ratpack.health |
Health checks report on the status of key components in the system and are generally used for monitoring and reporting.
|
ratpack.http |
The HTTP protocol.
|
ratpack.http.client |
The HTTP client.
|
ratpack.pac4j |
Integration with pac4j for authentication/authorization.
|
ratpack.render |
The renderer framework provides a pluggable mechanism for serializing objects to the response.
|
ratpack.rx |
Provides integration with the RxJava library.
|
ratpack.session |
Objects for providing
Session support. |
ratpack.sse |
Support for Server Sent Events.
|
ratpack.stream |
Support for reactive streams.
|
ratpack.test.exec | |
ratpack.util |
General purpose types and utilities.
|
Modifier and Type | Method and Description |
---|---|
default <O> Promise<O> |
Promise.apply(Function<? super Promise<T>,? extends Promise<O>> function)
Applies the custom operation function to this promise.
|
default <O> Promise<O> |
Promise.blockingMap(Function<? super T,? extends O> transformer)
Like
map(Function) , but performs the transformation on a blocking thread. |
default Promise<T> |
Promise.blockingOp(Action<? super T> action)
Executes the given action with the promise value, on a blocking thread.
|
default Promise<T> |
Promise.cache()
Caches the promised value (or error) and returns it to all subscribers.
|
default Promise<T> |
Promise.defer(Action<? super Runnable> releaser)
Allows the execution of the promise to be deferred to a later time.
|
static <T> Promise<T> |
Promise.error(Throwable t)
Creates a failed promise with the given error.
|
default <T> Promise<T> |
Operation.flatMap(Factory<? extends Promise<T>> factory) |
default <O> Promise<O> |
Promise.flatMap(Function<? super T,? extends Promise<O>> transformer)
Transforms the promised value by applying the given function to it that returns a promise for the transformed value.
|
default <T> Promise<T> |
Operation.flatMap(Promise<T> promise) |
static <T> Promise<T> |
Blocking.get(Factory<T> factory)
Performs a blocking operation on a separate thread, returning a promise for its value.
|
default <O> Promise<Pair<O,T>> |
Promise.left(Promise<O> left) |
default <T> Promise<T> |
Operation.map(Factory<? extends T> factory) |
default <O> Promise<O> |
Promise.map(Function<? super T,? extends O> transformer)
Transforms the promised value by applying the given function to it.
|
default Promise<T> |
Promise.mapError(Function<? super Throwable,? extends T> transformer)
Transforms the promise failure (potentially into a value) by applying the given function to it.
|
default <O> Promise<O> |
Promise.next(Promise<O> next) |
static <T> Promise<T> |
Promise.of(Upstream<T> upstream)
Creates a promise for value that will be available later.
|
static <T> Promise<T> |
Promise.ofLazy(Factory<T> factory)
Creates a promise for value produced by the given factory.
|
default Promise<T> |
Promise.onError(Action<? super Throwable> errorHandler)
Specifies the action to take if the an error occurs trying to produce the promised value.
|
default Promise<T> |
Promise.onNull(Block action)
A convenience shorthand for
routing null values. |
default Promise<T> |
Promise.onYield(Runnable onYield)
Registers a listener that is invoked when
this promise is initiated. |
Promise<Void> |
Operation.promise() |
default <O> Promise<Pair<T,O>> |
Promise.right(Promise<O> right) |
default Promise<T> |
Promise.route(Predicate<? super T> predicate,
Action<? super T> action)
Allows the promised value to be handled specially if it meets the given predicate, instead of being handled by the promise subscriber.
|
<T> Promise<T> |
Throttle.throttle(Promise<T> promise)
Throttles the given promise.
|
default Promise<T> |
Promise.throttled(Throttle throttle)
Throttles
this promise, using the given throttle . |
<O> Promise<O> |
Promise.transform(Function<? super Upstream<? extends T>,? extends Upstream<O>> upstreamTransformer)
Apply a custom transform to this promise.
|
static <T> Promise<T> |
Promise.value(T t)
Creates a promise for the given value.
|
default Promise<T> |
Promise.wiretap(Action<? super Result<T>> listener)
Registers a listener for the promise outcome.
|
static <T> Promise<T> |
Promise.wrap(Factory<? extends Promise<T>> factory) |
Modifier and Type | Method and Description |
---|---|
default <T> Promise<T> |
Operation.flatMap(Promise<T> promise) |
default <O> Promise<Pair<O,T>> |
Promise.left(Promise<O> left) |
default <O> Promise<O> |
Promise.next(Promise<O> next) |
static <T> T |
Blocking.on(Promise<T> promise)
Blocks execution waiting for this promise to complete and returns the promised value.
|
default <O> Promise<Pair<T,O>> |
Promise.right(Promise<O> right) |
<T> Promise<T> |
Throttle.throttle(Promise<T> promise)
Throttles the given promise.
|
Modifier and Type | Method and Description |
---|---|
default <O> Promise<O> |
Promise.apply(Function<? super Promise<T>,? extends Promise<O>> function)
Applies the custom operation function to this promise.
|
default <O> Promise<O> |
Promise.apply(Function<? super Promise<T>,? extends Promise<O>> function)
Applies the custom operation function to this promise.
|
default <T> Promise<T> |
Operation.flatMap(Factory<? extends Promise<T>> factory) |
default <O> Promise<O> |
Promise.flatMap(Function<? super T,? extends Promise<O>> transformer)
Transforms the promised value by applying the given function to it that returns a promise for the transformed value.
|
default <O> O |
Promise.to(Function<? super Promise<T>,? extends O> function)
Applies the given function to
this and returns the result. |
static <T> Promise<T> |
Promise.wrap(Factory<? extends Promise<T>> factory) |
Modifier and Type | Method and Description |
---|---|
<T> Promise<T> |
Context.parse(Class<T> type)
Parse the request into the given type, using no options (or more specifically an instance of
NullParseOpts as the options). |
<T,O> Promise<T> |
Context.parse(Class<T> type,
O options)
Constructs a
Parse from the given args and delegates to Context.parse(Parse) . |
<T,O> Promise<T> |
Context.parse(Parse<T,O> parse)
Parses the request body into an object.
|
<T> Promise<T> |
Context.parse(TypeToken<T> type)
Parse the request into the given type, using no options (or more specifically an instance of
NullParseOpts as the options). |
<T,O> Promise<T> |
Context.parse(TypeToken<T> type,
O options)
Constructs a
Parse from the given args and delegates to Context.parse(Parse) . |
Modifier and Type | Method and Description |
---|---|
Promise<HealthCheck.Result> |
HealthCheck.check(Registry registry)
Checks the health of the component, providing a promise for the result.
|
Modifier and Type | Method and Description |
---|---|
static HealthCheck |
HealthCheck.of(String name,
Function<? super Registry,? extends Promise<HealthCheck.Result>> func)
Convenience factory for health check implementations.
|
Modifier and Type | Method and Description |
---|---|
Promise<TypedData> |
Request.getBody()
The body of the request.
|
Modifier and Type | Method and Description |
---|---|
default Promise<ReceivedResponse> |
HttpClient.get(URI uri) |
Promise<ReceivedResponse> |
HttpClient.get(URI uri,
Action<? super RequestSpec> action)
An asynchronous method to do a GET HTTP request, the URL and all details of the request are configured by the Action acting on the RequestSpec, but the method will be defaulted to a GET.
|
Promise<ReceivedResponse> |
HttpClient.post(URI uri,
Action<? super RequestSpec> action)
An asynchronous method to do a POST HTTP request, the URL and all details of the request are configured by the Action acting on the RequestSpec, but the method will be defaulted to a POST.
|
Promise<ReceivedResponse> |
HttpClient.request(URI uri,
Action<? super RequestSpec> action)
An asynchronous method to do a HTTP request, the URL and all details of the request are configured by the Action acting on the RequestSpec.
|
Promise<StreamedResponse> |
HttpClient.requestStream(URI uri,
Action<? super RequestSpec> requestConfigurer)
An asynchronous method to do a HTTP request, the URL and all details of the request are configured by the Action acting on the RequestSpec,
the received response content will be streamed.
|
Modifier and Type | Method and Description |
---|---|
static Promise<UserProfile> |
RatpackPac4j.login(Context ctx,
Class<? extends Client<?,?>> clientType)
Logs the user in by redirecting to the authenticator, or provides the user profile if already logged in.
|
static Promise<Optional<UserProfile>> |
RatpackPac4j.userProfile(Context ctx)
Obtains the logged in user's profile, if the user is logged in.
|
static <T extends UserProfile> |
RatpackPac4j.userProfile(Context ctx,
Class<T> type)
Obtains the logged in user's profile, of the given type, if the user is logged in.
|
static Promise<WebContext> |
RatpackPac4j.webContext(Context ctx)
Creates a Pac4j
WebContext implementation based on Ratpack's context. |
Modifier and Type | Method and Description |
---|---|
Promise<T> |
RenderableDecorator.decorate(Context context,
T object)
Decorates the given object on its way to being rendered.
|
Modifier and Type | Method and Description |
---|---|
static <T> RenderableDecorator<T> |
RenderableDecorator.ofAsync(Class<T> type,
BiFunction<? super Context,? super T,? extends Promise<T>> impl)
Creates a renderable decorator implementation for the given type that uses the function as decorator.
|
Modifier and Type | Method and Description |
---|---|
static <T> Promise<List<T>> |
RxRatpack.promise(Observable.OnSubscribe<T> onSubscribe)
Converts an
Observable into a Promise , for all of the observable's items. |
static <T> Promise<List<T>> |
RxRatpack.promise(Observable<T> observable)
Converts an
Observable into a Promise , for all of the observable's items. |
static <T> Promise<T> |
RxRatpack.promiseSingle(Observable.OnSubscribe<T> onSubscribe)
Converts an
Observable into a Promise , for the observable's single item. |
static <T> Promise<T> |
RxRatpack.promiseSingle(Observable<T> observable)
Converts an
Observable into a Promise , for the observable's single item. |
Modifier and Type | Method and Description |
---|---|
static <T> Observable<T> |
RxRatpack.observe(Promise<T> promise)
Converts a
Promise into an Observable . |
static <T,I extends Iterable<T>> |
RxRatpack.observeEach(Promise<I> promise)
Converts a
Promise for an iterable into an Observable . |
Modifier and Type | Method and Description |
---|---|
default <T> Promise<Optional<T>> |
Session.get(Class<T> type)
A convenience shorthand for
SessionData.get(Class) . |
default <T> Promise<Optional<T>> |
Session.get(Class<T> type,
SessionSerializer serializer)
A convenience shorthand for
SessionData.get(Class, SessionSerializer) . |
default <T> Promise<Optional<T>> |
Session.get(SessionKey<T> key)
A convenience shorthand for
SessionData.get(SessionKey) . |
default <T> Promise<Optional<T>> |
Session.get(SessionKey<T> key,
SessionSerializer serializer)
A convenience shorthand for
SessionData.get(SessionKey, SessionSerializer) . |
default Promise<Optional<?>> |
Session.get(String name)
A convenience shorthand for
SessionData.get(String) . |
default Promise<Optional<?>> |
Session.get(String name,
SessionSerializer serializer)
A convenience shorthand for
SessionData.get(String, SessionSerializer) . |
Promise<SessionData> |
Session.getData()
The session data.
|
default Promise<Set<SessionKey<?>>> |
Session.getKeys()
A convenience shorthand for
SessionData.getKeys() . |
Promise<ByteBuf> |
SessionStore.load(AsciiString sessionId)
Reads the session data for the given id.
|
default <T> Promise<T> |
Session.require(Class<T> type)
A convenience shorthand for
SessionData.require(Class) . |
default <T> Promise<T> |
Session.require(Class<T> type,
SessionSerializer serializer)
A convenience shorthand for
SessionData.require(Class, SessionSerializer) . |
default <T> Promise<T> |
Session.require(SessionKey<T> key)
A convenience shorthand for
SessionData.require(SessionKey) . |
default <T> Promise<T> |
Session.require(SessionKey<T> key,
SessionSerializer serializer)
A convenience shorthand for
SessionData.require(SessionKey, SessionSerializer) . |
default Promise<?> |
Session.require(String name)
A convenience shorthand for
SessionData.require(String) . |
default Promise<?> |
Session.require(String name,
SessionSerializer serializer)
A convenience shorthand for
SessionData.require(String, SessionSerializer) . |
Promise<Long> |
SessionStore.size()
The current number of sessions.
|
Modifier and Type | Method and Description |
---|---|
default Promise<TransformablePublisher<Event<?>>> |
ServerSentEventStreamClient.request(URI uri) |
Promise<TransformablePublisher<Event<?>>> |
ServerSentEventStreamClient.request(URI uri,
Action<? super RequestSpec> action) |
Modifier and Type | Method and Description |
---|---|
default Promise<List<T>> |
TransformablePublisher.toList()
Consumes the given publisher's items to a list.
|
static <T> Promise<List<T>> |
Streams.toList(Publisher<T> publisher)
Creates a promise for the given publisher's items as a List.
|
default Promise<T> |
TransformablePublisher.toPromise()
|
static <T> Promise<T> |
Streams.toPromise(Publisher<T> publisher)
Creates a promise for the given publisher's single item.
|
Modifier and Type | Method and Description |
---|---|
default <O> TransformablePublisher<O> |
TransformablePublisher.flatMap(Function<? super T,? extends Promise<? extends O>> function)
|
static <I,O> TransformablePublisher<O> |
Streams.flatMap(Publisher<I> input,
Function<? super I,? extends Promise<? extends O>> function)
Returns a publisher that publishes items from the given input publisher after transforming each item via the given, promise returning, function.
|
static <T> TransformablePublisher<T> |
Streams.flatYield(Function<? super YieldRequest,? extends Promise<? extends T>> producer)
Creates a new publisher, backed by the given asynchronous data producing function.
|
Modifier and Type | Method and Description |
---|---|
<T> ExecResult<T> |
ExecHarness.yield(Action<? super RegistrySpec> registry,
Function<? super Execution,? extends Promise<T>> func)
Synchronously returns a promised value.
|
default <T> ExecResult<T> |
ExecHarness.yield(Function<? super Execution,? extends Promise<T>> func)
Synchronously returns a promised value.
|
static <T> ExecResult<T> |
ExecHarness.yieldSingle(Action<? super RegistrySpec> registry,
Function<? super Execution,? extends Promise<T>> func)
Creates an exec harness,
executes the given function with it before closing it, then returning execution result. |
static <T> ExecResult<T> |
ExecHarness.yieldSingle(Function<? super Execution,? extends Promise<T>> func)
Creates an exec harness,
executes the given function with it before closing it, then returning execution result. |
Modifier and Type | Method and Description |
---|---|
static <T> TypeToken<Promise<T>> |
Types.promiseOf(Class<T> type)
Creates a type token for a promise of of the given type.
|
static <T> TypeToken<Promise<T>> |
Types.promiseOf(TypeToken<T> type)
Creates a type token for a promise of of the given type.
|