org.vfny.geoserver.requests
Class Requests

java.lang.Object
  extended byorg.vfny.geoserver.requests.Requests

public final class Requests
extends java.lang.Object

Utility methods helpful when processing GeoServer Requests.

Provides helper functions and classes useful when implementing your own Response classes. Of significant importantance are the Request processing functions that allow access to the WebContainer, GeoServer and the User's Session.

If you are working with the STRUTS API the Action method is the direct paralle of the Response classes. You may whish to look at how ConfigAction is implemented, it is a super class which delegates to these Request processing methods.


Constructor Summary
Requests()
           
 
Method Summary
static ApplicationState getApplicationState(javax.servlet.http.HttpServletRequest request)
          Access GeoServer Application State from the WebContainer.
static java.lang.String getBaseUrl(javax.servlet.http.HttpServletRequest httpServletRequest)
           
static GeoServer getGeoServer(javax.servlet.http.HttpServletRequest request)
          Aquire GeoServer from Web Container.
static UserContainer getUserContainer(javax.servlet.http.HttpServletRequest request)
          Aquire type safe session information in a UserContainer.
static ValidationProcessor getValidationProcessor(javax.servlet.http.HttpServletRequest request)
          Aquire ValidationProcessor from Web Container.
static boolean isLoggedIn(javax.servlet.http.HttpServletRequest request)
          Tests is user is loggin in.
static void logOut(javax.servlet.http.HttpServletRequest request)
          Ensures a user is logged out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Requests

public Requests()
Method Detail

getGeoServer

public static GeoServer getGeoServer(javax.servlet.http.HttpServletRequest request)
Aquire GeoServer from Web Container.

In GeoServer is create by a STRUTS plug-in and is available through the Web container.

Test cases may seed the request object with a Mock WebContainer and a Mock GeoServer.

Parameters:
request - HttpServletRequest used to aquire servlet context
Returns:
GeoServer instance for the current Web Application

getValidationProcessor

public static ValidationProcessor getValidationProcessor(javax.servlet.http.HttpServletRequest request)
Aquire ValidationProcessor from Web Container.

In ValidationProcessor is create by a STRUTS plug-in and is available through the Web container.

Test cases may seed the request object with a Mock WebContainer and a Mock ValidationProcessor.

Parameters:
request - HttpServletRequest used to aquire servlet context
Returns:
ValidationProcessor instance for the current Web Application

getBaseUrl

public static java.lang.String getBaseUrl(javax.servlet.http.HttpServletRequest httpServletRequest)

getUserContainer

public static UserContainer getUserContainer(javax.servlet.http.HttpServletRequest request)
Aquire type safe session information in a UserContainer.

Please note that the UserContainer may be lazyly created.

Parameters:
request - Http Request used to aquire session reference
Returns:
UserContainer containing typesafe session information.

isLoggedIn

public static boolean isLoggedIn(javax.servlet.http.HttpServletRequest request)
Tests is user is loggin in.

True if UserContainer exists has been created.

Parameters:
request - HttpServletRequest providing current Session
Returns:

logOut

public static void logOut(javax.servlet.http.HttpServletRequest request)
Ensures a user is logged out.

Removes the UserContainer, and thus GeoServers knowledge of the current user attached to this Session.

Parameters:
request - HttpServletRequest providing current Session

getApplicationState

public static ApplicationState getApplicationState(javax.servlet.http.HttpServletRequest request)
Access GeoServer Application State from the WebContainer.

Parameters:
request - DOCUMENT ME!
Returns:
Configuration model for Catalog information.