org.apache.abdera.protocol.server.servlet
Class ServletRequestContext

java.lang.Object
  extended by org.apache.abdera.protocol.util.AbstractMessage
      extended by org.apache.abdera.protocol.util.AbstractRequest
          extended by org.apache.abdera.protocol.server.context.AbstractRequestContext
              extended by org.apache.abdera.protocol.server.servlet.ServletRequestContext
All Implemented Interfaces:
Message, Request, RequestContext, ProtocolConstants

public class ServletRequestContext
extends AbstractRequestContext
implements RequestContext


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.abdera.protocol.server.RequestContext
RequestContext.Property, RequestContext.Scope
 
Field Summary
 
Fields inherited from class org.apache.abdera.protocol.server.context.AbstractRequestContext
baseUri, document, method, principal, provider, requestUri, subject, target
 
Fields inherited from class org.apache.abdera.protocol.util.AbstractRequest
max_stale, min_fresh
 
Fields inherited from class org.apache.abdera.protocol.util.AbstractMessage
flags, max_age
 
Fields inherited from interface org.apache.abdera.protocol.util.ProtocolConstants
NOCACHE, NOSTORE, NOTRANSFORM, ONLYIFCACHED, PRIVATE, PROXYREVALIDATE, PUBLIC, REVALIDATE
 
Constructor Summary
ServletRequestContext(Provider provider, javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext servletContext)
           
 
Method Summary
 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 getContextPath()
          Return the web applications context path
 Date getDateHeader(String name)
          Return the value of a Date header
 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
 InputStream getInputStream()
          Get the InputStream containing the request entity
 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.
 Object getProperty(RequestContext.Property property)
          Get the specified system property
 Reader getReader()
          Get a Reader containing the request entity
 javax.servlet.http.HttpServletRequest getRequest()
           
 javax.servlet.ServletContext getServletContext()
           
 javax.servlet.http.HttpSession getSession()
           
 javax.servlet.http.HttpSession getSession(boolean create)
           
 String getTargetBasePath()
          Returns the subset of the request URI that is the base of the target path (e.g.
 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.
 
Methods inherited from class org.apache.abdera.protocol.server.context.AbstractRequestContext
absoluteUrlFor, getAbdera, getBaseUri, getDocument, getDocument, getDocument, getDocument, getMethod, getPrincipal, getProvider, getResolvedUri, getSubject, getTarget, getTargetPath, getUri, initTarget, isAtom, setAttribute, urlFor
 
Methods inherited from class org.apache.abdera.protocol.util.AbstractRequest
getAccept, getAcceptCharset, getAcceptEncoding, getAcceptLanguage, getAuthorization, getIfMatch, getIfModifiedSince, getIfNoneMatch, getIfUnmodifiedSince, getMaxStale, getMinFresh, isOnlyIfCached, setMaxAge, setMaxStale, setMinFresh, setNoCache, setNoStore, setNoTransform, setOnlyIfCached
 
Methods inherited from class org.apache.abdera.protocol.util.AbstractMessage
check, getCacheControl, getContentLanguage, getContentLocation, getContentType, getDecodedHeader, getDecodedHeaders, getMaxAge, getSlug, isNoCache, isNoStore, isNoTransform, toggle
 
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.server.RequestContext
absoluteUrlFor, getAbdera, getBaseUri, getDocument, getDocument, getDocument, getDocument, getMethod, getPrincipal, getProvider, getResolvedUri, getSubject, getTarget, getTargetPath, getUri, isAtom, setAttribute, urlFor
 
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, getDecodedHeader, getDecodedHeaders, getMaxAge, getSlug, isNoCache, isNoStore, isNoTransform
 

Constructor Detail

ServletRequestContext

public ServletRequestContext(Provider provider,
                             javax.servlet.http.HttpServletRequest request,
                             javax.servlet.ServletContext servletContext)
Method Detail

getProperty

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

Specified by:
getProperty 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

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

getRequest

public javax.servlet.http.HttpServletRequest getRequest()

getServletContext

public javax.servlet.ServletContext getServletContext()

getSession

public javax.servlet.http.HttpSession getSession()

getSession

public javax.servlet.http.HttpSession getSession(boolean create)

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

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

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

getDateHeader

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

Specified by:
getDateHeader 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

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

getContextPath

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

Specified by:
getContextPath 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

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:


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