Top Fields Constructors Methods
org.apache.catalina.core

public Class ApplicationPushBuilder

extends Object
implements PushBuilder
Class Inheritance
All Implemented Interfaces
jakarta.servlet.http.PushBuilder
Imports
java.nio.charset.Charset, java.util.ArrayList, .Arrays, .Collections, .Enumeration, .HashSet, .List, .Locale, .Map, .Set, jakarta.servlet.SessionTrackingMode, jakarta.servlet.http.Cookie, .HttpServletRequest, .HttpSession, .PushBuilder, org.apache.catalina.Context, org.apache.catalina.authenticator.AuthenticatorBase, org.apache.catalina.connector.Request, org.apache.catalina.util.SessionConfig, org.apache.coyote.ActionCode, org.apache.tomcat.util.buf.HexUtils, .MessageBytes, org.apache.tomcat.util.collections.CaseInsensitiveKeyMap, org.apache.tomcat.util.http.CookieProcessor, org.apache.tomcat.util.http.parser.HttpParser, org.apache.tomcat.util.res.StringManager

Field Summary

Modifier and TypeField and Description
private final boolean
private final boolean
private final HttpServletRequest
private final Request
private final List<Cookie>
private final Request
private static final Set<String>
private final Map<String, List<String>>
private String
private String
private String
private final String
private String
private final String
private static final StringManager
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

Implements jakarta.servlet.http.PushBuilder.addHeader.

Adds an HTTP header to the request.

pack-priv static String
decode(String input, Charset charset)

private static String
private static String
generateCookieHeader(List<Cookie> cookies, CookieProcessor cookieProcessor)

public String
getHeader(String
The name of the header whose value is to be returned
name
)

Implements jakarta.servlet.http.PushBuilder.getHeader.

Obtain a value for the given HTTP header.

public Set<String>
public String
getMethod()

Implements jakarta.servlet.http.PushBuilder.getMethod.

Obtain the name of the HTTP method that will be used for push requests generated by future calls to push().

public String
getPath()

Implements jakarta.servlet.http.PushBuilder.getPath.

Obtain the path that will be used for the push request that will be generated by the next call to push().

public String
getQueryString()

Implements jakarta.servlet.http.PushBuilder.getQueryString.

Obtain the query string that will be used for push requests generated by future calls to push().

public String
getSessionId()

Implements jakarta.servlet.http.PushBuilder.getSessionId.

Obtain the session ID that will be used for push requests generated by future calls to push().

public PushBuilder
method(String
The method to use for the push request
method
)

Implements jakarta.servlet.http.PushBuilder.method.

Specify the HTTP method to use for the push request.

public PushBuilder
path(String
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.
path
)

Implements jakarta.servlet.http.PushBuilder.path.

Sets the URI path to be used for the push request.

public void
push()

Implements jakarta.servlet.http.PushBuilder.push.

Generates the push request and sends it to the client unless pushes are not available for some reason.

public PushBuilder
queryString(String
The query string to use to generate push requests
queryString
)

Implements jakarta.servlet.http.PushBuilder.queryString.

Specifies the query string to use in subsequent push requests generated by a call to push().

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

Implements jakarta.servlet.http.PushBuilder.removeHeader.

Removes an HTTP header from the request.

public PushBuilder
sessionId(String
The session ID to use to generate push requests
sessionId
)

Implements jakarta.servlet.http.PushBuilder.sessionId.

Specifies the session ID to use in subsequent push requests generated by a call to push().

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

Implements jakarta.servlet.http.PushBuilder.setHeader.

Sets an HTTP header on the request.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

addSessionCookieback to summary
private final boolean addSessionCookie
addSessionPathParameterback to summary
private final boolean addSessionPathParameter
baseRequestback to summary
private final HttpServletRequest baseRequest
catalinaRequestback to summary
private final Request catalinaRequest
cookiesback to summary
private final List<Cookie> cookies
coyoteRequestback to summary
private final Request coyoteRequest
DISALLOWED_METHODSback to summary
private static final Set<String> DISALLOWED_METHODS
headersback to summary
private final Map<String, List<String>> headers
methodback to summary
private String method
pathback to summary
private String path
queryStringback to summary
private String queryString
sessionCookieNameback to summary
private final String sessionCookieName
sessionIdback to summary
private String sessionId
sessionPathParameterNameback to summary
private final String sessionPathParameterName
smback to summary
private static final StringManager sm
userNameback to summary
private String userName

Constructor Detail

ApplicationPushBuilderback to summary
public ApplicationPushBuilder(Request catalinaRequest, HttpServletRequest request)

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.

Adds an HTTP header to the request.

Parameters
name:String

The name of the header to add

value:String

The value of the header to add

Returns:PushBuilder

This builder instance

Annotations
@Override
decodeback to summary
pack-priv static String decode(String input, Charset charset)
decodePercentSequenceback to summary
private static String decodePercentSequence(String sequence, Charset charset)
generateCookieHeaderback to summary
private static String generateCookieHeader(List<Cookie> cookies, CookieProcessor cookieProcessor)
getHeaderback to summary
public String getHeader(String name)

Implements jakarta.servlet.http.PushBuilder.getHeader.

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

Obtain a value for the given HTTP header. TODO Servlet 4.0 Clarify the behaviour of this method

Parameters
name:String

The name of the header whose value is to be returned

Returns:String

The value of the given header. If multiple values are defined then any may be returned

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

Implements jakarta.servlet.http.PushBuilder.getHeaderNames.

Returns:Set<String>

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

The current set of names of HTTP headers to be used the next time push() is called.

Annotations
@Override
getMethodback to summary
public String getMethod()

Implements jakarta.servlet.http.PushBuilder.getMethod.

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

Obtain the name of the HTTP method that will be used for push requests generated by future calls to push().

Returns:String

The HTTP method to be used for future push requests

Annotations
@Override
getPathback to summary
public String getPath()

Implements jakarta.servlet.http.PushBuilder.getPath.

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

Obtain the path that will be used for the push request that will be generated by the next call to push().

Returns:String

The path value that will be associated with the next push request

Annotations
@Override
getQueryStringback to summary
public String getQueryString()

Implements jakarta.servlet.http.PushBuilder.getQueryString.

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

Obtain the query string that will be used for push requests generated by future calls to push().

Returns:String

The query string that will be appended to push requests.

Annotations
@Override
getSessionIdback to summary
public String getSessionId()

Implements jakarta.servlet.http.PushBuilder.getSessionId.

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

Obtain the session ID that will be used for push requests generated by future calls to push().

Returns:String

The session that will be used for push requests.

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

Implements jakarta.servlet.http.PushBuilder.method.

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

Specify the HTTP method to use for the push request.

Parameters
method:String

The method to use for the push request

Returns:PushBuilder

This builder instance

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

Implements jakarta.servlet.http.PushBuilder.path.

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

Sets the URI path to be used for the push request. This must be called before every call to 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.

Parameters
path:String

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.

Returns:PushBuilder

This builder instance

Annotations
@Override
pushback to summary
public void push()

Implements jakarta.servlet.http.PushBuilder.push.

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

Generates the push request and sends it to the client unless pushes are not available for some reason. After calling this method the following fields are set to null:

  • path
  • conditional request headers (if-none-match and if-modified-since)
Annotations
@Override
queryStringback to summary
public PushBuilder queryString(String queryString)

Implements jakarta.servlet.http.PushBuilder.queryString.

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

Specifies the query string to use in subsequent push requests generated by a call to push(). This will be appended to any query string specified in the call to path(String).

Parameters
queryString:String

The query string to use to generate push requests

Returns:PushBuilder

This builder instance

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

Implements jakarta.servlet.http.PushBuilder.removeHeader.

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

Removes an HTTP header from the request.

Parameters
name:String

The name of the header to remove

Returns:PushBuilder

This builder instance

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

Implements jakarta.servlet.http.PushBuilder.sessionId.

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

Specifies the session ID to use in subsequent push requests generated by a call to 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:

  • the requested session ID for the originating request
  • the session ID generated in the originated request
  • null
Parameters
sessionId:String

The session ID to use to generate push requests

Returns:PushBuilder

This builder instance

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.

Sets an HTTP header on the request. Any existing headers of the same name are first remove.

Parameters
name:String

The name of the header to set

value:String

The value of the header to set

Returns:PushBuilder

This builder instance

Annotations
@Override