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()
.
If-Modified-Since
or
If-None-Match
were present then isConditional()
will be
set to true
.
Modifier and Type | Method and Description |
---|---|
PushBuilder |
addHeader(java.lang.String name,
java.lang.String value)
Adds a HTTP header to the request.
|
PushBuilder |
conditional(boolean conditional)
Sets if the request will be conditional.
|
PushBuilder |
etag(java.lang.String etag)
Sets the etag to be used for conditional push requests.
|
java.lang.String |
getEtag()
Obtain the etag that will be used for the push request that will be
generated by the next call to
push() . |
java.lang.String |
getHeader(java.lang.String name)
Obtain a value for the given HTTP header.
|
java.util.Set<java.lang.String> |
getHeaderNames() |
java.lang.String |
getLastModified()
Obtain the last modified that will be used for the push request that will
be generated by the next call to
push() . |
java.lang.String |
getMethod()
Obtain the name of the HTTP method that will be used for push requests
generated by future calls to
push() . |
java.lang.String |
getPath()
Obtain the path that will be used for the push request that will be
generated by the next call to
push() . |
java.lang.String |
getQueryString()
Obtain the query string that will be used for push requests generated by
future calls to
push() . |
java.lang.String |
getSessionId()
Obtain the session ID that will be used for push requests generated by
future calls to
push() . |
boolean |
isConditional()
Will push requests generated by future calls to
push() be
conditional. |
PushBuilder |
lastModified(java.lang.String lastModified)
Sets the last modified to be used for conditional push requests.
|
PushBuilder |
method(java.lang.String method)
Specify the HTTP method to use for the push request.
|
PushBuilder |
path(java.lang.String path)
Sets the URI path to be used for the push request.
|
boolean |
push()
Generates the push request and sends it to the client unless pushes are
not available for some reason.
|
PushBuilder |
queryString(java.lang.String queryString)
Specifies the query string to use in subsequent push requests generated
by a call to
push() . |
PushBuilder |
removeHeader(java.lang.String name)
Removes an HTTP header from the request.
|
PushBuilder |
sessionId(java.lang.String sessionId)
Specifies the session ID to use in subsequent push requests generated
by a call to
push() . |
PushBuilder |
setHeader(java.lang.String name,
java.lang.String value)
Sets a HTTP header on the request.
|
PushBuilder method(java.lang.String method)
method
- The method to use for the push requestPushBuilder queryString(java.lang.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(java.lang.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 conditional(boolean conditional)
true
the values from
getEtag()
and getLastModified()
will be used to
construct appropriate headers.conditional
- Should generated push requests be conditionalPushBuilder setHeader(java.lang.String name, java.lang.String value)
name
- The name of the header to setvalue
- The value of the header to setPushBuilder addHeader(java.lang.String name, java.lang.String value)
name
- The name of the header to addvalue
- The value of the header to addPushBuilder removeHeader(java.lang.String name)
name
- The name of the header to removePushBuilder path(java.lang.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.PushBuilder etag(java.lang.String etag)
null
after a call to push()
so it must be
explicitly set for every push request that requires it.etag
- The etag use for the push requestPushBuilder lastModified(java.lang.String lastModified)
null
after a call to push()
so it must be
explicitly set for every push request that requires it.lastModified
- The last modified value to use for the push requestboolean push()
null
:
path
etag
lastModified
true
if the push request was sent to the client,
otherwise false
java.lang.IllegalStateException
- If this method is called when path
is null
java.lang.IllegalArgumentException
- If the request to push requires a bodyjava.lang.String getMethod()
push()
.java.lang.String getQueryString()
push()
.java.lang.String getSessionId()
push()
.boolean isConditional()
push()
be
conditional.true
if push requests will be conditionaljava.util.Set<java.lang.String> getHeaderNames()
push()
is called.java.lang.String getHeader(java.lang.String name)
name
- The name of the header whose value is to be returnedjava.lang.String getPath()
push()
.java.lang.String getEtag()
push()
.java.lang.String getLastModified()
push()
.Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.