Package org.eclipse.jetty.http
Class MetaData
java.lang.Object
org.eclipse.jetty.http.MetaData
- Direct Known Subclasses:
MetaData.Request
,MetaData.Response
Immutable common HTTP information for requests and responses.
Specific HTTP request information is captured by MetaData.Request
.
Specific HTTP response information is captured by MetaData.Response
.
HTTP trailers information is captured by MetaData
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Immutable HTTP CONNECT request information.static class
Immutable HTTP request information.static class
Immutable HTTP response information. -
Constructor Summary
ConstructorDescriptionMetaData
(HttpVersion version, HttpFields fields) MetaData
(HttpVersion version, HttpFields fields, long contentLength) MetaData
(HttpVersion version, HttpFields headers, long contentLength, Supplier<HttpFields> trailersSupplier) -
Method Summary
Modifier and TypeMethodDescriptionlong
Get the length of the content in bytes.Get the HTTP headers or HTTP trailers.Get the HTTP protocol version.boolean
boolean
static boolean
Returns whether the given HTTP request method and HTTP response status code identify a successful HTTP CONNECT tunnel.iterator()
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
MetaData
-
MetaData
-
MetaData
public MetaData(HttpVersion version, HttpFields headers, long contentLength, Supplier<HttpFields> trailersSupplier)
-
-
Method Details
-
isTunnel
Returns whether the given HTTP request method and HTTP response status code identify a successful HTTP CONNECT tunnel.
- Parameters:
method
- the HTTP request methodstatus
- the HTTP response status code- Returns:
- whether method and status identify a successful HTTP CONNECT tunnel
-
isRequest
public boolean isRequest()- Returns:
- whether this object is a
MetaData.Request
-
isResponse
public boolean isResponse()- Returns:
- whether this object is a
MetaData.Response
-
getHttpVersion
Get the HTTP protocol version.- Returns:
- the HTTP protocol version
-
getHttpFields
Get the HTTP headers or HTTP trailers.- Returns:
- the HTTP headers or HTTP trailers
-
getTrailersSupplier
- Returns:
- a supplier for the HTTP trailers
-
getContentLength
public long getContentLength()Get the length of the content in bytes.- Returns:
- the length of the content in bytes
-
iterator
-
toString
-