|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IContext
The IContext
interface provides access methods
for most HTTP and WebDAV message header fields. Those that are
not explicitly enumerated can be accessed using
Context#get(String)
and Context#put(String,String)
. All context keys are available with
Context#keys()
.
Note: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.
Field Summary | |
---|---|
static String |
DEPTH_INFINITY
Depth constant indicating apply the method to the target resource. |
static String |
DEPTH_ONE
Depth constant indicating apply the method to the target resource. |
static String |
DEPTH_ZERO
Depth constant indicating apply the method to the target resource. |
static String |
EXCLUSIVE_LOCK
Lock type constant indicating an exclusive lock. |
static String |
NO_CACHE
Constant used in the Cache-Control header indicating that clients and proxies MUST not cache the response of a method since it has non-idempotent semantics. |
static int |
NO_EXPIRY_LOCK
Constant indicating an indefinite timeout period. |
static String |
SHARED_LOCK
Lock type constant indicating a shared lock. |
static String |
WRITE_LOCK
Lock type constant indicating a write lock. |
Method Summary | |
---|---|
void |
collapse()
Collapse teh receiver by copying all the keys and values from the default context into the receiver. |
String |
get(String key)
Returns the value for the given key, or null
if the given key has no value. |
String |
getAccept()
Returns the media types that are acceptable for a response. |
String |
getAcceptCharset()
Returns the character sets that are acceptable for a response. |
String |
getAcceptEncoding()
Retruns what content-encoding values are acceptable for a response. |
String |
getAcceptLanguage()
Returns the natural languages that are acceptable for a response. |
String |
getAcceptRanges()
Returns the range requests acceptable to a server. |
int |
getAge()
Returns the integer value of sender's estimate of the time since the response was generated, or -1 if the value is not set. |
String |
getAllBindings()
Returns the string value for the ALL_BINDINGS key. |
String |
getAllow()
Returns the methods allowed on a resource |
String |
getAuthorization()
Returns the user's credentials for the realm of the resource being requested. |
String |
getCacheControl()
Returns the cache control directives that must be obeyed. |
String |
getConnection()
Returns the sender connection options. |
String |
getContentBase()
Returns the URL string value for the CONTENT_BASE key. |
String |
getContentEncoding()
Returns what additional content encodings have been applied to the entity body. |
String |
getContentLanguage()
Returns the natural language of the intended audience for the entity body. |
long |
getContentLength()
Returns the content length in bytes of the entity body. |
String |
getContentLocation()
Returns the URL that locates the content. |
String |
getContentMD5()
Returns the string value for the CONTENT_MD5 key. |
String |
getContentRange()
Returns the string value for the CONTENT_RANGE key. |
String |
getContentType()
Returns the MIME type for the response contents. |
String |
getDate()
Returns the date the request was made. |
String |
getDAV()
Returns the DAV level supported by the server. |
String |
getDepth()
Returns the string value for the "Depth" key. |
String |
getDestination()
Returns the destination URL for a copy or move operation. |
String |
getETag()
Returns the entity tag for the associated entity. |
String |
getExpires()
Returns the date/time after which the response should be considered stale. |
String |
getFrom()
Returns the string value for the FROM key. |
String |
getHost()
Returns the Internet host and port of the resource being requested. |
String |
getIfKey()
Returns the string value for the IF key. |
String |
getIfMatch()
Returns the string value for the IF_MATCH key. |
String |
getIfModifiedSince()
Returns the string value for the IF_MODIFIED_SINCE key. |
String |
getIfNoneMatch()
Returns the string value for the IF_NONE_MATCH key. |
String |
getIfRange()
Returns the string value for the IF_RANGE key. |
String |
getIfUnmodifiedSince()
Returns the string value for the IF_UNMODIFIED_SINCE key. |
String |
getLabel()
Returns the label header value. |
String |
getLastModified()
Returns when the resource was last modified. |
String |
getLocation()
Returns the URI of the redirect location. |
String |
getLockToken()
Returns the lock token for the resource, or null if it is not set. |
int |
getMaxForwards()
Returns the integer value for the MAX_FORWARDS key. |
String |
getOrdered()
Returns the string value for the ORDERED key. |
boolean |
getOverwrite()
Returns the flag that indicates if copy or move should overwrite an existing destination. |
boolean |
getPassthrough()
Returns the boolean value for the PASSTHROUGH key. |
String |
getPosition()
Returns the string value for the POSITION key. |
String |
getPragma()
Returns the string value for the PRAGMA key. |
String |
getProxyAuthenticate()
Returns the string value for the PROXY_AUTHENTICATE key. |
String |
getProxyAuthorization()
Returns the string value for the PROXY_AUTHORIZATION key. |
String |
getPublicKey()
Returns the string value for the PUBLIC_KEY key. |
String |
getRange()
Returns the string value for the RANGE key. |
String |
getReferer()
Returns the URI string of the resource from which the request was obtained. |
String |
getRefTarget()
Returns the URI string for the REF_TARGET key. |
String |
getResourceType()
Returns the string value for the RESOURCE_TYPE key. |
String |
getRetryAfter()
Returns the string value for the RETRY_AFTER key. |
String |
getServer()
Returns information about the software used by the origin server to handle the request. |
String |
getStatusURI()
Returns the URI string of the resource whose method is in process. |
int |
getTimeout()
Returns the lock timeout value. |
String |
getTransferEncoding()
Returns the string value for the TRANSFER_ENCODING key. |
String |
getUpgrade()
Returns the string value for the UPGRADE key. |
String |
getUserAgent()
Returns information about the user agent originating the request. |
String |
getVary()
Returns the string value for the VARY key. |
String |
getVia()
Returns the string value for the VIA key. |
String |
getWarning()
Returns the string value for the WARNING key. |
String |
getWWWAuthenticate()
Returns the string value for the WWW_AUTHENTICATE key. |
Enumeration |
keys()
Returns keys of the context, as an enumeration |
void |
put(String key,
String value)
Adds or replaces the given key-value pair into the context. |
void |
removeKey(String key)
Removes the given key from this context. |
void |
setAccept(String value)
Sets what media types are acceptable for a response. |
void |
setAcceptCharset(String value)
Sets which character sets are acceptable for a response. |
void |
setAcceptEncoding(String value)
Sets the content-encoding values which are acceptable for a response. |
void |
setAcceptLanguage(String value)
Sets which natural languages are acceptable for a response. |
void |
setAcceptRanges(String value)
Sets the range requests acceptable to a server. |
void |
setAge(int seconds)
Sets the sender's estimate of the time since the response was generated. |
void |
setAllBindings(String value)
Sets the string value for the ALL_BINDINGS key. |
void |
setAllow(String value)
Sets methods allowed on a resource Sets the string value for the ALLOW key. |
void |
setAuthorization(String value)
Sets the user's credentials for the realm of the resource being requested. |
void |
setCacheControl(String value)
Sets the cache control directives that must be obeyed. |
void |
setConnection(String value)
Sets sender connection options. |
void |
setContentBase(String stringURL)
Sets the URL string value for the CONTENT_BASE key. |
void |
setContentEncoding(String value)
Sets the additional content encodings that have been applied to the entity body. |
void |
setContentLanguage(String value)
Sets the natural language of the intended audience for the entity body. |
void |
setContentLength(long value)
Sets the content length in bytes of the entity body. |
void |
setContentLocation(String stringURL)
Sets the URL string value for the CONTENT_LOCATION key. |
void |
setContentMD5(String value)
Sets the string value for the CONTENT_MD5 key. |
void |
setContentRange(String value)
Sets the string value for the CONTENT_RANGE key. |
void |
setContentType(String value)
Sets the MIME type for the response contents. |
void |
setDate(String value)
Sets the date the request was made. |
void |
setDAV(String value)
Sets the DAV level supported by the server. |
void |
setDepth(String depth)
Sets the string value for the DEPTH key. |
void |
setDestination(String stringURL)
Sets the destination URI for a copy or move operation. |
void |
setETag(String value)
Sets the entity tag for the associated entity. |
void |
setExpires(String value)
Sets the date/time after which the response should be considered stale. |
void |
setFrom(String value)
Sets the string value for the FROM key. |
void |
setHost(String value)
Sets the Internet host and port of the resource being requested. |
void |
setIfKey(String value)
Sets the string value for the IF key. |
void |
setIfMatch(String value)
Sets the string value for the IF_MATCH key. |
void |
setIfModifiedSince(String value)
Sets the string value for the IF_MODIFIED_SINCE key. |
void |
setIfNoneMatch(String value)
Sets the string value for the IF_NONE_MATCH key. |
void |
setIfRange(String value)
Sets the string value for the IF_RANGE key. |
void |
setIfUnmodifiedSince(String value)
Sets the string value for the IF_UNMODIFIED_SINCE key. |
void |
setLabel(String value)
Sets when the label header value. |
void |
setLastModified(String value)
Sets when the resource was last modified. |
void |
setLocation(String stringURL)
Sets the redirect location. |
void |
setLockToken(String lockToken)
Sets the lock token for the resource. |
void |
setMaxForwards(int value)
Sets the integer value for the MAX_FORWARDS key. |
void |
setOrdered(String value)
Sets the string value for the ORDERED key. |
void |
setOverwrite(boolean value)
Sets if copy or move should overwrite an existing destination. |
void |
setPassthrough(boolean value)
Sets the boolean value for the PASSTHROUGH key. |
void |
setPosition(String value)
Sets the string value for the POSITION key. |
void |
setPragma(String value)
Sets the string value for the PRAGMA key. |
void |
setProxyAuthenticate(String value)
Sets the string value for the PROXY_AUTHENTICATE key. |
void |
setProxyAuthorization(String value)
Sets the string value for the PROXY_AUTHORIZATION key. |
void |
setPublicKey(String value)
Sets the string value for the PUBLIC_KEY key. |
void |
setRange(String value)
Sets the string value for the RANGE key. |
void |
setReferer(String stringURL)
Sets the URI of the resource from which the request was obtained. |
void |
setRefTarget(String stringURL)
Sets the URI value for the REF_TARGET key. |
void |
setResourceType(String value)
Sets the string value for the RESOURCE_TYPE key. |
void |
setRetryAfter(String value)
Sets the string value for the RETRY_AFTER key. |
void |
setServer(String value)
Sets information about the software used by the origin server to handle the request. |
void |
setStatusURI(String statusURI)
Sets the URI of the resource whose method is in process. |
void |
setTimeout(int value)
Sets the lock timeout value in seconds. |
void |
setTransferEncoding(String value)
Sets the string value for the TRANSFER_ENCODING key. |
void |
setUpgrade(String value)
Sets the string value for the UPGRADE key. |
void |
setUserAgent(String value)
Sets information about the user agent originating the request. |
void |
setVary(String value)
Sets the string value for the VARY key. |
void |
setVia(String value)
Sets the string value for the VIA key. |
void |
setWarning(String value)
Sets the string value for the WARNING key. |
void |
setWWWAuthenticate(String value)
Sets the string value for the WWW_AUTHENTICATE key. |
Field Detail |
---|
static final String DEPTH_ZERO
getDepth()
,
Constant Field Valuesstatic final String DEPTH_ONE
getDepth()
,
Constant Field Valuesstatic final String DEPTH_INFINITY
getDepth()
,
Constant Field Valuesstatic final String EXCLUSIVE_LOCK
static final String SHARED_LOCK
static final String WRITE_LOCK
static final int NO_EXPIRY_LOCK
static final String NO_CACHE
Method Detail |
---|
void collapse()
String get(String key)
null
if the given key has no value.
key
- the key to look up
String getAccept()
"Accept"
key,
or null
if that key has no value.String getAcceptCharset()
"Accept-Charset"
key,
or null
if that key has no value.String getAcceptEncoding()
"Accept-Encoding"
key,
or null
if that key has no value.String getAcceptLanguage()
"Accept-Language"
key,
or null
if that key has no value.String getAcceptRanges()
"Accept-Ranges"
key,
or null
if that key has no value.int getAge()
"Age"
key,
or -1 if not set.String getAllBindings()
"All-Bindings"
key,
or null
if that key has no value.String getAllow()
"Allow"
key,
or null
if that key has no value.String getAuthorization()
"Authorization"
key,
or null
if that key has no value.String getCacheControl()
"Cache-Control"
key,
or null
if that key has no value.String getConnection()
"Connection"
key,
or null
if that key has no value.String getContentBase()
"Content-Base"
key,
or null
if that key has no value.String getContentEncoding()
"Content-Encoding"
key,
or null
if that key has no value.String getContentLanguage()
"Content-Language"
key,
or null
if that key has no value.long getContentLength()
"Content-Length"
key,
or -1 if that key has no value.String getContentLocation()
"Content-Location"
key,
or null
if that key has no value.String getContentMD5()
"Content-MD5"
key,
or null
if that key has no value.String getContentRange()
"Content-Range"
key,
or null
if that key has no value.String getContentType()
"Content-Type"
key,
or null
if that key has no value.String getDate()
"Date"
key,
or null
if that key has no value.String getDAV()
String getDepth()
DEPTH_ZERO
,
DEPTH_ONE
, or DEPTH_INFINITY
DEPTH_ZERO
,
DEPTH_ONE
,
DEPTH_INFINITY
String getDestination()
"Destination"
key,
or null
if that key has no value.String getETag()
"ETag"
key,
or null
if that key has no value.String getExpires()
"Expires"
key,
or null
if that key has no value.String getFrom()
"From"
key,
or null
if that key has no value.String getHost()
"Host"
key,
or null
if that key has no value.String getIfKey()
"If"
key,
or null
if that key has no value.String getIfMatch()
"If-Match"
key,
or null
if that key has no value.String getIfModifiedSince()
"If-Modified-Since"
key,
or null
if that key has no value.String getIfNoneMatch()
"If-None-Match"
key,
or null
if that key has no value.String getIfRange()
"If-Range"
key,
or null
if that key has no value.String getIfUnmodifiedSince()
"If-Unmodified-Since"
key,
or null
if that key has no value.String getLabel()
"Label"
key,
or null
if that key has no value.String getLastModified()
"Last-Modified"
key,
or null
if that key has no value.String getLocation()
"Location"
key,
or null
if that key has no value.String getLockToken()
"Lock-Token"
key,
or null
if that key has no value.int getMaxForwards()
"Max-Forwards"
key,
or null
if that key has no value.String getOrdered()
"Ordered"
key,
or null
if that key has no value.boolean getOverwrite()
"Overwrite"
key,
or false
if that key has no value.boolean getPassthrough()
"Passthrough"
key,
or null
if that key has no value.String getPosition()
"Position"
key,
or null
if that key has no value.String getPragma()
"Pragma"
key,
or null
if that key has no value.String getProxyAuthenticate()
"Proxy-Authenticate"
key,
or null
if that key has no value.String getProxyAuthorization()
"Proxy-Authorization"
key,
or null
if that key has no value.String getPublicKey()
"Public-Key"
key,
or null
if that key has no value.String getRange()
"Range"
key,
or null
if that key has no value.String getReferer()
"Referer"
key,
or null
if that key has no value.String getRefTarget()
"Ref-Target"
key,
or null
if that key has no value.String getResourceType()
"Resource-Type"
key,
or null
if that key has no value.String getRetryAfter()
"Retry-After"
key,
or null
if that key has no value.String getServer()
"Server"
key,
or null
if that key has no value.String getStatusURI()
"Status-URI"
key,
or null
if that key has no value.int getTimeout()
"Timeout"
key,
where -1 means that the value was not set, and -2 means
that the value was infinity.String getTransferEncoding()
"Transfer-Encoding"
key,
or null
if that key has no value.String getUpgrade()
"Upgrade"
key,
or null
if that key has no value.String getUserAgent()
"User-Agent"
key,
or null
if that key has no value.String getVary()
"Vary"
key,
or null
if that key has no value.String getVia()
"Via"
key,
or null
if that key has no value.String getWarning()
"Warning"
key,
or null
if that key has no value.String getWWWAuthenticate()
"WWW-Authenticate"
key,
or null
if that key has no value.Enumeration keys()
String
s).void put(String key, String value)
key
- the keyvalue
- its associated valuevoid removeKey(String key)
key
- the key to removevoid setAccept(String value)
value
- the value for ACCEPTvoid setAcceptCharset(String value)
value
- the value for ACCEPT_CHARSETvoid setAcceptEncoding(String value)
value
- the value for ACCEPT_ENCODINGvoid setAcceptLanguage(String value)
value
- the value for ACCEPT_LANGUAGEvoid setAcceptRanges(String value)
value
- the value for ACCEPT_RANGESvoid setAge(int seconds)
seconds
- the value for AGEvoid setAllBindings(String value)
value
- the value for ALL_BINDINGSvoid setAllow(String value)
value
- the value for ALLOWvoid setAuthorization(String value)
value
- the value for AUTHORIZATIONvoid setCacheControl(String value)
value
- the value for CACHE_CONTROLvoid setConnection(String value)
value
- the value for CONNECTIONvoid setContentBase(String stringURL)
stringURL
- the value for CONTENT_BASEvoid setContentEncoding(String value)
value
- the value for CONTENT_ENCODINGvoid setContentLanguage(String value)
value
- the value for CONTENT_LANGUAGEvoid setContentLength(long value)
value
- the value for CONTENT_LENGTHvoid setContentLocation(String stringURL)
stringURL
- the value for CONTENT_LOCATIONvoid setContentMD5(String value)
value
- the value for CONTENT_MD5void setContentRange(String value)
value
- the value for CONTENT_RANGEvoid setContentType(String value)
value
- the value for CONTENT_TYPEvoid setDate(String value)
value
- the value for DATEvoid setDAV(String value)
value
- the value for DAVvoid setDepth(String depth)
depth
- one of DEPTH_ZERO
,
DEPTH_ONE
, or DEPTH_INFINITY
DEPTH_ZERO
,
DEPTH_ONE
,
DEPTH_INFINITY
void setDestination(String stringURL)
stringURL
- the value for DESTINATIONvoid setETag(String value)
value
- the value for ETAGvoid setExpires(String value)
value
- the value for EXPIRESvoid setFrom(String value)
value
- the value for FROMvoid setHost(String value)
value
- the value for HOSTvoid setIfKey(String value)
value
- the value for IFvoid setIfMatch(String value)
value
- the value for IF_MATCHvoid setIfModifiedSince(String value)
value
- the value for IF_MODIFIED_SINCEvoid setIfNoneMatch(String value)
value
- the value for IF_NONE_MATCHvoid setIfRange(String value)
value
- the value for IF_RANGEvoid setIfUnmodifiedSince(String value)
value
- the value for IF_UNMODIFIED_SINCEvoid setLabel(String value)
value
- the value for LABELvoid setLastModified(String value)
value
- the value for LAST_MODIFIEDvoid setLocation(String stringURL)
stringURL
- the value for LOCATIONvoid setLockToken(String lockToken)
lockToken
- the value for LOCK_TOKENvoid setMaxForwards(int value)
value
- the value for MAX_FORWARDSvoid setOrdered(String value)
value
- the value for ORDEREDvoid setOverwrite(boolean value)
value
- the value for OVERWRITEvoid setPassthrough(boolean value)
value
- the value for PASSTHROUGHvoid setPosition(String value)
value
- the value for POSITIONvoid setPragma(String value)
value
- the value for PRAGMAvoid setProxyAuthenticate(String value)
value
- the value for PROXY_AUTHENTICATEvoid setProxyAuthorization(String value)
value
- the value for PROXY_AUTHORIZATIONvoid setPublicKey(String value)
value
- the value for PUBLIC_KEYvoid setRange(String value)
value
- the value for RANGEvoid setReferer(String stringURL)
stringURL
- the value for REFERERvoid setRefTarget(String stringURL)
stringURL
- the value for REF_TARGETvoid setResourceType(String value)
value
- the value for RESOURCE_TYPEvoid setRetryAfter(String value)
value
- the value for RETRY_AFTERvoid setServer(String value)
value
- the value for SERVERvoid setStatusURI(String statusURI)
statusURI
- the value for STATUS_URIvoid setTimeout(int value)
value
- the value for TIMEOUTvoid setTransferEncoding(String value)
value
- the value for TRANSFER_ENCODINGvoid setUpgrade(String value)
value
- the value for UPGRADEvoid setUserAgent(String value)
value
- the value for USER_AGENTvoid setVary(String value)
value
- the value for VARYvoid setVia(String value)
value
- the value for VIAvoid setWarning(String value)
value
- the value for WARNINGvoid setWWWAuthenticate(String value)
value
- the value for WWW_AUTHENTICATE
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |