public interface PushBuilder
HttpServletRequest
from which this
builder was obtained. The push request will be constructed on the following
basis:
GET
.path(String)
.HttpServletRequest.getRequestURL()
plus, if present, the query
string from HttpServletRequest.getQueryString()
.
Modifier and Type | Method and Description |
---|---|
PushBuilder |
addHeader(String name,
String value)
Adds a HTTP header to the request.
|
String |
getHeader(String name)
Obtain a value for the given HTTP header.
|
Set<String> |
getHeaderNames() |
String |
getMethod()
Obtain the name of the HTTP method that will be used for push requests
generated by future calls to
push() . |
String |
getPath()
Obtain the path that will be used for the push request that will be
generated by the next call to
push() . |
String |
getQueryString()
Obtain the query string that will be used for push requests generated by
future calls to
push() . |
String |
getSessionId()
Obtain the session ID that will be used for push requests generated by
future calls to
push() . |
PushBuilder |
method(String method)
Specify the HTTP method to use for the push request.
|
PushBuilder |
path(String path)
Sets the URI path to be used for the push request.
|
void |
push()
Generates the push request and sends it to the client unless pushes are
not available for some reason.
|
PushBuilder |
queryString(String queryString)
Specifies the query string to use in subsequent push requests generated
by a call to
push() . |
PushBuilder |
removeHeader(String name)
Removes an HTTP header from the request.
|
PushBuilder |
sessionId(String sessionId)
Specifies the session ID to use in subsequent push requests generated
by a call to
push() . |
PushBuilder |
setHeader(String name,
String value)
Sets a HTTP header on the request.
|
PushBuilder method(String method)
method
- The method to use for the push requestIllegalArgumentException
- if an HTTP method is specified that is
known not to be cacheable
and safe. POST, PUT, DELETE, CONNECT, OPTIONS and TRACE will
trigger the exception.PushBuilder queryString(String queryString)
push()
. This will be appended to any query string
specified in the call to path(String)
.queryString
- The query string to use to generate push requestsPushBuilder sessionId(String sessionId)
push()
. The session ID will be presented the same
way as it is on the original request (cookie or URL parameter). The
default is determined in the following order:
null
sessionId
- The session ID to use to generate push requestsPushBuilder setHeader(String name, String value)
name
- The name of the header to setvalue
- The value of the header to setPushBuilder addHeader(String name, String value)
name
- The name of the header to addvalue
- The value of the header to addPushBuilder removeHeader(String name)
name
- The name of the header to removePushBuilder path(String path)
push()
. If the path includes a query
string, the query string will be appended to the existing query string
(if any) and no de-duplication will occur.path
- Paths beginning with '/' are treated as absolute paths. All
other paths are treated as relative to the context path of
the request used to create this builder instance. The path
may include a query string.void push()
null
:
path
eTag
lastModified
IllegalStateException
- If this method is called when path
is null
IllegalArgumentException
- If the request to push requires a bodyString getMethod()
push()
.String getQueryString()
push()
.String getSessionId()
push()
.Set<String> getHeaderNames()
push()
is called.String getHeader(String name)
name
- The name of the header whose value is to be returnedString getPath()
push()
.Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.