Package org.apache.catalina.core
Class ApplicationPushBuilder
java.lang.Object
org.apache.catalina.core.ApplicationPushBuilder
- All Implemented Interfaces:
PushBuilder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds an HTTP header to the request.Obtain a value for the given HTTP header.Obtain the name of the HTTP method that will be used for push requests generated by future calls topush()
.getPath()
Obtain the path that will be used for the push request that will be generated by the next call topush()
.Obtain the query string that will be used for push requests generated by future calls topush()
.Obtain the session ID that will be used for push requests generated by future calls topush()
.Specify the HTTP method to use for the push request.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.queryString
(String queryString) Specifies the query string to use in subsequent push requests generated by a call toPushBuilder.push()
.removeHeader
(String name) Removes an HTTP header from the request.Specifies the session ID to use in subsequent push requests generated by a call toPushBuilder.push()
.Sets an HTTP header on the request.
-
Constructor Details
-
ApplicationPushBuilder
-
-
Method Details
-
path
Description copied from interface:jakarta.servlet.http.PushBuilder
Sets the URI path to be used for the push request. This must be called before every call toPushBuilder.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.- Specified by:
path
in interfacePushBuilder
- Parameters:
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.- Returns:
- This builder instance
-
getPath
Description copied from interface:jakarta.servlet.http.PushBuilder
Obtain the path that will be used for the push request that will be generated by the next call topush()
.- Specified by:
getPath
in interfacePushBuilder
- Returns:
- The path value that will be associated with the next push request
-
method
Description copied from interface:jakarta.servlet.http.PushBuilder
Specify the HTTP method to use for the push request.- Specified by:
method
in interfacePushBuilder
- Parameters:
method
- The method to use for the push request- Returns:
- This builder instance
-
getMethod
Description copied from interface:jakarta.servlet.http.PushBuilder
Obtain the name of the HTTP method that will be used for push requests generated by future calls topush()
.- Specified by:
getMethod
in interfacePushBuilder
- Returns:
- The HTTP method to be used for future push requests
-
queryString
Description copied from interface:jakarta.servlet.http.PushBuilder
Specifies the query string to use in subsequent push requests generated by a call toPushBuilder.push()
. This will be appended to any query string specified in the call toPushBuilder.path(String)
.- Specified by:
queryString
in interfacePushBuilder
- Parameters:
queryString
- The query string to use to generate push requests- Returns:
- This builder instance
-
getQueryString
Description copied from interface:jakarta.servlet.http.PushBuilder
Obtain the query string that will be used for push requests generated by future calls topush()
.- Specified by:
getQueryString
in interfacePushBuilder
- Returns:
- The query string that will be appended to push requests.
-
sessionId
Description copied from interface:jakarta.servlet.http.PushBuilder
Specifies the session ID to use in subsequent push requests generated by a call toPushBuilder.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
- Specified by:
sessionId
in interfacePushBuilder
- Parameters:
sessionId
- The session ID to use to generate push requests- Returns:
- This builder instance
-
getSessionId
Description copied from interface:jakarta.servlet.http.PushBuilder
Obtain the session ID that will be used for push requests generated by future calls topush()
.- Specified by:
getSessionId
in interfacePushBuilder
- Returns:
- The session that will be used for push requests.
-
addHeader
Description copied from interface:jakarta.servlet.http.PushBuilder
Adds an HTTP header to the request.- Specified by:
addHeader
in interfacePushBuilder
- Parameters:
name
- The name of the header to addvalue
- The value of the header to add- Returns:
- This builder instance
-
setHeader
Description copied from interface:jakarta.servlet.http.PushBuilder
Sets an HTTP header on the request. Any existing headers of the same name are first remove.- Specified by:
setHeader
in interfacePushBuilder
- Parameters:
name
- The name of the header to setvalue
- The value of the header to set- Returns:
- This builder instance
-
removeHeader
Description copied from interface:jakarta.servlet.http.PushBuilder
Removes an HTTP header from the request.- Specified by:
removeHeader
in interfacePushBuilder
- Parameters:
name
- The name of the header to remove- Returns:
- This builder instance
-
getHeaderNames
- Specified by:
getHeaderNames
in interfacePushBuilder
- Returns:
- The current set of names of HTTP headers to be used the next time
push()
is called.
-
getHeader
Description copied from interface:jakarta.servlet.http.PushBuilder
Obtain a value for the given HTTP header. TODO Servlet 4.0 Clarify the behaviour of this method- Specified by:
getHeader
in interfacePushBuilder
- Parameters:
name
- The name of the header whose value is to be returned- Returns:
- The value of the given header. If multiple values are defined then any may be returned
-
push
public void push()Description copied from interface:jakarta.servlet.http.PushBuilder
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 tonull
:path
- conditional request headers (
if-none-match
andif-modified-since
)
- Specified by:
push
in interfacePushBuilder
-