org.apache.abdera.protocol.server
Interface RequestContext

All Superinterfaces:
Message, ProtocolConstants, Request
All Known Implementing Classes:
AbstractRequestContext, RequestContextWrapper, ServletRequestContext

public interface RequestContext
extends Request

The RequestContext provides access to every detail of the Request.


Nested Class Summary
static class RequestContext.Property
          Special properties provided by the server
static class RequestContext.Scope
          RequestContext attributes can either have Session or Request scope.
 
Field Summary
 
Fields inherited from interface org.apache.abdera.protocol.util.ProtocolConstants
NOCACHE, NOSTORE, NOTRANSFORM, ONLYIFCACHED, PRIVATE, PROXYREVALIDATE, PUBLIC, REVALIDATE
 
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
 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
 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 getContextPath()
          Return the web applications context path
<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
 InputStream getInputStream()
          Get the InputStream containing the request entity
 String getMethod()
          Get the HTTP method
 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)
 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 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 interface org.apache.abdera.protocol.Request
getAccept, getAcceptCharset, getAcceptEncoding, getAcceptLanguage, getAuthorization, getIfMatch, getIfModifiedSince, getIfNoneMatch, getIfUnmodifiedSince, getMaxStale, getMinFresh, isOnlyIfCached
 
Methods inherited from interface org.apache.abdera.protocol.Message
getCacheControl, getContentLanguage, getContentLocation, getContentType, getDateHeader, getDecodedHeader, getDecodedHeaders, getHeader, getHeaderNames, getHeaders, getMaxAge, getSlug, isNoCache, isNoStore, isNoTransform
 

Method Detail

getAbdera

Abdera getAbdera()
Get the Abdera instance associated with this request


getProvider

Provider getProvider()
Get the Provider associated with this request


getTarget

Target getTarget()
Get this requests resolved Target


getSubject

Subject getSubject()
Get this requests resolved Subject


getPrincipal

Principal getPrincipal()
Get this requests authenticated Principal object


getPreferredLocale

Locale getPreferredLocale()
Get the client's preferred locale as specified in the request


getPreferredLocales

Locale[] getPreferredLocales()
Get a listing of the client's preferred locales as specified in the request. The listing will be sorted in order of preference.


getMethod

String getMethod()
Get the HTTP method


getUri

IRI getUri()
Get the request URI


getResolvedUri

IRI getResolvedUri()
Get the absolute request URI (includes server name, port, etc)


getBaseUri

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


getProperty

Object getProperty(RequestContext.Property property)
Get the specified system property


getParameter

String getParameter(String name)
Get the specified request parameter


getParameterNames

String[] getParameterNames()
Return the listing of parameter names


getParameters

List<String> getParameters(String name)
Return all the values for the specified parameter


getAttribute

Object getAttribute(RequestContext.Scope scope,
                    String name)
Get the named attribute from the specified scope


getAttributeNames

String[] getAttributeNames(RequestContext.Scope scope)
Return the list of attribute names in the specified scope


setAttribute

RequestContext setAttribute(String name,
                            Object value)
Set the named attribute in the request scope


setAttribute

RequestContext setAttribute(RequestContext.Scope scope,
                            String name,
                            Object value)
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


getInputStream

InputStream getInputStream()
                           throws IOException
Get the InputStream containing the request entity

Throws:
IOException

getReader

Reader getReader()
                 throws IOException
Get a Reader containing the request entity

Throws:
IOException

getDocument

<T extends Element> Document<T> getDocument()
                                        throws ParseException,
                                               IOException
Use the Abdera Parser to parse the request entity as an XML document

Throws:
ParseException
IOException

getDocument

<T extends Element> Document<T> getDocument(Parser parser)
                                        throws ParseException,
                                               IOException
Use the Abdera Parser to parse the request entity as an XML document

Throws:
ParseException
IOException

getDocument

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

Throws:
ParseException
IOException

getDocument

<T extends Element> Document<T> getDocument(ParserOptions options)
                                        throws ParseException,
                                               IOException
Use the Abdera Parser to parse the request entity as an XML document

Throws:
ParseException
IOException

isUserInRole

boolean isUserInRole(String role)
Check to see if the authenticated user is in the specified role


getContextPath

String getContextPath()
Return the web applications context path


getTargetPath

String getTargetPath()
Returns the subset of the request URI that is to be used to resolve the Target (everything after the context path)


getTargetBasePath

String getTargetBasePath()
Returns the subset of the request URI that is the base of the target path (e.g. HttpServletRequest.getServletPath())

Returns:

urlFor

String urlFor(Object key,
              Object param)
Construct a URL using the Provider's Target Builder


absoluteUrlFor

String absoluteUrlFor(Object key,
                      Object param)
Construct an absolute URL using the Provider's Target Builder. Relative URL's are resolved against the base URI


isAtom

boolean isAtom()


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