Java Doc for Requests.java in  » GIS » GeoServer » org » vfny » geoserver » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoServer » org.vfny.geoserver.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.vfny.geoserver.util.Requests

Requests
final public class Requests (Code)
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.


author:
   Jody Garnett


Field Summary
static  LoggerLOGGER
    
final public static  StringPROXY_PARAM
    


Method Summary
public static  StringappendContextPath(String url, String contextPath)
     Appends a context path to a base url.
Parameters:
  url - The base url.
Parameters:
  contextPath - The context path to be appended.
public static  StringappendQueryString(String url, String queryString)
     Appends a query string to a url.

This method checks url to see if the appended query string requires a '?' or '&' to be prepended.


Parameters:
  url - The base url.
Parameters:
  queryString - The query string to be appended, should not contain the '?' character.
public static  StringgetBaseJspUrl(HttpServletRequest httpServletRequest, GeoServer geoserver)
    
public static  StringgetBaseUrl(HttpServletRequest httpServletRequest, GeoServer geoserver)
     Get base url used - it is not any more assumed to be http://server:port/geoserver Removed the hardcoded "http://" and replaced it with httpServletRequest.getScheme() because the https case was not being handled.
public static  InputStreamgetInputStream(URL url)
     This method gets the correct input stream for a URL. If the URL is a http/https connection, the Accept-Encoding: gzip, deflate is added. It the paramter is added, the response is checked to see if the response is encoded in gzip, deflate or plain bytes.
public static  StringgetSchemaBaseUrl(HttpServletRequest httpServletRequest, GeoServer geoserver)
    
public static  StringgetTileCacheBaseUrl(HttpServletRequest request, GeoServer geoServer)
     Returns the full url to the tile cache used by GeoServer ( if any ).

If the tile cache set in the configuration ( GeoServer.getTileCache ) is set to an asbsolute url, it is simply returned.

public static  UserContainergetUserContainer(HttpServletRequest request)
     Aquire type safe session information in a UserContainer.
public static  booleanisLoggedIn(HttpServletRequest request)
     Tests is user is loggin in.
public static  voidlogOut(HttpServletRequest request)
     Ensures a user is logged out.
public static  booleanloggedIn(HttpServletRequest request)
    
public static  MapparseOptionParameter(String rawOptionString)
    

Field Detail
LOGGER
static Logger LOGGER(Code)



PROXY_PARAM
final public static String PROXY_PARAM(Code)





Method Detail
appendContextPath
public static String appendContextPath(String url, String contextPath)(Code)
Appends a context path to a base url.
Parameters:
  url - The base url.
Parameters:
  contextPath - The context path to be appended. A full url with the context path appended.



appendQueryString
public static String appendQueryString(String url, String queryString)(Code)
Appends a query string to a url.

This method checks url to see if the appended query string requires a '?' or '&' to be prepended.


Parameters:
  url - The base url.
Parameters:
  queryString - The query string to be appended, should not contain the '?' character. A full url with the query string appended.



getBaseJspUrl
public static String getBaseJspUrl(HttpServletRequest httpServletRequest, GeoServer geoserver)(Code)



getBaseUrl
public static String getBaseUrl(HttpServletRequest httpServletRequest, GeoServer geoserver)(Code)
Get base url used - it is not any more assumed to be http://server:port/geoserver Removed the hardcoded "http://" and replaced it with httpServletRequest.getScheme() because the https case was not being handled.
Parameters:
  httpServletRequest - http://server:port/path-defined-context



getInputStream
public static InputStream getInputStream(URL url) throws IOException(Code)
This method gets the correct input stream for a URL. If the URL is a http/https connection, the Accept-Encoding: gzip, deflate is added. It the paramter is added, the response is checked to see if the response is encoded in gzip, deflate or plain bytes. The correct input stream wrapper is then selected and returned. This method was added as part of GEOS-420
Parameters:
  url - The url to the sld file The InputStream used to validate and parse the SLD xml.
throws:
  IOException -



getSchemaBaseUrl
public static String getSchemaBaseUrl(HttpServletRequest httpServletRequest, GeoServer geoserver)(Code)
Get capabilities base url used
Parameters:
  httpServletRequest - http://server:port/path-defined-context/data/capabilities



getTileCacheBaseUrl
public static String getTileCacheBaseUrl(HttpServletRequest request, GeoServer geoServer)(Code)
Returns the full url to the tile cache used by GeoServer ( if any ).

If the tile cache set in the configuration ( GeoServer.getTileCache ) is set to an asbsolute url, it is simply returned. Otherwise the value is appended to the scheme and host of the supplied request.


Parameters:
  request - The request.
Parameters:
  geoServer - The geoserver configuration. The url to the tile cache, or null if no tilecache set.



getUserContainer
public static UserContainer getUserContainer(HttpServletRequest request)(Code)
Aquire type safe session information in a UserContainer.
Parameters:
  request - Http Request used to aquire session reference UserContainer containing typesafe session information.



isLoggedIn
public static boolean isLoggedIn(HttpServletRequest request)(Code)
Tests is user is loggin in.

True if UserContainer exists has been created.


Parameters:
  request - HttpServletRequest providing current Session



logOut
public static void logOut(HttpServletRequest request)(Code)
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



loggedIn
public static boolean loggedIn(HttpServletRequest request)(Code)



parseOptionParameter
public static Map parseOptionParameter(String rawOptionString) throws IllegalArgumentException(Code)
Parses an 'option-holding' parameters in the following form FORMAT_OPTIONS=multiKey:val1,val2,val3;singleKey:val Useful for parsing out the FORMAT_OPTIONS and LEGEND_OPTIONS parameters



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.