org.ibisph.mvc.controller.query
Class QueryApplicationProxy

java.lang.Object
  extended by org.ibisph.mvc.controller.query.QueryApplicationProxy
All Implemented Interfaces:
org.springframework.web.servlet.mvc.Controller

public class QueryApplicationProxy
extends java.lang.Object
implements org.springframework.web.servlet.mvc.Controller

Controller that passes IBISQ query requests through to the CGI app. This allows for test machines to be able to submit queries to a protected IBISQ system. Utah's OIT has the IBISQ CGI app on a server in a private network which only allows the IBIS-IRV server access. This also helps in not having to have a development test machine with a seperate copy of the SAS datasets and a SAS lic.

Author:
Garth Braithwaite, STG

Field Summary
protected  java.lang.String ibisqCGIAppURL
           
protected  java.lang.String password
           
protected  java.lang.String urlCharacterEncoding
           
protected  java.lang.String username
           
 
Constructor Summary
QueryApplicationProxy(java.lang.String ibisqCGIAppURL)
          Sets the IBIS-Q Application's CGI URL.
 
Method Summary
 org.springframework.web.servlet.ModelAndView handleRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Controller method called by the Spring MVC framework to handle the request.
 void setPassword(java.lang.String password)
          Sets an optional HTTP request username password.
 void setURLCharacterEncoding(java.lang.String urlCharacterEncoding)
          Sets an optional Character Encoding to be used when building the IBIS-Q query string.
 void setUsername(java.lang.String username)
          Sets an optional HTTP request username.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ibisqCGIAppURL

protected java.lang.String ibisqCGIAppURL

username

protected java.lang.String username

password

protected java.lang.String password

urlCharacterEncoding

protected java.lang.String urlCharacterEncoding
Constructor Detail

QueryApplicationProxy

public QueryApplicationProxy(java.lang.String ibisqCGIAppURL)
Sets the IBIS-Q Application's CGI URL.

Parameters:
ibisqCGIAppURL - URL of the IBIS-Q CGI app. This URL typically does not contain any URL query string data/parameters (although it could). These query string parameters are typically added later after the module has been presented to the user and they have submitted their query.
Method Detail

setURLCharacterEncoding

public void setURLCharacterEncoding(java.lang.String urlCharacterEncoding)
Sets an optional Character Encoding to be used when building the IBIS-Q query string.

Parameters:
urlCharacterEncoding - Value to be used by the encode method.

setUsername

public void setUsername(java.lang.String username)
Sets an optional HTTP request username. The IBIS-Q Application's CGI URL request may be protected by a username/password.

Parameters:
username - Value to be supplied as the HTTP request username.

setPassword

public void setPassword(java.lang.String password)
Sets an optional HTTP request username password. The IBIS-Q Application's CGI URL request may be protected by a username/password.

Parameters:
password - Value to be supplied as the HTTP request username's password.

handleRequest

public org.springframework.web.servlet.ModelAndView handleRequest(javax.servlet.http.HttpServletRequest request,
                                                                  javax.servlet.http.HttpServletResponse response)
                                                           throws java.io.IOException,
                                                                  java.net.URISyntaxException
Controller method called by the Spring MVC framework to handle the request. This method handles building the new, real IBIS-Q query string, submitting the request to the CGI app, and then streaming the result back to the original requester.

Specified by:
handleRequest in interface org.springframework.web.servlet.mvc.Controller
Parameters:
request - HTTP Servlet Request passed from the servlet.
response - HTTP Servlet Response passed from the servlet.
Returns:
null - Handles its own error and success view responses.
Throws:
java.io.IOException
java.net.URISyntaxException