Top Fields Constructors Methods
io.undertow.servlet.spec

public Class PushBuilderImpl

extends Object
implements PushBuilder
Class Inheritance
All Implemented Interfaces
jakarta.servlet.http.PushBuilder
Imports
io.undertow.server.ServerConnection, io.undertow.server.handlers.Cookie, io.undertow.servlet.UndertowServletMessages, io.undertow.util.HeaderMap, .HeaderValues, .Headers, .HttpString, .Methods, jakarta.servlet.http.HttpSession, .PushBuilder, java.util.Collections, .HashSet, .Iterator, .Set

Authors
Stuart Douglas, Richard Opalka

Field Summary

Modifier and TypeField and Description
private static final Set<HttpString>
private final HeaderMap
private static final Set<HttpString>
private static final Set<String>
private String
private String
private String
private final HttpServletRequestImpl
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public PushBuilder
addHeader(String
The header name to add
name
,
String
The header value to add
value
)

Implements jakarta.servlet.http.PushBuilder.addHeader.

Add a request header to be used for the push.

public String
getHeader(String
the name of the header
name
)

Implements jakarta.servlet.http.PushBuilder.getHeader.

Return the header of the given name to be used for the push.

public Set<String>
getHeaderNames()

Implements jakarta.servlet.http.PushBuilder.getHeaderNames.

Return the set of header to be used for the push.

public String
getMethod()

Implements jakarta.servlet.http.PushBuilder.getMethod.

Return the method to be used for the push.

public String
getPath()

Implements jakarta.servlet.http.PushBuilder.getPath.

Return the URI path to be used for the push.

public String
getQueryString()

Implements jakarta.servlet.http.PushBuilder.getQueryString.

Return the query string to be used for the push.

public String
getSessionId()

Implements jakarta.servlet.http.PushBuilder.getSessionId.

Return the SessionID to be used for the push.

public PushBuilder
method(String
the method to be used for the push.
method
)

Implements jakarta.servlet.http.PushBuilder.method.

Set the method to be used for the push.

public PushBuilder
path(String
the URI path to be used for the push, which may include a query string.
path
)

Implements jakarta.servlet.http.PushBuilder.path.

Set the URI path to be used for the push.

public void
push()

Implements jakarta.servlet.http.PushBuilder.push.

Push a resource given the current state of the builder, the method must be non-blocking.

public PushBuilder
queryString(String
the query string to be used for the push.
queryString
)

Implements jakarta.servlet.http.PushBuilder.queryString.

Set the query string to be used for the push.

public PushBuilder
removeHeader(String
The name of the header to remove
name
)

Implements jakarta.servlet.http.PushBuilder.removeHeader.

Remove the named request header.

public PushBuilder
sessionId(String
the SessionID to be used for the push.
sessionId
)

Implements jakarta.servlet.http.PushBuilder.sessionId.

Set the SessionID to be used for the push.

public PushBuilder
setHeader(String
The header name to set
name
,
String
The header value to set
value
)

Implements jakarta.servlet.http.PushBuilder.setHeader.

Set a request header to be used for the push.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CONDITIONALback to summary
private static final Set<HttpString> CONDITIONAL
headersback to summary
private final HeaderMap headers
IGNOREback to summary
private static final Set<HttpString> IGNORE
INVALID_METHODback to summary
private static final Set<String> INVALID_METHOD
methodback to summary
private String method
pathback to summary
private String path
queryStringback to summary
private String queryString
servletRequestback to summary
private final HttpServletRequestImpl servletRequest
sessionIdback to summary
private String sessionId

Constructor Detail

PushBuilderImplback to summary
public PushBuilderImpl(HttpServletRequestImpl servletRequest)

Method Detail

addHeaderback to summary
public PushBuilder addHeader(String name, String value)

Implements jakarta.servlet.http.PushBuilder.addHeader.

Doc from jakarta.servlet.http.PushBuilder.addHeader.

Add a request header to be used for the push.

Parameters
name:String

The header name to add

value:String

The header value to add

Returns:PushBuilder

this builder.

Annotations
@Override
getHeaderback to summary
public String getHeader(String name)

Implements jakarta.servlet.http.PushBuilder.getHeader.

Doc from jakarta.servlet.http.PushBuilder.getHeader.

Return the header of the given name to be used for the push.

Parameters
name:String

the name of the header

Returns:String

the header of the given name to be used for the push.

Annotations
@Override
getHeaderNamesback to summary
public Set<String> getHeaderNames()

Implements jakarta.servlet.http.PushBuilder.getHeaderNames.

Doc from jakarta.servlet.http.PushBuilder.getHeaderNames.

Return the set of header to be used for the push.

The 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.

Returns:Set<String>

the set of header to be used for the push.

Annotations
@Override
getMethodback to summary
public String getMethod()

Implements jakarta.servlet.http.PushBuilder.getMethod.

Doc from jakarta.servlet.http.PushBuilder.getMethod.

Return the method to be used for the push.

Returns:String

the method to be used for the push.

Annotations
@Override
getPathback to summary
public String getPath()

Implements jakarta.servlet.http.PushBuilder.getPath.

Doc from jakarta.servlet.http.PushBuilder.getPath.

Return the URI path to be used for the push.

Returns:String

the URI path to be used for the push.

Annotations
@Override
getQueryStringback to summary
public String getQueryString()

Implements jakarta.servlet.http.PushBuilder.getQueryString.

Doc from jakarta.servlet.http.PushBuilder.getQueryString.

Return the query string to be used for the push.

Returns:String

the query string to be used for the push.

Annotations
@Override
getSessionIdback to summary
public String getSessionId()

Implements jakarta.servlet.http.PushBuilder.getSessionId.

Doc from jakarta.servlet.http.PushBuilder.getSessionId.

Return the SessionID to be used for the push.

Returns:String

the SessionID to be used for the push.

Annotations
@Override
methodback to summary
public PushBuilder method(String method)

Implements jakarta.servlet.http.PushBuilder.method.

Doc from jakarta.servlet.http.PushBuilder.method.

Set the method to be used for the push.

Parameters
method:String

the method to be used for the push.

Returns:PushBuilder

this builder.

Annotations
@Override
pathback to summary
public PushBuilder path(String path)

Implements jakarta.servlet.http.PushBuilder.path.

Doc from jakarta.servlet.http.PushBuilder.path.

Set the URI path to be used for the push. The path may start with "/" in which case it is treated as an absolute path, otherwise it is relative to the context path of the associated request. There is no path default and path(String) must be called before every call to push(). If a query string is present in the argument path, its contents must be merged with the contents previously passed to queryString, preserving duplicates.

Parameters
path:String

the URI path to be used for the push, which may include a query string.

Returns:PushBuilder

this builder.

Annotations
@Override
pushback to summary
public void push()

Implements jakarta.servlet.http.PushBuilder.push.

Doc from jakarta.servlet.http.PushBuilder.push.

Push a resource given the current state of the builder, the method must be non-blocking.

Push 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.

Annotations
@Override
queryStringback to summary
public PushBuilder queryString(String queryString)

Implements jakarta.servlet.http.PushBuilder.queryString.

Doc from jakarta.servlet.http.PushBuilder.queryString.

Set the query string to be used for the push. The query string will be appended to any query String included in a call to path(String). Any duplicate parameters must be preserved. This method should be used instead of a query in path(String) when multiple push() calls are to be made with the same query string.

Parameters
queryString:String

the query string to be used for the push.

Returns:PushBuilder

this builder.

Annotations
@Override
removeHeaderback to summary
public PushBuilder removeHeader(String name)

Implements jakarta.servlet.http.PushBuilder.removeHeader.

Doc from jakarta.servlet.http.PushBuilder.removeHeader.

Remove the named request header. If the header does not exist, take no action.

Parameters
name:String

The name of the header to remove

Returns:PushBuilder

this builder.

Annotations
@Override
sessionIdback to summary
public PushBuilder sessionId(String sessionId)

Implements jakarta.servlet.http.PushBuilder.sessionId.

Doc from jakarta.servlet.http.PushBuilder.sessionId.

Set the SessionID to be used for the push. The session ID will be set in the same way it was on the associated request (ie as a cookie if the associated request used a cookie, or as a url parameter if the associated request used a url parameter). Defaults to the requested session ID or any newly assigned session id from a newly created session.

Parameters
sessionId:String

the SessionID to be used for the push.

Returns:PushBuilder

this builder.

Annotations
@Override
setHeaderback to summary
public PushBuilder setHeader(String name, String value)

Implements jakarta.servlet.http.PushBuilder.setHeader.

Doc from jakarta.servlet.http.PushBuilder.setHeader.

Set a request header to be used for the push. If the builder has an existing header with the same name, its value is overwritten.

Parameters
name:String

The header name to set

value:String

The header value to set

Returns:PushBuilder

this builder.

Annotations
@Override