Package | Description |
---|---|
ratpack.exec |
The execution management.
|
ratpack.exec.util | |
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.
|
static <T> Promise<T> |
Promise.async(Upstream<T> upstream)
Creates a promise for value that will be produced asynchronously.
|
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.cacheIf(Predicate<? super T> shouldCache)
Caches the promise value and provides it to all future subscribers, if it satisfies the predicate.
|
default Promise<T> |
Promise.cacheResultIf(Predicate<? super ExecResult<T>> shouldCache)
Caches the promise result and provides it to all future subscribers, if it satisfies the predicate.
|
default Promise<T> |
Promise.close(AutoCloseable closeable)
Closes the given closeable when the value or error propagates to this point.
|
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 <O> Promise<Pair<O,T>> |
Promise.flatLeft(Function<? super T,? extends Promise<O>> leftFunction)
Transforms the promised value to a
Pair , with the value of the result of the given function as the left . |
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) |
default <E extends Throwable> |
Promise.flatMapError(Class<E> type,
Function<? super E,? extends Promise<T>> function)
Transforms a failure of the given type (potentially into a value) by applying the given function to it.
|
default Promise<T> |
Promise.flatMapError(Function<? super Throwable,? extends Promise<T>> function)
Transforms a failure of the given type (potentially into a value) by applying the given function to it.
|
default Promise<T> |
Promise.flatMapIf(Predicate<? super T> predicate,
Function<? super T,? extends Promise<T>> transformer)
Transforms the promised value by applying the given function to it that returns a promise for the transformed value, if it satisfies the predicate.
|
default <O> Promise<Pair<T,O>> |
Promise.flatRight(Function<? super T,? extends Promise<O>> rightFunction)
Transforms the promised value to a
Pair , with the value of the result of the given function as the right . |
default Promise<T> |
Promise.fork()
Forks a new execution and subscribes to this promise, returning a promise for its value.
|
default Promise<T> |
Promise.fork(Action<? super ExecSpec> execSpec)
Forks a new execution and subscribes to this promise, returning a promise for its value.
|
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(Function<? super T,? extends O> leftFunction)
Transforms the promised value to a
Pair , with the result of the given function as the left . |
default <O> Promise<Pair<O,T>> |
Promise.left(Promise<O> left)
Transforms the promised value to a
Pair , with the value of the given promise as the 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 <E extends Throwable> |
Promise.mapError(Class<E> type,
Function<? super Throwable,? extends T> function)
Transforms a failure of the given type (potentially into a 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 Promise<T> |
Promise.mapIf(Predicate<? super T> predicate,
Function<? super T,? extends T> transformer)
Transforms the promised value by applying the given function to it, if it satisfies the predicate.
|
default Promise<T> |
Promise.next(Action<? super T> action)
Executes the provided, potentially asynchronous,
Action with the promised value as input. |
default <O> Promise<O> |
Promise.next(Promise<O> next)
Deprecated.
replaced by
replace(Promise) as of 1.1.0 |
default Promise<T> |
Promise.nextOp(Function<? super T,? extends Operation> function)
Executes the operation returned by the given function.
|
static <T> Promise<T> |
Promise.of(Upstream<T> upstream)
Deprecated.
replaced by
async(Upstream) |
static <T> Promise<T> |
Promise.ofLazy(Factory<T> factory)
Deprecated.
replaced by
sync(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 <E extends Throwable> |
Promise.onError(Class<E> errorType,
Action<? super E> errorHandler)
Specifies the action to take if the an error of the given type occurs trying to produce the promised value.
|
default Promise<T> |
Promise.onError(Predicate<? super Throwable> predicate,
Action<? super Throwable> errorHandler)
Specifies the action to take if the an error occurs trying to produce the promised value, that the given predicate applies to.
|
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<O> |
Promise.replace(Promise<O> next)
Replaces
this promise with the provided promise for downstream subscribers. |
default <O> Promise<Pair<T,O>> |
Promise.right(Function<? super T,? extends O> rightFunction)
Transforms the promised value to a
Pair , with the result of the given function as the right . |
default <O> Promise<Pair<T,O>> |
Promise.right(Promise<O> right)
Transforms the promised value to a
Pair , with the value of the given promise as the 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.
|
static <T> Promise<T> |
Promise.sync(Factory<T> factory)
Creates a promise for value, synchronously, produced by the given factory.
|
<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 . |
default Promise<T> |
Promise.time(Action<? super Duration> action)
Emits the time taken from when the promise is subscribed to to when the result is available.
|
<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 item.
|
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)
Transforms the promised value to a
Pair , with the value of the given promise as the left . |
default <O> Promise<O> |
Promise.next(Promise<O> next)
Deprecated.
replaced by
replace(Promise) as of 1.1.0 |
static <T> T |
Blocking.on(Promise<T> promise)
Blocks execution waiting for this promise to complete and returns the promised value.
|
default <O> Promise<O> |
Promise.replace(Promise<O> next)
Replaces
this promise with the provided promise for downstream subscribers. |
default <O> Promise<Pair<T,O>> |
Promise.right(Promise<O> right)
Transforms the promised value to a
Pair , with the value of the given promise as the 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 <O> Promise<Pair<O,T>> |
Promise.flatLeft(Function<? super T,? extends Promise<O>> leftFunction)
Transforms the promised value to a
Pair , with the value of the result of the given function as the left . |
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 <E extends Throwable> |
Promise.flatMapError(Class<E> type,
Function<? super E,? extends Promise<T>> function)
Transforms a failure of the given type (potentially into a value) by applying the given function to it.
|
default Promise<T> |
Promise.flatMapError(Function<? super Throwable,? extends Promise<T>> function)
Transforms a failure of the given type (potentially into a value) by applying the given function to it.
|
default Promise<T> |
Promise.flatMapIf(Predicate<? super T> predicate,
Function<? super T,? extends Promise<T>> transformer)
Transforms the promised value by applying the given function to it that returns a promise for the transformed value, if it satisfies the predicate.
|
default <O> Promise<Pair<T,O>> |
Promise.flatRight(Function<? super T,? extends Promise<O>> rightFunction)
Transforms the promised value to a
Pair , with the value of the result of the given function as the right . |
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 |
---|---|
Promise<T> |
Promised.promise()
Creates a new promise for the eventual value.
|
Promise<List<? extends T>> |
Batch.yield()
Processes all the promises of the batch, stopping at the first error.
|
Promise<List<? extends T>> |
ParallelBatch.yield()
Processes all the promises of the batch, stopping at the first error.
|
Promise<List<? extends T>> |
SerialBatch.yield()
Processes all the promises of the batch, stopping at the first error.
|
Promise<List<? extends ExecResult<T>>> |
Batch.yieldAll()
Processes all the promises of the batch, collecting any errors.
|
Promise<List<? extends ExecResult<T>>> |
ParallelBatch.yieldAll()
Processes all the promises of the batch, collecting any errors.
|
Promise<List<? extends ExecResult<T>>> |
SerialBatch.yieldAll()
Processes all the promises of the batch, collecting any errors.
|
Modifier and Type | Method and Description |
---|---|
static <T> ParallelBatch<T> |
ParallelBatch.of(Promise<T>... promises)
Creates a new parallel batch of the given promises.
|
static <T> SerialBatch<T> |
SerialBatch.of(Promise<T>... promises)
Creates a new serial batch of the given promises.
|
Modifier and Type | Method and Description |
---|---|
static <T> ParallelBatch<T> |
ParallelBatch.of(Iterable<? extends Promise<T>> promises)
Creates a new parallel batch of the given promises.
|
static <T> SerialBatch<T> |
SerialBatch.of(Iterable<? extends Promise<T>> promises)
Creates a new serial batch of the given promises.
|
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.
|
Promise<TypedData> |
Request.getBody(Block onTooLarge)
The body of the request.
|
Promise<TypedData> |
Request.getBody(long maxContentLength)
The body of the request allowing up to the provided size for the content.
|
Promise<TypedData> |
Request.getBody(long maxContentLength,
Block onTooLarge)
The body of the request allowing up to the provided size for the content.
|
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 <C extends Credentials,U extends UserProfile> |
RatpackPac4j.login(Context ctx,
Class<? extends Client<C,U>> 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)
Adapts a Ratpack
Context to a Pac4j WebContext . |
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 |
---|---|
static <T,R> Promise<R> |
Streams.reduce(Publisher<T> publisher,
R seed,
BiFunction<R,T,R> reducer)
Reduces the stream to a single value, by applying the given function successively.
|
default <R> Promise<R> |
TransformablePublisher.reduce(R seed,
BiFunction<R,T,R> reducer)
Reduces the stream to a single value, by applying the given function successively.
|
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 |
---|---|
static <T> TransformablePublisher<T> |
Streams.publish(Promise<? extends Iterable<T>> promise)
Converts a
Promise for an iterable into a publishable. |
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<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 the given type.
|