public class ApplicationPushBuilder extends Object implements PushBuilder
Constructor and Description |
---|
ApplicationPushBuilder(HttpServletRequest request) |
Modifier and Type | Method and Description |
---|---|
ApplicationPushBuilder |
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() . |
ApplicationPushBuilder |
method(String method)
Specify the HTTP method to use for the push request.
|
ApplicationPushBuilder |
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.
|
ApplicationPushBuilder |
queryString(String queryString)
Specifies the query string to use in subsequent push requests generated
by a call to
PushBuilder.push() . |
ApplicationPushBuilder |
removeHeader(String name)
Removes an HTTP header from the request.
|
ApplicationPushBuilder |
sessionId(String sessionId)
Specifies the session ID to use in subsequent push requests generated
by a call to
PushBuilder.push() . |
ApplicationPushBuilder |
setHeader(String name,
String value)
Sets a HTTP header on the request.
|
public ApplicationPushBuilder(HttpServletRequest request)
public ApplicationPushBuilder path(String path)
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()
PushBuilder
push()
.getPath
in interface PushBuilder
public ApplicationPushBuilder method(String method)
PushBuilder
method
in interface PushBuilder
method
- The method to use for the push requestpublic String getMethod()
PushBuilder
push()
.getMethod
in interface PushBuilder
public ApplicationPushBuilder queryString(String queryString)
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()
PushBuilder
push()
.getQueryString
in interface PushBuilder
public ApplicationPushBuilder sessionId(String sessionId)
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()
PushBuilder
push()
.getSessionId
in interface PushBuilder
public ApplicationPushBuilder addHeader(String name, String value)
PushBuilder
addHeader
in interface PushBuilder
name
- The name of the header to addvalue
- The value of the header to addpublic ApplicationPushBuilder setHeader(String name, String value)
PushBuilder
setHeader
in interface PushBuilder
name
- The name of the header to setvalue
- The value of the header to setpublic ApplicationPushBuilder removeHeader(String name)
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)
PushBuilder
getHeader
in interface PushBuilder
name
- The name of the header whose value is to be returnedpublic void push()
PushBuilder
null
:
path
eTag
lastModified
push
in interface PushBuilder
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.