public class PushBuilderImpl extends Object implements PushBuilder
Constructor and Description |
---|
PushBuilderImpl(Request request,
HttpFields fields,
String method,
String queryString,
String sessionId,
boolean conditional) |
Modifier and Type | Method and Description |
---|---|
PushBuilder |
addHeader(String name,
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(String etag)
Set the etag to be used for conditional pushes.
|
String |
getEtag() |
String |
getHeader(String name) |
Set<String> |
getHeaderNames() |
String |
getLastModified() |
String |
getMethod() |
String |
getPath() |
String |
getQueryString() |
String |
getSessionId() |
boolean |
isConditional() |
PushBuilder |
lastModified(String lastModified)
Set the last modified date to be used for conditional pushes.
|
PushBuilder |
method(String method)
Set the method to be used for the push.
|
PushBuilder |
path(String path)
Set the URI path to be used for the push.
|
void |
push()
Push a resource.
|
PushBuilder |
queryString(String queryString)
Set the query string to be used for the push.
|
PushBuilder |
sessionId(String sessionId)
Set the SessionID to be used for the push.
|
PushBuilder |
setHeader(String name,
String value)
Set a header to be used for the push.
|
public PushBuilderImpl(Request request, HttpFields fields, String method, String queryString, String sessionId, boolean conditional)
public String getMethod()
getMethod
in interface PushBuilder
PushBuilder.getMethod()
public PushBuilder method(String method)
PushBuilder
method
in interface PushBuilder
method
- the method to be used for the push.PushBuilder.method(java.lang.String)
public String getQueryString()
getQueryString
in interface PushBuilder
PushBuilder.getQueryString()
public PushBuilder queryString(String queryString)
PushBuilder
PushBuilder.path(String)
. 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, or to remove a
query string obtained from the associated request.queryString
in interface PushBuilder
queryString
- the query string to be used for the push.PushBuilder.queryString(java.lang.String)
public String getSessionId()
getSessionId
in interface PushBuilder
PushBuilder.getSessionId()
public PushBuilder sessionId(String sessionId)
PushBuilder
sessionId
in interface PushBuilder
sessionId
- the SessionID to be used for the push.PushBuilder.sessionId(java.lang.String)
public boolean isConditional()
isConditional
in interface PushBuilder
PushBuilder.isConditional()
public PushBuilder conditional(boolean conditional)
PushBuilder
PushBuilder.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 PushBuilder
conditional
- true if the push request is conditionalPushBuilder.conditional(boolean)
public Set<String> getHeaderNames()
getHeaderNames
in interface PushBuilder
PushBuilder.getHeaderNames()
public String getHeader(String name)
getHeader
in interface PushBuilder
PushBuilder.getHeader(java.lang.String)
public PushBuilder setHeader(String name, String value)
PushBuilder
setHeader
in interface PushBuilder
name
- The header name to setvalue
- The header value to setPushBuilder.setHeader(java.lang.String, java.lang.String)
public PushBuilder addHeader(String name, String value)
PushBuilder
addHeader
in interface PushBuilder
name
- The header name to addvalue
- The header value to addPushBuilder.addHeader(java.lang.String, java.lang.String)
public String getPath()
getPath
in interface PushBuilder
PushBuilder.getPath()
public PushBuilder path(String path)
PushBuilder
PushBuilder.path(String)
must be called
before every call to PushBuilder.push()
path
in interface PushBuilder
path
- the URI path to be used for the push, which may include a
query string.PushBuilder.path(java.lang.String)
public String getEtag()
getEtag
in interface PushBuilder
PushBuilder.getEtag()
public PushBuilder etag(String etag)
PushBuilder
PushBuilder.isConditional()
is true.
Defaults to no etag. The value is nulled after every call to
PushBuilder.push()
etag
in interface PushBuilder
etag
- the etag to be used for the push.PushBuilder.etag(java.lang.String)
public String getLastModified()
getLastModified
in interface PushBuilder
PushBuilder.getLastModified()
public PushBuilder lastModified(String lastModified)
PushBuilder
PushBuilder.isConditional()
is true.
Defaults to no date. The value is nulled after every call to
PushBuilder.push()
lastModified
in interface PushBuilder
lastModified
- the last modified date to be used for the push.PushBuilder.lastModified(java.lang.String)
public void push()
PushBuilder
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.
After initiating the push, 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 PushBuilder
PushBuilder.push()
Copyright © 1995-2016 Webtide. All Rights Reserved.