Class PushBuilderImpl
- All Implemented Interfaces:
PushBuilder
- Author:
- Stuart Douglas, Richard Opalka
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd a request header to be used for the push.Return the header of the given name to be used for the push.Return the set of header to be used for the push.Return the method to be used for the push.getPath()Return the URI path to be used for the push.Return the query string to be used for the push.Return the SessionID to be used for the push.Set the method to be used for the push.Set the URI path to be used for the push.voidpush()Push a resource given the current state of the builder, the method must be non-blocking.queryString(String queryString) Set the query string to be used for the push.removeHeader(String name) Remove the named request header.Set the SessionID to be used for the push.Set a request header to be used for the push.
-
Constructor Details
-
PushBuilderImpl
-
-
Method Details
-
method
Description copied from interface:PushBuilderSet the method to be used for the push.
- Specified by:
methodin interfacePushBuilder- Parameters:
method- the method to be used for the push.- Returns:
- this builder.
-
queryString
Description copied from interface:PushBuilderSet the query string to be used for the push. The query string will be appended to any query String included in a call toPushBuilder.path(String). Any duplicate parameters must be preserved. This method should be used instead of a query inPushBuilder.path(String)when multiplePushBuilder.push()calls are to be made with the same query string.- Specified by:
queryStringin interfacePushBuilder- Parameters:
queryString- the query string to be used for the push.- Returns:
- this builder.
-
sessionId
Description copied from interface:PushBuilderSet 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.- Specified by:
sessionIdin interfacePushBuilder- Parameters:
sessionId- the SessionID to be used for the push.- Returns:
- this builder.
-
setHeader
Description copied from interface: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.
- Specified by:
setHeaderin interfacePushBuilder- Parameters:
name- The header name to setvalue- The header value to set- Returns:
- this builder.
-
addHeader
Description copied from interface:PushBuilderAdd a request header to be used for the push.
- Specified by:
addHeaderin interfacePushBuilder- Parameters:
name- The header name to addvalue- The header value to add- Returns:
- this builder.
-
removeHeader
Description copied from interface:PushBuilderRemove the named request header. If the header does not exist, take no action.
- Specified by:
removeHeaderin interfacePushBuilder- Parameters:
name- The name of the header to remove- Returns:
- this builder.
-
path
Description copied from interface:PushBuilderSet 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 andPushBuilder.path(String)must be called before every call toPushBuilder.push(). If a query string is present in the argumentpath, its contents must be merged with the contents previously passed toPushBuilder.queryString(java.lang.String), preserving duplicates.- Specified by:
pathin interfacePushBuilder- Parameters:
path- the URI path to be used for the push, which may include a query string.- Returns:
- this builder.
-
push
public void push()Description copied from interface:PushBuilderPush 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.
- Specified by:
pushin interfacePushBuilder
-
getMethod
Description copied from interface:PushBuilderReturn the method to be used for the push.- Specified by:
getMethodin interfacePushBuilder- Returns:
- the method to be used for the push.
-
getQueryString
Description copied from interface:PushBuilderReturn the query string to be used for the push.- Specified by:
getQueryStringin interfacePushBuilder- Returns:
- the query string to be used for the push.
-
getSessionId
Description copied from interface:PushBuilderReturn the SessionID to be used for the push.- Specified by:
getSessionIdin interfacePushBuilder- Returns:
- the SessionID to be used for the push.
-
getHeaderNames
Description copied from interface:PushBuilderReturn the set of header to be used for the push.The returned set is not backed by the
PushBuilderobject, so changes in the returned set are not reflected in thePushBuilderobject, and vice-versa.- Specified by:
getHeaderNamesin interfacePushBuilder- Returns:
- the set of header to be used for the push.
-
getHeader
Description copied from interface:PushBuilderReturn the header of the given name to be used for the push.- Specified by:
getHeaderin interfacePushBuilder- Parameters:
name- the name of the header- Returns:
- the header of the given name to be used for the push.
-
getPath
Description copied from interface:PushBuilderReturn the URI path to be used for the push.- Specified by:
getPathin interfacePushBuilder- Returns:
- the URI path to be used for the push.
-