org.apache.abdera.protocol.server.context
Class RequestContextWrapper

java.lang.Object
  extended by org.apache.abdera.protocol.server.context.RequestContextWrapper
All Implemented Interfaces:
Message, Request, RequestContext, ProtocolConstants

public class RequestContextWrapper
extends Object
implements RequestContext


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.abdera.protocol.server.RequestContext
RequestContext.Property, RequestContext.Scope
 
Field Summary
protected  RequestContext request
           
 
Fields inherited from interface org.apache.abdera.protocol.util.ProtocolConstants
NOCACHE, NOSTORE, NOTRANSFORM, ONLYIFCACHED, PRIVATE, PROXYREVALIDATE, PUBLIC, REVALIDATE
 
Constructor Summary
RequestContextWrapper(RequestContext request)
           
 
Method Summary
 String absoluteUrlFor(Object key, Object param)
          Construct an absolute URL using the Provider's Target Builder.
 Abdera getAbdera()
          Get the Abdera instance associated with this request
 String getAccept()
          Get the value of the Accept header
 String getAcceptCharset()
          Get the value of the Accept-Charset header
 String getAcceptEncoding()
          Get the value of the Accept-Encoding header
 String getAcceptLanguage()
          Get the value of the Accept-Language header
 Object getAttribute(RequestContext.Scope scope, String name)
          Get the named attribute from the specified scope
 String[] getAttributeNames(RequestContext.Scope scope)
          Return the list of attribute names in the specified scope
 String getAuthorization()
          Get the value of the Authorization header
 IRI getBaseUri()
          Get the absolute base URI ... this is the request URI up to the Context Path of the web application within which the Abdera Servlet is deployed
 String getCacheControl()
          Return the value of the Cache-Control header
 String getContentLanguage()
          Return the value of the Content-Language header
 IRI getContentLocation()
          Return the value of the Content-Location header
 javax.activation.MimeType getContentType()
          Return the value of the Content-Type header
 String getContextPath()
          Return the web applications context path
 Date getDateHeader(String name)
          Return the value of a Date header
 String getDecodedHeader(String name)
          Get the decoded value of a RFC 2047 header
 String[] getDecodedHeaders(String name)
          Return multiple decoded values for the specified header
<T extends Element>
Document<T>
getDocument()
          Use the Abdera Parser to parse the request entity as an XML document
<T extends Element>
Document<T>
getDocument(Parser parser)
          Use the Abdera Parser to parse the request entity as an XML document
<T extends Element>
Document<T>
getDocument(ParserOptions options)
          Use the Abdera Parser to parse the request entity as an XML document
<T extends Element>
Document<T>
getDocument(Parser parser, ParserOptions options)
          Use the Abdera Parser to parse the request entity as an XML document
 String getHeader(String name)
          Get the value of the specified header
 String[] getHeaderNames()
          Return a listing of header names
 Object[] getHeaders(String name)
          Return multiple values for the specified header
 org.apache.abdera.util.EntityTag[] getIfMatch()
          Get a listing of Etags from the If-Match header
 Date getIfModifiedSince()
          Get the value of the If-Modified-Since header
 org.apache.abdera.util.EntityTag[] getIfNoneMatch()
          Get a listing of ETags from the If-None-Match header
 Date getIfUnmodifiedSince()
          Get the value of the If-Unmodified-Since header
 InputStream getInputStream()
          Get the InputStream containing the request entity
 long getMaxAge()
          Return the maximum-age as specified by the Cache-Control header
 long getMaxStale()
          Get the max-stale value from the Cache-Control header
 String getMethod()
          Get the HTTP method
 long getMinFresh()
          Get the min-fresh value from the Cache-Control header
 String getParameter(String name)
          Get the specified request parameter
 String[] getParameterNames()
          Return the listing of parameter names
 List<String> getParameters(String name)
          Return all the values for the specified parameter
 Locale getPreferredLocale()
          Get the client's preferred locale as specified in the request
 Locale[] getPreferredLocales()
          Get a listing of the client's preferred locales as specified in the request.
 Principal getPrincipal()
          Get this requests authenticated Principal object
 Object getProperty(RequestContext.Property property)
          Get the specified system property
 Provider getProvider()
          Get the Provider associated with this request
 Reader getReader()
          Get a Reader containing the request entity
 IRI getResolvedUri()
          Get the absolute request URI (includes server name, port, etc)
 String getSlug()
          Return the value of the Slug header
 Subject getSubject()
          Get this requests resolved Subject
 Target getTarget()
          Get this requests resolved Target
 String getTargetBasePath()
          Returns the subset of the request URI that is the base of the target path (e.g.
 String getTargetPath()
          Returns the subset of the request URI that is to be used to resolve the Target (everything after the context path)
 IRI getUri()
          Get the request URI
 boolean isAtom()
           
 boolean isNoCache()
          Return true if the Cache-Control header contains no-cache
 boolean isNoStore()
          Return true if the Cache-Control header contains no-store
 boolean isNoTransform()
          Return true if the Cache-Control header contains no-transform
 boolean isOnlyIfCached()
          True if the only-if-cached directive is set in the Cache-Control header
 boolean isUserInRole(String role)
          Check to see if the authenticated user is in the specified role
 RequestContext setAttribute(RequestContext.Scope scope, String name, Object value)
          Set the named attribute in the specified scope.
 RequestContext setAttribute(String name, Object value)
          Set the named attribute in the request scope
 String urlFor(Object key, Object param)
          Construct a URL using the Provider's Target Builder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

request

protected final RequestContext request
Constructor Detail

RequestContextWrapper

public RequestContextWrapper(RequestContext request)
Method Detail

getAbdera

public Abdera getAbdera()
Description copied from interface: RequestContext
Get the Abdera instance associated with this request

Specified by:
getAbdera in interface RequestContext

getAttribute

public Object getAttribute(RequestContext.Scope scope,
                           String name)
Description copied from interface: RequestContext
Get the named attribute from the specified scope

Specified by:
getAttribute in interface RequestContext

getAttributeNames

public String[] getAttributeNames(RequestContext.Scope scope)
Description copied from interface: RequestContext
Return the list of attribute names in the specified scope

Specified by:
getAttributeNames in interface RequestContext

getBaseUri

public IRI getBaseUri()
Description copied from interface: RequestContext
Get the absolute base URI ... this is the request URI up to the Context Path of the web application within which the Abdera Servlet is deployed

Specified by:
getBaseUri in interface RequestContext

getContextPath

public String getContextPath()
Description copied from interface: RequestContext
Return the web applications context path

Specified by:
getContextPath in interface RequestContext

getDocument

public <T extends Element> Document<T> getDocument()
                                        throws ParseException,
                                               IOException
Description copied from interface: RequestContext
Use the Abdera Parser to parse the request entity as an XML document

Specified by:
getDocument in interface RequestContext
Throws:
ParseException
IOException

getDocument

public <T extends Element> Document<T> getDocument(Parser parser)
                                        throws ParseException,
                                               IOException
Description copied from interface: RequestContext
Use the Abdera Parser to parse the request entity as an XML document

Specified by:
getDocument in interface RequestContext
Throws:
ParseException
IOException

getDocument

public <T extends Element> Document<T> getDocument(Parser parser,
                                                   ParserOptions options)
                                        throws ParseException,
                                               IOException
Description copied from interface: RequestContext
Use the Abdera Parser to parse the request entity as an XML document

Specified by:
getDocument in interface RequestContext
Throws:
ParseException
IOException

getDocument

public <T extends Element> Document<T> getDocument(ParserOptions options)
                                        throws ParseException,
                                               IOException
Description copied from interface: RequestContext
Use the Abdera Parser to parse the request entity as an XML document

Specified by:
getDocument in interface RequestContext
Throws:
ParseException
IOException

getInputStream

public InputStream getInputStream()
                           throws IOException
Description copied from interface: RequestContext
Get the InputStream containing the request entity

Specified by:
getInputStream in interface RequestContext
Throws:
IOException

getMethod

public String getMethod()
Description copied from interface: RequestContext
Get the HTTP method

Specified by:
getMethod in interface RequestContext

getParameter

public String getParameter(String name)
Description copied from interface: RequestContext
Get the specified request parameter

Specified by:
getParameter in interface RequestContext

getParameterNames

public String[] getParameterNames()
Description copied from interface: RequestContext
Return the listing of parameter names

Specified by:
getParameterNames in interface RequestContext

getParameters

public List<String> getParameters(String name)
Description copied from interface: RequestContext
Return all the values for the specified parameter

Specified by:
getParameters in interface RequestContext

getPreferredLocale

public Locale getPreferredLocale()
Description copied from interface: RequestContext
Get the client's preferred locale as specified in the request

Specified by:
getPreferredLocale in interface RequestContext

getPreferredLocales

public Locale[] getPreferredLocales()
Description copied from interface: RequestContext
Get a listing of the client's preferred locales as specified in the request. The listing will be sorted in order of preference.

Specified by:
getPreferredLocales in interface RequestContext

getPrincipal

public Principal getPrincipal()
Description copied from interface: RequestContext
Get this requests authenticated Principal object

Specified by:
getPrincipal in interface RequestContext

getProperty

public Object getProperty(RequestContext.Property property)
Description copied from interface: RequestContext
Get the specified system property

Specified by:
getProperty in interface RequestContext

getProvider

public Provider getProvider()
Description copied from interface: RequestContext
Get the Provider associated with this request

Specified by:
getProvider in interface RequestContext

getReader

public Reader getReader()
                 throws IOException
Description copied from interface: RequestContext
Get a Reader containing the request entity

Specified by:
getReader in interface RequestContext
Throws:
IOException

getResolvedUri

public IRI getResolvedUri()
Description copied from interface: RequestContext
Get the absolute request URI (includes server name, port, etc)

Specified by:
getResolvedUri in interface RequestContext

getSubject

public Subject getSubject()
Description copied from interface: RequestContext
Get this requests resolved Subject

Specified by:
getSubject in interface RequestContext

getTarget

public Target getTarget()
Description copied from interface: RequestContext
Get this requests resolved Target

Specified by:
getTarget in interface RequestContext

getTargetPath

public String getTargetPath()
Description copied from interface: RequestContext
Returns the subset of the request URI that is to be used to resolve the Target (everything after the context path)

Specified by:
getTargetPath in interface RequestContext

getUri

public IRI getUri()
Description copied from interface: RequestContext
Get the request URI

Specified by:
getUri in interface RequestContext

isUserInRole

public boolean isUserInRole(String role)
Description copied from interface: RequestContext
Check to see if the authenticated user is in the specified role

Specified by:
isUserInRole in interface RequestContext

setAttribute

public RequestContext setAttribute(RequestContext.Scope scope,
                                   String name,
                                   Object value)
Description copied from interface: RequestContext
Set the named attribute in the specified scope. If Session scope is specific, a new session will be created if one does not already exist

Specified by:
setAttribute in interface RequestContext

setAttribute

public RequestContext setAttribute(String name,
                                   Object value)
Description copied from interface: RequestContext
Set the named attribute in the request scope

Specified by:
setAttribute in interface RequestContext

getAccept

public String getAccept()
Description copied from interface: Request
Get the value of the Accept header

Specified by:
getAccept in interface Request

getAcceptCharset

public String getAcceptCharset()
Description copied from interface: Request
Get the value of the Accept-Charset header

Specified by:
getAcceptCharset in interface Request

getAcceptEncoding

public String getAcceptEncoding()
Description copied from interface: Request
Get the value of the Accept-Encoding header

Specified by:
getAcceptEncoding in interface Request

getAcceptLanguage

public String getAcceptLanguage()
Description copied from interface: Request
Get the value of the Accept-Language header

Specified by:
getAcceptLanguage in interface Request

getAuthorization

public String getAuthorization()
Description copied from interface: Request
Get the value of the Authorization header

Specified by:
getAuthorization in interface Request

getIfMatch

public org.apache.abdera.util.EntityTag[] getIfMatch()
Description copied from interface: Request
Get a listing of Etags from the If-Match header

Specified by:
getIfMatch in interface Request

getIfModifiedSince

public Date getIfModifiedSince()
Description copied from interface: Request
Get the value of the If-Modified-Since header

Specified by:
getIfModifiedSince in interface Request

getIfNoneMatch

public org.apache.abdera.util.EntityTag[] getIfNoneMatch()
Description copied from interface: Request
Get a listing of ETags from the If-None-Match header

Specified by:
getIfNoneMatch in interface Request

getIfUnmodifiedSince

public Date getIfUnmodifiedSince()
Description copied from interface: Request
Get the value of the If-Unmodified-Since header

Specified by:
getIfUnmodifiedSince in interface Request

getMaxStale

public long getMaxStale()
Description copied from interface: Request
Get the max-stale value from the Cache-Control header

Specified by:
getMaxStale in interface Request

getMinFresh

public long getMinFresh()
Description copied from interface: Request
Get the min-fresh value from the Cache-Control header

Specified by:
getMinFresh in interface Request

isOnlyIfCached

public boolean isOnlyIfCached()
Description copied from interface: Request
True if the only-if-cached directive is set in the Cache-Control header

Specified by:
isOnlyIfCached in interface Request

getCacheControl

public String getCacheControl()
Description copied from interface: Message
Return the value of the Cache-Control header

Specified by:
getCacheControl in interface Message

getContentLanguage

public String getContentLanguage()
Description copied from interface: Message
Return the value of the Content-Language header

Specified by:
getContentLanguage in interface Message

getContentLocation

public IRI getContentLocation()
Description copied from interface: Message
Return the value of the Content-Location header

Specified by:
getContentLocation in interface Message

getContentType

public javax.activation.MimeType getContentType()
Description copied from interface: Message
Return the value of the Content-Type header

Specified by:
getContentType in interface Message

getDateHeader

public Date getDateHeader(String name)
Description copied from interface: Message
Return the value of a Date header

Specified by:
getDateHeader in interface Message

getDecodedHeader

public String getDecodedHeader(String name)
Description copied from interface: Message
Get the decoded value of a RFC 2047 header

Specified by:
getDecodedHeader in interface Message

getDecodedHeaders

public String[] getDecodedHeaders(String name)
Description copied from interface: Message
Return multiple decoded values for the specified header

Specified by:
getDecodedHeaders in interface Message

getHeader

public String getHeader(String name)
Description copied from interface: Message
Get the value of the specified header

Specified by:
getHeader in interface Message

getHeaderNames

public String[] getHeaderNames()
Description copied from interface: Message
Return a listing of header names

Specified by:
getHeaderNames in interface Message

getHeaders

public Object[] getHeaders(String name)
Description copied from interface: Message
Return multiple values for the specified header

Specified by:
getHeaders in interface Message

getMaxAge

public long getMaxAge()
Description copied from interface: Message
Return the maximum-age as specified by the Cache-Control header

Specified by:
getMaxAge in interface Message

getSlug

public String getSlug()
Description copied from interface: Message
Return the value of the Slug header

Specified by:
getSlug in interface Message

isNoCache

public boolean isNoCache()
Description copied from interface: Message
Return true if the Cache-Control header contains no-cache

Specified by:
isNoCache in interface Message

isNoStore

public boolean isNoStore()
Description copied from interface: Message
Return true if the Cache-Control header contains no-store

Specified by:
isNoStore in interface Message

isNoTransform

public boolean isNoTransform()
Description copied from interface: Message
Return true if the Cache-Control header contains no-transform

Specified by:
isNoTransform in interface Message

urlFor

public String urlFor(Object key,
                     Object param)
Description copied from interface: RequestContext
Construct a URL using the Provider's Target Builder

Specified by:
urlFor in interface RequestContext

getTargetBasePath

public String getTargetBasePath()
Description copied from interface: RequestContext
Returns the subset of the request URI that is the base of the target path (e.g. HttpServletRequest.getServletPath())

Specified by:
getTargetBasePath in interface RequestContext
Returns:

absoluteUrlFor

public String absoluteUrlFor(Object key,
                             Object param)
Description copied from interface: RequestContext
Construct an absolute URL using the Provider's Target Builder. Relative URL's are resolved against the base URI

Specified by:
absoluteUrlFor in interface RequestContext

isAtom

public boolean isAtom()
Specified by:
isAtom in interface RequestContext


Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.