org.apache.abdera.protocol.client
Class RequestOptions

java.lang.Object
  extended by org.apache.abdera.protocol.util.AbstractRequest
      extended by org.apache.abdera.protocol.client.RequestOptions
All Implemented Interfaces:
Request, ProtocolConstants

public class RequestOptions
extends AbstractRequest
implements Request


Field Summary
 
Fields inherited from class org.apache.abdera.protocol.util.AbstractRequest
flags, max_age, max_stale, min_fresh
 
Fields inherited from interface org.apache.abdera.protocol.util.ProtocolConstants
NOCACHE, NOSTORE, NOTRANSFORM, ONLYIFCACHED, PRIVATE, PROXYREVALIDATE, PUBLIC, REVALIDATE
 
Constructor Summary
RequestOptions()
           
RequestOptions(boolean no_cache)
           
RequestOptions(java.util.Date ifModifiedSince)
           
RequestOptions(java.util.Date ifModifiedSince, java.lang.String... ifNoneMatch)
           
RequestOptions(java.util.Date ifModifiedSince, java.lang.String ifNoneMatch)
           
RequestOptions(java.lang.String... ifNoneMatch)
           
RequestOptions(java.lang.String ifNoneMatch)
           
 
Method Summary
 void addDateHeader(java.lang.String header, java.util.Date value)
          Similar to setDateHeader but allows for multiple instances of the specified header
 void addEncodedHeader(java.lang.String header, java.lang.String charset, java.lang.String... values)
          Similar to setEncodedHeader, but allows for multiple instances of the specified header
 void addEncodedHeader(java.lang.String header, java.lang.String charset, java.lang.String value)
          Similar to setEncodedHeader, but allows for multiple instances of the specified header
 void addHeader(java.lang.String header, java.lang.String... values)
          Similar to setHeader but allows for multiple instances of the specified header
 void addHeader(java.lang.String header, java.lang.String value)
          Similar to setHeader but allows for multiple instances of the specified header
 java.lang.String getCacheControl()
          Return the value of the Cache-Control header
 java.util.Date getDateHeader(java.lang.String header)
          Returns the date value of the specified header
 java.lang.String getHeader(java.lang.String header)
          Returns the text value of the specified header
 java.lang.String[] getHeaderNames()
          Returns a listing of header names
 java.util.List<java.lang.String> getHeaders(java.lang.String header)
          Return a listing of text values for the specified header
 boolean getRevalidateWithAuth()
          Configure the AbderaClient Side cache to revalidate when using Authorization
 boolean getUseLocalCache()
          The difference between this and getNoCache is that this only disables the local cache without affecting the Cache-Control header.
 boolean is4xxRequestException()
          Return true if a RequestException should be thrown on 4xx responses
 boolean is5xxRequestException()
          Return true if a RequestException should be thrown on 5xx responses
 boolean isUseChunked()
          Should the request use chunked encoding?
 boolean isUseExpectContinue()
          Return true if Expect-Continue should be used
 boolean isUsePostOverride()
          Return whether the request should use the X-HTTP-Method-Override option
 void removeHeaders(java.lang.String name)
          Remove the specified HTTP header
 void set4xxRequestException(boolean v)
          Set whether or not to throw a RequestExeption on 4xx responses
 void set5xxRequestException(boolean v)
          Set whether or not to throw a RequestExeption on 5xx responses
 void setAccept(java.lang.String... accept)
          Sets the value of the HTTP Accept header
 void setAccept(java.lang.String accept)
          Sets the value of the HTTP Accept header
 void setAcceptCharset(java.lang.String... accept)
          Sets the value of the HTTP Accept-Charset header
 void setAcceptCharset(java.lang.String accept)
          Sets the value of the HTTP Accept-Charset header
 void setAcceptEncoding(java.lang.String... accept)
          Sets the value of the HTTP Accept-Encoding header
 void setAcceptEncoding(java.lang.String accept)
          Sets the value of the HTTP Accept-Encoding header
 void setAcceptLanguage(java.lang.String... accept)
          Sets the value of the HTTP Accept-Language header
 void setAcceptLanguage(java.lang.String accept)
          Sets the value of the HTTP Accept-Language header
 void setAuthorization(java.lang.String auth)
          Set the value of the HTTP Authorization header
 void setCacheControl(java.lang.String cc)
          Sets the value of the HTTP Cache-Control header
 void setContentType(javax.activation.MimeType value)
          Set the value of the HTTP Content-Type header
 void setContentType(java.lang.String value)
          Set the value of the HTTP Content-Type header
 void setDateHeader(java.lang.String header, java.util.Date value)
          Set the date value of the specified HTTP header
 void setEncodedHeader(java.lang.String header, java.lang.String charset, java.lang.String... values)
          Set the values of a header using proper encoding of non-ascii characters
 void setEncodedHeader(java.lang.String header, java.lang.String charset, java.lang.String value)
          Set the value of a header using proper encoding of non-ascii characters
 void setHeader(java.lang.String header, java.lang.String... values)
          Set the value of the specified HTTP header
 void setHeader(java.lang.String header, java.lang.String value)
          Set the value of the specified HTTP header
 void setIfMatch(EntityTag... entity_tags)
          Sets the value of the HTTP If-Match header
 void setIfMatch(EntityTag entity_tag)
          Sets the value of the HTTP If-Match header
 void setIfMatch(java.lang.String... entity_tags)
          Sets the value of the HTTP If-Match header
 void setIfMatch(java.lang.String entity_tag)
          Sets the value of the HTTP If-Match header
 void setIfModifiedSince(java.util.Date date)
          Sets the value of the HTTP If-Modified-Since header
 void setIfNoneMatch(EntityTag... entity_tags)
          Sets the value of the HTTP If-None-Match header
 void setIfNoneMatch(EntityTag entity_tag)
          Sets the value of the HTTP If-None-Match header
 void setIfNoneMatch(java.lang.String... entity_tags)
          Sets the value of the HTTP If-None-Match header
 void setIfNoneMatch(java.lang.String entity_tag)
          Sets the value of the HTTP If-None-Match header
 void setIfUnmodifiedSince(java.util.Date date)
          Sets the value of the HTTP If-Unmodified-Since header
 void setRevalidateWithAuth(boolean revalidateAuth)
          Configure the AbderaClient Side cache to revalidate when using Authorization
 void setSlug(java.lang.String slug)
          Sets the value of the Atom Publishing Protocol Slug header
 void setUseChunked(boolean useChunked)
          Set whether the request should use chunked encoding.
 void setUseExpectContinue(boolean useExpect)
          Set whether or not to use the HTTP Expect-Continue mechanism (enabled by default)
 void setUseLocalCache(boolean use_cache)
          True if the local client cache should be used
 void setUsePostOverride(boolean useOverride)
          Set whether the request should use the X-HTTP-Method-Override option
 
Methods inherited from class org.apache.abdera.protocol.util.AbstractRequest
getAccept, getAcceptCharset, getAcceptEncoding, getAcceptLanguage, getAuthorization, getContentType, getDecodedHeader, getDecodedHeaders, getIfMatch, getIfModifiedSince, getIfNoneMatch, getIfUnmodifiedSince, getMaxAge, getMaxStale, getMinFresh, getSlug, isNoCache, isNoStore, isNoTransform, isOnlyIfCached, setMaxAge, setMaxStale, setMinFresh, setNoCache, setNoStore, setNoTransform, setOnlyIfCached
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.abdera.protocol.Request
getAccept, getAcceptCharset, getAcceptEncoding, getAcceptLanguage, getAuthorization, getContentType, getDecodedHeader, getDecodedHeaders, getIfMatch, getIfModifiedSince, getIfNoneMatch, getIfUnmodifiedSince, getMaxAge, getMaxStale, getMinFresh, getSlug, isNoCache, isNoStore, isNoTransform, isOnlyIfCached
 

Constructor Detail

RequestOptions

public RequestOptions()

RequestOptions

public RequestOptions(java.util.Date ifModifiedSince)

RequestOptions

public RequestOptions(java.lang.String ifNoneMatch)

RequestOptions

public RequestOptions(java.lang.String... ifNoneMatch)

RequestOptions

public RequestOptions(java.util.Date ifModifiedSince,
                      java.lang.String ifNoneMatch)

RequestOptions

public RequestOptions(java.util.Date ifModifiedSince,
                      java.lang.String... ifNoneMatch)

RequestOptions

public RequestOptions(boolean no_cache)
Method Detail

getUseLocalCache

public boolean getUseLocalCache()
The difference between this and getNoCache is that this only disables the local cache without affecting the Cache-Control header.


setUseLocalCache

public void setUseLocalCache(boolean use_cache)
True if the local client cache should be used


setContentType

public void setContentType(java.lang.String value)
Set the value of the HTTP Content-Type header


setContentType

public void setContentType(javax.activation.MimeType value)
Set the value of the HTTP Content-Type header


setAuthorization

public void setAuthorization(java.lang.String auth)
Set the value of the HTTP Authorization header


setEncodedHeader

public void setEncodedHeader(java.lang.String header,
                             java.lang.String charset,
                             java.lang.String value)
Set the value of a header using proper encoding of non-ascii characters


setEncodedHeader

public void setEncodedHeader(java.lang.String header,
                             java.lang.String charset,
                             java.lang.String... values)
Set the values of a header using proper encoding of non-ascii characters


setHeader

public void setHeader(java.lang.String header,
                      java.lang.String value)
Set the value of the specified HTTP header


setHeader

public void setHeader(java.lang.String header,
                      java.lang.String... values)
Set the value of the specified HTTP header


setDateHeader

public void setDateHeader(java.lang.String header,
                          java.util.Date value)
Set the date value of the specified HTTP header


addEncodedHeader

public void addEncodedHeader(java.lang.String header,
                             java.lang.String charset,
                             java.lang.String value)
Similar to setEncodedHeader, but allows for multiple instances of the specified header


addEncodedHeader

public void addEncodedHeader(java.lang.String header,
                             java.lang.String charset,
                             java.lang.String... values)
Similar to setEncodedHeader, but allows for multiple instances of the specified header


addHeader

public void addHeader(java.lang.String header,
                      java.lang.String value)
Similar to setHeader but allows for multiple instances of the specified header


addHeader

public void addHeader(java.lang.String header,
                      java.lang.String... values)
Similar to setHeader but allows for multiple instances of the specified header


addDateHeader

public void addDateHeader(java.lang.String header,
                          java.util.Date value)
Similar to setDateHeader but allows for multiple instances of the specified header


getHeader

public java.lang.String getHeader(java.lang.String header)
Returns the text value of the specified header

Specified by:
getHeader in interface Request

getHeaders

public java.util.List<java.lang.String> getHeaders(java.lang.String header)
Return a listing of text values for the specified header

Specified by:
getHeaders in interface Request

getDateHeader

public java.util.Date getDateHeader(java.lang.String header)
Returns the date value of the specified header

Specified by:
getDateHeader in interface Request

getHeaderNames

public java.lang.String[] getHeaderNames()
Returns a listing of header names

Specified by:
getHeaderNames in interface Request

setIfMatch

public void setIfMatch(java.lang.String entity_tag)
Sets the value of the HTTP If-Match header


setIfMatch

public void setIfMatch(EntityTag entity_tag)
Sets the value of the HTTP If-Match header


setIfMatch

public void setIfMatch(EntityTag... entity_tags)
Sets the value of the HTTP If-Match header


setIfMatch

public void setIfMatch(java.lang.String... entity_tags)
Sets the value of the HTTP If-Match header


setIfNoneMatch

public void setIfNoneMatch(java.lang.String entity_tag)
Sets the value of the HTTP If-None-Match header


setIfNoneMatch

public void setIfNoneMatch(EntityTag entity_tag)
Sets the value of the HTTP If-None-Match header


setIfNoneMatch

public void setIfNoneMatch(EntityTag... entity_tags)
Sets the value of the HTTP If-None-Match header


setIfNoneMatch

public void setIfNoneMatch(java.lang.String... entity_tags)
Sets the value of the HTTP If-None-Match header


setIfModifiedSince

public void setIfModifiedSince(java.util.Date date)
Sets the value of the HTTP If-Modified-Since header


setIfUnmodifiedSince

public void setIfUnmodifiedSince(java.util.Date date)
Sets the value of the HTTP If-Unmodified-Since header


setAccept

public void setAccept(java.lang.String accept)
Sets the value of the HTTP Accept header


setAccept

public void setAccept(java.lang.String... accept)
Sets the value of the HTTP Accept header


setAcceptLanguage

public void setAcceptLanguage(java.lang.String accept)
Sets the value of the HTTP Accept-Language header


setAcceptLanguage

public void setAcceptLanguage(java.lang.String... accept)
Sets the value of the HTTP Accept-Language header


setAcceptCharset

public void setAcceptCharset(java.lang.String accept)
Sets the value of the HTTP Accept-Charset header


setAcceptCharset

public void setAcceptCharset(java.lang.String... accept)
Sets the value of the HTTP Accept-Charset header


setAcceptEncoding

public void setAcceptEncoding(java.lang.String accept)
Sets the value of the HTTP Accept-Encoding header


setAcceptEncoding

public void setAcceptEncoding(java.lang.String... accept)
Sets the value of the HTTP Accept-Encoding header


setSlug

public void setSlug(java.lang.String slug)
Sets the value of the Atom Publishing Protocol Slug header


setCacheControl

public void setCacheControl(java.lang.String cc)
Sets the value of the HTTP Cache-Control header


removeHeaders

public void removeHeaders(java.lang.String name)
Remove the specified HTTP header


getCacheControl

public java.lang.String getCacheControl()
Return the value of the Cache-Control header

Specified by:
getCacheControl in interface Request
Overrides:
getCacheControl in class AbstractRequest

getRevalidateWithAuth

public boolean getRevalidateWithAuth()
Configure the AbderaClient Side cache to revalidate when using Authorization


setRevalidateWithAuth

public void setRevalidateWithAuth(boolean revalidateAuth)
Configure the AbderaClient Side cache to revalidate when using Authorization


isUseChunked

public boolean isUseChunked()
Should the request use chunked encoding?


setUseChunked

public void setUseChunked(boolean useChunked)
Set whether the request should use chunked encoding.


setUsePostOverride

public void setUsePostOverride(boolean useOverride)
Set whether the request should use the X-HTTP-Method-Override option


isUsePostOverride

public boolean isUsePostOverride()
Return whether the request should use the X-HTTP-Method-Override option


set4xxRequestException

public void set4xxRequestException(boolean v)
Set whether or not to throw a RequestExeption on 4xx responses


is4xxRequestException

public boolean is4xxRequestException()
Return true if a RequestException should be thrown on 4xx responses


set5xxRequestException

public void set5xxRequestException(boolean v)
Set whether or not to throw a RequestExeption on 5xx responses


is5xxRequestException

public boolean is5xxRequestException()
Return true if a RequestException should be thrown on 5xx responses


setUseExpectContinue

public void setUseExpectContinue(boolean useExpect)
Set whether or not to use the HTTP Expect-Continue mechanism (enabled by default)


isUseExpectContinue

public boolean isUseExpectContinue()
Return true if Expect-Continue should be used