public class ApplicationPushBuilder extends Object implements PushBuilder
Constructor and Description |
---|
ApplicationPushBuilder(Request catalinaRequest,
HttpServletRequest request) |
Modifier and Type | Method and Description |
---|---|
PushBuilder |
addHeader(String name,
String value)
Adds an 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
PushBuilder.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
PushBuilder.push() . |
PushBuilder |
setHeader(String name,
String value)
Sets an HTTP header on the request.
|
public ApplicationPushBuilder(Request catalinaRequest, HttpServletRequest request)
public PushBuilder path(String path)
javax.servlet.http.PushBuilder
PushBuilder.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
in interface PushBuilder
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.public String getPath()
javax.servlet.http.PushBuilder
push()
.getPath
in interface PushBuilder
public PushBuilder method(String method)
javax.servlet.http.PushBuilder
method
in interface PushBuilder
method
- The method to use for the push requestpublic String getMethod()
javax.servlet.http.PushBuilder
push()
.getMethod
in interface PushBuilder
public PushBuilder queryString(String queryString)
javax.servlet.http.PushBuilder
PushBuilder.push()
. This will be appended to any query string
specified in the call to PushBuilder.path(String)
.queryString
in interface PushBuilder
queryString
- The query string to use to generate push requestspublic String getQueryString()
javax.servlet.http.PushBuilder
push()
.getQueryString
in interface PushBuilder
public PushBuilder sessionId(String sessionId)
javax.servlet.http.PushBuilder
PushBuilder.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
in interface PushBuilder
sessionId
- The session ID to use to generate push requestspublic String getSessionId()
javax.servlet.http.PushBuilder
push()
.getSessionId
in interface PushBuilder
public PushBuilder addHeader(String name, String value)
javax.servlet.http.PushBuilder
addHeader
in interface PushBuilder
name
- The name of the header to addvalue
- The value of the header to addpublic PushBuilder setHeader(String name, String value)
javax.servlet.http.PushBuilder
setHeader
in interface PushBuilder
name
- The name of the header to setvalue
- The value of the header to setpublic PushBuilder removeHeader(String name)
javax.servlet.http.PushBuilder
removeHeader
in interface PushBuilder
name
- The name of the header to removepublic Set<String> getHeaderNames()
getHeaderNames
in interface PushBuilder
push()
is called.public String getHeader(String name)
javax.servlet.http.PushBuilder
getHeader
in interface PushBuilder
name
- The name of the header whose value is to be returnedpublic void push()
javax.servlet.http.PushBuilder
null
:
path
if-none-match
and
if-modified-since
)push
in interface PushBuilder
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.