org.abstracthorizon.danube.tapestry
Class DanubeRequest

java.lang.Object
  extended by org.abstracthorizon.danube.tapestry.DanubeRequest
All Implemented Interfaces:
Describable, AttributeHolder, WebRequest

public class DanubeRequest
extends Object
implements WebRequest

WebRequest interface implementation

Author:
Daniel Sendula

Field Summary
protected  HTTPConnection connection
          Reference connection
protected  HTTPSessionManager sessionManager
          Session manager
 
Constructor Summary
DanubeRequest(HTTPConnection connection, HTTPSessionManager sessionManager)
          Constructor
 
Method Summary
 void describeTo(DescriptionReceiver descriptionReceiver)
          Does nothing
 void forward(String url)
          Forwards internally to given URL
 String getActivationPath()
          Returns component's path
 Object getAttribute(String name)
          Returns attribute value
 List getAttributeNames()
          Returns attribute names
 String getContextPath()
          Returns context path
 String getHeader(String name)
          Returns header's value
 Locale getLocale()
          Returns locale
 List getParameterNames()
          Returns parameter names as a list
 String getParameterValue(String name)
          Returns parameter value
 String[] getParameterValues(String name)
          Returns parameter's values
 String getPathInfo()
          Returns path info
 String getRemoteUser()
          Returns remote user
 String getRequestURI()
          Returns request URI
 String getScheme()
          Returns HTTP
 String getServerName()
          Returns server's name
 int getServerPort()
          Returns port request is served from.
 WebSession getSession(boolean create)
          Returns session
 Principal getUserPrincipal()
          Returns user principal
 boolean isUserInRole(String role)
          Checks if user is in role
 void setAttribute(String name, Object value)
          Sets attribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connection

protected HTTPConnection connection
Reference connection


sessionManager

protected HTTPSessionManager sessionManager
Session manager

Constructor Detail

DanubeRequest

public DanubeRequest(HTTPConnection connection,
                     HTTPSessionManager sessionManager)
Constructor

Parameters:
connection - connection
sessionManager - session manager
Method Detail

getParameterNames

public List getParameterNames()
Returns parameter names as a list

Specified by:
getParameterNames in interface WebRequest
Returns:
parameter names as a list

getParameterValue

public String getParameterValue(String name)
Returns parameter value

Specified by:
getParameterValue in interface WebRequest
Parameters:
name - parameter's name
Returns:
parameter value

getParameterValues

public String[] getParameterValues(String name)
Returns parameter's values

Specified by:
getParameterValues in interface WebRequest
Parameters:
name - parameter's name
Returns:
array of attribute's values

getContextPath

public String getContextPath()
Returns context path

Specified by:
getContextPath in interface WebRequest
Returns:
context path

getSession

public WebSession getSession(boolean create)
Returns session

Specified by:
getSession in interface WebRequest
Parameters:
create - if true new session is going to be create if it doesn't exist already
Returns:
web sesison

getScheme

public String getScheme()
Returns HTTP

Specified by:
getScheme in interface WebRequest
Returns:
scheme

getServerName

public String getServerName()
Returns server's name

Specified by:
getServerName in interface WebRequest
Returns:
server's name

getServerPort

public int getServerPort()
Returns port request is served from. That is server's port.

Specified by:
getServerPort in interface WebRequest
Returns:
server's port

getRequestURI

public String getRequestURI()
Returns request URI

Specified by:
getRequestURI in interface WebRequest
Returns:
request URI

forward

public void forward(String url)
Forwards internally to given URL

Specified by:
forward in interface WebRequest
Parameters:
url - URI to be forwarded to

getActivationPath

public String getActivationPath()
Returns component's path

Specified by:
getActivationPath in interface WebRequest
Returns:
component's path

getPathInfo

public String getPathInfo()
Returns path info

Specified by:
getPathInfo in interface WebRequest
Returns:
path info

getLocale

public Locale getLocale()
Returns locale

Specified by:
getLocale in interface WebRequest
Returns:
locale

getHeader

public String getHeader(String name)
Returns header's value

Specified by:
getHeader in interface WebRequest
Parameters:
name - headers name
Returns:
header's value

getRemoteUser

public String getRemoteUser()
Returns remote user

Specified by:
getRemoteUser in interface WebRequest
Returns:
remote user

getUserPrincipal

public Principal getUserPrincipal()
Returns user principal

Specified by:
getUserPrincipal in interface WebRequest
Returns:
user principal

isUserInRole

public boolean isUserInRole(String role)
Checks if user is in role

Specified by:
isUserInRole in interface WebRequest
Parameters:
role - role
Returns:
true if user is in role

getAttributeNames

public List getAttributeNames()
Returns attribute names

Specified by:
getAttributeNames in interface AttributeHolder
Returns:
attribute names as a list

getAttribute

public Object getAttribute(String name)
Returns attribute value

Specified by:
getAttribute in interface AttributeHolder
Parameters:
name - attribute's name
Returns:
attribute's value

setAttribute

public void setAttribute(String name,
                         Object value)
Sets attribute

Specified by:
setAttribute in interface AttributeHolder
Parameters:
name - attribute's name
value - attribute's value

describeTo

public void describeTo(DescriptionReceiver descriptionReceiver)
Does nothing

Specified by:
describeTo in interface Describable


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.