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

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
All Implemented Interfaces:
Message, Request, RequestContext, ProtocolConstants
Direct Known Subclasses:
ServletRequestContext

public abstract class AbstractRequestContext
extends AbstractRequest
implements RequestContext


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.abdera.protocol.server.RequestContext
RequestContext.Property, RequestContext.Scope
 
Field Summary
protected  IRI baseUri
           
protected  Document<?> document
           
protected  String method
           
protected  Principal principal
           
protected  Provider provider
           
protected  IRI requestUri
           
protected  Subject subject
           
protected  Target 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
protected AbstractRequestContext(Provider provider, String method, IRI requestUri, IRI baseUri)
           
 
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
 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
<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 getMethod()
          Get the HTTP method
 Principal getPrincipal()
          Get this requests authenticated Principal object
 Provider getProvider()
          Get the Provider associated with this request
 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 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
protected  Target initTarget()
           
 boolean isAtom()
           
 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 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
getAttribute, getAttributeNames, getContextPath, getInputStream, getParameter, getParameterNames, getParameters, getPreferredLocale, getPreferredLocales, getProperty, getReader, getTargetBasePath, isUserInRole, setAttribute
 
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
 

Field Detail

provider

protected final Provider provider

subject

protected Subject subject

principal

protected Principal principal

target

protected Target target

method

protected final String method

requestUri

protected final IRI requestUri

baseUri

protected final IRI baseUri

document

protected Document<?> document
Constructor Detail

AbstractRequestContext

protected AbstractRequestContext(Provider provider,
                                 String method,
                                 IRI requestUri,
                                 IRI baseUri)
Method Detail

initTarget

protected Target initTarget()

getAbdera

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

Specified by:
getAbdera 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(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(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

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

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

getMethod

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

Specified by:
getMethod in interface RequestContext

getUri

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

Specified by:
getUri in interface RequestContext

getSubject

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

Specified by:
getSubject in interface RequestContext

getPrincipal

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

Specified by:
getPrincipal in interface RequestContext

getTarget

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

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

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

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

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

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.