public class PushBuilderImpl extends Object implements PushBuilder
| Constructor and Description |
|---|
PushBuilderImpl(HttpServletRequestImpl servletRequest) |
| Modifier and Type | Method and Description |
|---|---|
PushBuilder |
addHeader(String name,
String value)
Add a request header to be used for the push.
|
String |
getHeader(String name)
Return the header of the given name to be used for the push.
|
Set<String> |
getHeaderNames()
Return the set of header to be used for the push.
|
String |
getMethod()
Return the method to be used for the push.
|
String |
getPath()
Return the URI path to be used for the push.
|
String |
getQueryString()
Return the query string to be used for the push.
|
String |
getSessionId()
Return the SessionID to be used for the push.
|
PushBuilder |
method(String method)
Set the method to be used for the push.
|
PushBuilder |
path(String path)
Set the URI path to be used for the push.
|
void |
push()
Push a resource given the current state of the builder,
the method must be non-blocking.
|
PushBuilder |
queryString(String queryString)
Set the query string to be used for the push.
|
PushBuilder |
removeHeader(String name)
Remove the named request header.
|
PushBuilder |
sessionId(String sessionId)
Set the SessionID to be used for the push.
|
PushBuilder |
setHeader(String name,
String value)
Set a request header to be used for the push.
|
public PushBuilderImpl(HttpServletRequestImpl servletRequest)
public PushBuilder method(String method)
PushBuilderSet the method to be used for the push.
method in interface PushBuildermethod - the method to be used for the push.public PushBuilder queryString(String queryString)
PushBuilderPushBuilder.path(String). Any duplicate parameters must be preserved.
This method should be used instead of a query in PushBuilder.path(String)
when multiple PushBuilder.push() calls are to be made with the same
query string.queryString in interface PushBuilderqueryString - the query string to be used for the push.public PushBuilder sessionId(String sessionId)
PushBuildersessionId in interface PushBuildersessionId - the SessionID to be used for the push.public PushBuilder setHeader(String name, String value)
PushBuilderSet a request header to be used for the push. If the builder has an existing header with the same name, its value is overwritten.
setHeader in interface PushBuildername - The header name to setvalue - The header value to setpublic PushBuilder addHeader(String name, String value)
PushBuilderAdd a request header to be used for the push.
addHeader in interface PushBuildername - The header name to addvalue - The header value to addpublic PushBuilder removeHeader(String name)
PushBuilderRemove the named request header. If the header does not exist, take no action.
removeHeader in interface PushBuildername - The name of the header to removepublic PushBuilder path(String path)
PushBuilderPushBuilder.path(String) must
be called before every call to PushBuilder.push(). If a query
string is present in the argument path, its contents must
be merged with the contents previously passed to PushBuilder.queryString(java.lang.String), preserving duplicates.path in interface PushBuilderpath - the URI path to be used for the push, which may include a
query string.public void push()
PushBuilderPush a resource based on the current state of the PushBuilder. Calling this method does not guarantee the resource will actually be pushed, since it is possible the client can decline acceptance of the pushed resource using the underlying HTTP/2 protocol.
If the builder has a session ID, then the pushed request will include the session ID either as a Cookie or as a URI parameter as appropriate. The builders query string is merged with any passed query string.
Before returning from this method, the builder has its path, conditional headers (defined in RFC 7232) nulled. All other fields are left as is for possible reuse in another push.
push in interface PushBuilderpublic String getMethod()
PushBuildergetMethod in interface PushBuilderpublic String getQueryString()
PushBuildergetQueryString in interface PushBuilderpublic String getSessionId()
PushBuildergetSessionId in interface PushBuilderpublic Set<String> getHeaderNames()
PushBuilderThe returned set is not backed by the PushBuilder object,
so changes in the returned set are not reflected in the
PushBuilder object, and vice-versa.
getHeaderNames in interface PushBuilderpublic String getHeader(String name)
PushBuildergetHeader in interface PushBuildername - the name of the headerpublic String getPath()
PushBuildergetPath in interface PushBuilderCopyright © 2019 JBoss by Red Hat. All rights reserved.