org.springframework.extensions.webscripts
Class WebScriptRequestImpl

java.lang.Object
  extended by org.springframework.extensions.webscripts.WebScriptRequestImpl
All Implemented Interfaces:
WebScriptRequest
Direct Known Subclasses:
WebScriptRequestURLImpl, WebScriptServletRequest

public abstract class WebScriptRequestImpl
extends Object
implements WebScriptRequest

Basic Implementation of a Web Script Request

Author:
davidc

Field Summary
protected static org.apache.commons.logging.Log logger
           
 
Constructor Summary
WebScriptRequestImpl(Runtime runtime)
          Construct
 
Method Summary
 boolean forceSuccessStatus()
          Force response to return SUCCESS (200) code Note: This is to support clients who cannot support non-success codes e.g.
 String getContentType()
          Gets the mimetype of the request
 String getExtensionPath()
          Gets the path extension beyond the path registered for this service e.g.
 String getFormat()
          Get Requested Format
 Description.FormatStyle getFormatStyle()
          Get the style the Format was specified in
 String getJSONCallback()
          Get the JSON callback method
 Runtime getRuntime()
          Gets the initiating runtime
 boolean isGuest()
          Determine if Guest User?
 Object parseContent()
          Gets the request body as a parsed entity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.extensions.webscripts.WebScriptRequest
getAgent, getContent, getContextPath, getHeader, getHeaderNames, getHeaderValues, getParameter, getParameterNames, getParameterValues, getPathInfo, getQueryString, getServerPath, getServiceContextPath, getServiceMatch, getServicePath, getURL
 

Field Detail

logger

protected static final org.apache.commons.logging.Log logger
Constructor Detail

WebScriptRequestImpl

public WebScriptRequestImpl(Runtime runtime)
Construct

Parameters:
runtime -
Method Detail

getRuntime

public Runtime getRuntime()
Description copied from interface: WebScriptRequest
Gets the initiating runtime

Specified by:
getRuntime in interface WebScriptRequest
Returns:
runtime that constructed this request

getExtensionPath

public String getExtensionPath()
Description copied from interface: WebScriptRequest
Gets the path extension beyond the path registered for this service e.g. a) service registered path = /search/engine b) request path = /search/engine/external => /external

Specified by:
getExtensionPath in interface WebScriptRequest
Returns:
extension path

isGuest

public boolean isGuest()
Description copied from interface: WebScriptRequest
Determine if Guest User?

Specified by:
isGuest in interface WebScriptRequest
Returns:
true => guest user

getFormat

public String getFormat()
Description copied from interface: WebScriptRequest
Get Requested Format

Specified by:
getFormat in interface WebScriptRequest
Returns:
content type requested

getFormatStyle

public Description.FormatStyle getFormatStyle()
Description copied from interface: WebScriptRequest
Get the style the Format was specified in

Specified by:
getFormatStyle in interface WebScriptRequest
Returns:
format style (excludes any)

getJSONCallback

public String getJSONCallback()
Description copied from interface: WebScriptRequest
Get the JSON callback method

Specified by:
getJSONCallback in interface WebScriptRequest
Returns:
method (or null, if not specified)

forceSuccessStatus

public boolean forceSuccessStatus()
Description copied from interface: WebScriptRequest
Force response to return SUCCESS (200) code Note: This is to support clients who cannot support non-success codes e.g. Flash player

Specified by:
forceSuccessStatus in interface WebScriptRequest
Returns:
true => force return of 200, otherwise return status explicitly set

getContentType

public String getContentType()
Description copied from interface: WebScriptRequest
Gets the mimetype of the request

Specified by:
getContentType in interface WebScriptRequest
Returns:
request content mimetype

parseContent

public Object parseContent()
Description copied from interface: WebScriptRequest
Gets the request body as a parsed entity

Specified by:
parseContent in interface WebScriptRequest
Returns:
the parsed entity (or null, if no content, or the content type cannot be parsed)


Copyright © 2009 SpringSource, Inc. All Rights Reserved.