Package org.eclipse.jetty.server
Class FormFields
java.lang.Object
java.util.concurrent.CompletableFuture<X>
org.eclipse.jetty.io.content.ContentSourceCompletableFuture<Fields>
org.eclipse.jetty.server.FormFields
- All Implemented Interfaces:
CompletionStage<Fields>
,Future<Fields>
A CompletableFuture
that is completed once a application/x-www-form-urlencoded
content has been parsed asynchronously from the Content.Source
.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.CompletableFuture
CompletableFuture.AsynchronousCompletionTask
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CompletableFuture<Fields>
Find or create aFormFields
from aContent.Source
.static CompletableFuture<Fields>
Find or create aFormFields
from aContent.Source
.static CompletableFuture<Fields>
Find or create aFormFields
from aContent.Source
.static CompletableFuture<Fields>
Find or create aFormFields
from aContent.Source
.static CompletableFuture<Fields>
static Charset
getFormEncodedCharset
(Request request) protected Fields
parse
(Content.Chunk chunk) Called byContentSourceCompletableFuture.parse()
to parse aContent.Chunk
.static void
set
(Request request, CompletableFuture<Fields> fields) Set aFields
or related failure for the requestMethods inherited from class org.eclipse.jetty.io.content.ContentSourceCompletableFuture
onTransientFailure, parse
Methods inherited from class java.util.concurrent.CompletableFuture
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, cancel, complete, completeAsync, completeAsync, completedFuture, completedStage, completeExceptionally, completeOnTimeout, copy, defaultExecutor, delayedExecutor, delayedExecutor, exceptionally, exceptionallyAsync, exceptionallyAsync, exceptionallyCompose, exceptionallyComposeAsync, exceptionallyComposeAsync, failedFuture, failedStage, get, get, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, join, minimalCompletionStage, newIncompleteFuture, obtrudeException, obtrudeValue, orTimeout, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, supplyAsync, supplyAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, toString, whenComplete, whenCompleteAsync, whenCompleteAsync
-
Field Details
-
MAX_FIELDS_ATTRIBUTE
- See Also:
-
MAX_LENGTH_ATTRIBUTE
- See Also:
-
MAX_FIELDS_DEFAULT
public static final int MAX_FIELDS_DEFAULT- See Also:
-
MAX_LENGTH_DEFAULT
public static final int MAX_LENGTH_DEFAULT- See Also:
-
-
Method Details
-
getFormEncodedCharset
-
set
Set aFields
or related failure for the request- Parameters:
request
- The request to which to associate the fields withfields
- ACompletableFuture
that will provide either the fields or a failure.
-
get
- Parameters:
request
- The request to enquire from- Returns:
- A
CompletableFuture
that will provide either the fields or a failure, or null if none set. - See Also:
-
from
Find or create aFormFields
from aContent.Source
.- Parameters:
request
- TheRequest
in which to look for an existingFormFields
attribute, using the classname as the attribute name, else the request is used as aContent.Source
from which to read the fields and set the attribute.- Returns:
- A
CompletableFuture
that will provide theFields
or a failure. - See Also:
-
from(Content.Source, Attributes, Charset, int, int)
-
from
Find or create aFormFields
from aContent.Source
.- Parameters:
request
- TheRequest
in which to look for an existingFormFields
attribute, using the classname as the attribute name, else the request is used as aContent.Source
from which to read the fields and set the attribute.charset
- theCharset
to use for byte to string conversion.- Returns:
- A
CompletableFuture
that will provide theFields
or a failure. - See Also:
-
from(Content.Source, Attributes, Charset, int, int)
-
from
Find or create aFormFields
from aContent.Source
.- Parameters:
request
- TheRequest
in which to look for an existingFormFields
attribute, using the classname as the attribute name, else the request is used as aContent.Source
from which to read the fields and set the attribute.maxFields
- The maximum number of fields to be parsedmaxLength
- The maximum total size of the fields- Returns:
- A
CompletableFuture
that will provide theFields
or a failure. - See Also:
-
from(Content.Source, Attributes, Charset, int, int)
-
from
public static CompletableFuture<Fields> from(Request request, Charset charset, int maxFields, int maxLength) Find or create aFormFields
from aContent.Source
.- Parameters:
request
- TheRequest
in which to look for an existingFormFields
attribute, using the classname as the attribute name, else the request is used as aContent.Source
from which to read the fields and set the attribute.charset
- theCharset
to use for byte to string conversion.maxFields
- The maximum number of fields to be parsedmaxLength
- The maximum total size of the fields- Returns:
- A
CompletableFuture
that will provide theFields
or a failure. - See Also:
-
from(Content.Source, Attributes, Charset, int, int)
-
parse
Description copied from class:ContentSourceCompletableFuture
Called by
ContentSourceCompletableFuture.parse()
to parse aContent.Chunk
.- Specified by:
parse
in classContentSourceCompletableFuture<Fields>
- Parameters:
chunk
- The chunk containing content to parse. The chunk will never benull
nor afailure chunk
. If the chunk is stored away to be used later beyond the scope of this call, then implementations must callRetainable.retain()
andRetainable.release()
as appropriate.- Returns:
- The parsed
X
result instance ornull
if parsing is not yet complete - Throws:
CharacterCodingException
-