PushBuilderpublic class PushBuilderImpl extends java.lang.Object implements PushBuilder
| Constructor | Description |
|---|---|
PushBuilderImpl(Request request,
org.eclipse.jetty.http.HttpFields fields,
java.lang.String method,
java.lang.String queryString,
java.lang.String sessionId,
boolean conditional) |
| Modifier and Type | Method | Description |
|---|---|---|
PushBuilder |
addHeader(java.lang.String name,
java.lang.String value) |
Add a header to be used for the push.
|
PushBuilder |
conditional(boolean conditional) |
Set if the request is to be conditional.
|
PushBuilder |
etag(java.lang.String etag) |
Set the etag to be used for conditional pushes.
|
java.lang.String |
getEtag() |
|
java.lang.String |
getHeader(java.lang.String name) |
|
java.util.Set<java.lang.String> |
getHeaderNames() |
|
java.lang.String |
getLastModified() |
|
java.lang.String |
getMethod() |
|
java.lang.String |
getPath() |
|
java.lang.String |
getQueryString() |
|
java.lang.String |
getSessionId() |
|
boolean |
isConditional() |
|
PushBuilder |
lastModified(java.lang.String lastModified) |
Set the last modified date to be used for conditional pushes.
|
PushBuilder |
method(java.lang.String method) |
Set the method to be used for the push.
|
PushBuilder |
path(java.lang.String path) |
Set the URI path to be used for the push.
|
void |
push() |
Push a resource given the current state of the builder,
returning immediately without blocking.
|
PushBuilder |
queryString(java.lang.String queryString) |
Set the query string to be used for the push.
|
PushBuilder |
removeHeader(java.lang.String name) |
Remove the named header.
|
PushBuilder |
sessionId(java.lang.String sessionId) |
Set the SessionID to be used for the push.
|
PushBuilder |
setHeader(java.lang.String name,
java.lang.String value) |
Set a header to be used for the push.
|
public PushBuilderImpl(Request request, org.eclipse.jetty.http.HttpFields fields, java.lang.String method, java.lang.String queryString, java.lang.String sessionId, boolean conditional)
public java.lang.String getMethod()
getMethod in interface PushBuilderpublic PushBuilder method(java.lang.String method)
PushBuilderSet the method to be used for the push.
Any non-empty String may be used for the method.
method in interface PushBuildermethod - the method to be used for the push.public java.lang.String getQueryString()
getQueryString in interface PushBuilderpublic PushBuilder queryString(java.lang.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 java.lang.String getSessionId()
getSessionId in interface PushBuilderpublic PushBuilder sessionId(java.lang.String sessionId)
PushBuildersessionId in interface PushBuildersessionId - the SessionID to be used for the push.public boolean isConditional()
isConditional in interface PushBuilderpublic PushBuilder conditional(boolean conditional)
PushBuilderPushBuilder.etag(String) or
PushBuilder.lastModified(String) will be set in the appropriate headers. If the request
is not conditional, then etag and lastModified values are ignored.
Defaults to true if the associated request was conditional.conditional in interface PushBuilderconditional - true if the push request is conditionalpublic java.util.Set<java.lang.String> getHeaderNames()
getHeaderNames in interface PushBuilderpublic java.lang.String getHeader(java.lang.String name)
getHeader in interface PushBuilderpublic PushBuilder setHeader(java.lang.String name, java.lang.String value)
PushBuilderSet a 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(java.lang.String name, java.lang.String value)
PushBuilderAdd a header to be used for the push.
addHeader in interface PushBuildername - The header name to addvalue - The header value to addpublic PushBuilder removeHeader(java.lang.String name)
PushBuilderRemove the named header. If the header does not exist, take no action.
removeHeader in interface PushBuildername - The name of the header to removepublic java.lang.String getPath()
getPath in interface PushBuilderpublic PushBuilder path(java.lang.String path)
PushBuilderpath(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 java.lang.String getEtag()
getEtag in interface PushBuilderpublic PushBuilder etag(java.lang.String etag)
PushBuilderPushBuilder.isConditional() is true.
Defaults to no etag. The value is nulled after every call to
PushBuilder.push()etag in interface PushBuilderetag - the etag to be used for the push.public java.lang.String getLastModified()
getLastModified in interface PushBuilderpublic PushBuilder lastModified(java.lang.String lastModified)
PushBuilderPushBuilder.isConditional() is true. Defaults to no date. The value is
nulled after every call to PushBuilder.push()lastModified in interface PushBuilderlastModified - the last modified date to be used for the push.public void push()
PushBuilderPush a resource based on the current state of the PushBuilder.
If PushBuilder.isConditional() is true and an etag or lastModified
value is provided, then an appropriate conditional header will be
generated. If both an etag and lastModified value are provided
only an If-None-Match header will be generated. 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, etag and lastModified fields nulled. All other fields are left as is for possible reuse in another push.
push in interface PushBuilderCopyright © 1995–2018 Webtide. All rights reserved.