|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.servlet.GenericServlet | +--javax.servlet.http.HttpServlet | +--oracle.clex.process.controller.HttpServletController
Responsible for dispatching the requests and responses from/to the service. HTTP is a loopback protocol which does not allow much flexibility in how to handle flow. An instance of Controller or one of its subclasses may handle more than one client. Therefore the service which is affected by the particular request may be different from request to request. The affected service is retrieved using the Session object before anything else is done.
<servlet> <servlet-name>personnel-jsp</servlet-name> <servlet-class>oracle.clex.process.controller.HttpServletController</servlet-class> <init-param> <param-name>cle-service-descriptor</param-name> <param-value>personnel-jsp.xml</param-value> </init-param> </servlet>
See the javadocs for the initSSOEnabler(ServletConfig)
method for how to setup an HttpServletController
for use
with Oracle Login Server.
Field Summary | |
protected java.lang.Object |
aSessionIdObj
|
static java.lang.String |
CONTROLLER
|
protected static java.lang.String |
CONTROLLER_USER
The session attribute key for user |
protected boolean |
DEBUG
|
protected static java.lang.String |
DEFAULT_UPLOAD_DIRECTORY
|
protected static int |
DEFAULT_UPLOAD_LIMIT
|
static java.lang.String |
HTTPREQUEST
|
static java.lang.String |
HTTPRESPONSE
|
static java.lang.String |
HTTPSESSIONID
|
static java.lang.String |
INFOTABLEPOOL
|
static java.lang.String |
IS_SESSION_RESET
|
static java.lang.String |
MULTIPART_UPLOAD_DIRECTORY
Deprecated. Use getUploadDirectory() instead. This is not reliable because each controller can have its own upload directory. |
static int |
MULTIPART_UPLOAD_LIMIT
Deprecated. Use getUploadLimit() instead. This is not reliable because each controller can have its own upload limit. |
static java.lang.String |
MULTIPARTREQUEST
|
static java.lang.String |
REQUESTEDVALUES
|
protected Service |
serviceCache
|
protected static PartnerSSOEnabler |
ssoEnabler
|
Constructor Summary | |
HttpServletController()
|
Method Summary | |
void |
buildTransitionTable(TransitionTable aTable)
This method does not do anything at the Controller level, but it is required to implement the method in the Parent interface. |
protected MultipartRequest |
checkMultipartRequest(javax.servlet.http.HttpServletRequest request)
Deprecated. Replaced by handleMultipartRequest for version 2.0. This method must call handleMultipartRequest and will be removed in a future release. Returns a MultipartRequest. This method is invoked from the preServiceStart() method to handle multipart requests. |
protected void |
clearRequestedValues(javax.servlet.http.HttpSession session)
Clears the table that holds on to all the values that have been requested from a particular Request. |
protected java.util.Hashtable |
cloneInfoTable(java.util.Hashtable aTable)
Makes a deep copy of the specified infoTable (Hashtable) This method is just a wrapper for the Object.clone() method that casts to ensure types constraints. |
void |
debug(java.lang.String text)
A simple way to print some debug messages out |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Simply calls doPost(request, response) |
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
This is the standard method to deal with requests. |
java.util.Vector |
getChildren()
TO BE IMPLEMENTED. |
Service |
getConcreteService()
Returns a concrete Service defined by the XML file. |
java.lang.String |
getControllerValue(javax.servlet.http.HttpServletRequest request)
Gets the controller info from the url that accessed this service. |
java.lang.String |
getCurrentContentType(Service service)
Returns the content type from the infoTabe |
java.lang.String |
getDefaultContentType()
Return the default content type for the HttpServletController |
java.lang.Integer |
getDefaultControllerResultType()
Return the default response type for the HttpServletController |
java.lang.Object |
getInfo(java.lang.String key)
Deprecated. This will no longer work. Use getInfo(String, Service) instead. |
java.lang.Object |
getInfo(java.lang.String key,
Service service)
Gets the value(s) for the specified key from the HttpServletRequest. |
java.lang.String |
getLoggedOffPageLocation()
Deprecated. Will remove in future releases. Use logoff=http://logoff?<location> instead of depending on this method. If an invalid location is given using the preferred method mentioned above, the logedoff page will default to the web server root. |
java.lang.String |
getName()
Returns the serviceName attribute. |
protected java.lang.String |
getPageId(javax.servlet.http.HttpServletRequest aRequest,
MultipartRequest aMultipartRequest)
Retrieves the PAGEID parameter from either the HttpServletRequest or MultipartRequest specified. |
Parent |
getParent()
Returns the Parent of the controller. |
java.util.Vector |
getParents()
Returns a Vector of parents of the controller. |
java.lang.String |
getServiceDescriptorName()
Return the name of the service descriptor file |
java.lang.Object |
getSessionId(Service aService)
Returns a unique sessionId for the session under which the specified service is running. |
java.lang.String |
getSetContentType(Service service)
Deprecated. Replaced by getCurrentContentType for version 2.0. This method must internally call getCurrentContentType and will be removed in a future release. |
static PartnerSSOEnabler |
getSSOEnabler()
Returns the PartnerSSOEnabler object that was initialized in init. |
java.lang.String |
getUploadDirectory()
Returns the default upload directory relative to server root ala: /upload
|
int |
getUploadLimit()
Returns the default upload limit(5 MB) |
protected java.lang.String |
getValue(java.lang.String key,
javax.servlet.http.HttpServletRequest aRequest,
MultipartRequest aMultipartRequest)
Retrieves the value for the specefied key from either the HttpServletRequest or MultipartRequest specified. |
protected java.lang.String[] |
getValues(java.lang.String key,
javax.servlet.http.HttpServletRequest aRequest,
MultipartRequest aMultipartRequest)
Retrieves the value for the specefied key from the HttpServletRequest specified. |
java.lang.String |
getWebServerLogLocation()
Return the file location for the web server log file This is used when displaying errors to the "developer" and providing a convenient way to view the log. |
protected boolean |
handleAdditionalResults(Service service,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Override to handle any additional Result Types. |
void |
handleJSPRedirect(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String url)
Handle forwarding to jsp page Refactored from HandleResults so that the PortletController can override it. |
protected void |
handleJSPResult(Service service,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handle JSP Result Refactored from HandleResults |
protected void |
handleLogoff(javax.servlet.http.HttpServletResponse response,
java.lang.String logoffLocation)
Handle logging off (Bug 2601487) Refactored from preServiceStart so that it can be overriden i.e. |
protected MultipartRequest |
handleMultipartRequest(javax.servlet.http.HttpServletRequest request)
Returns a MultipartRequest. |
protected java.util.Vector |
handleNewService(javax.servlet.http.HttpSession session)
if we are in a new Service but have the same session, invalidate the session and get a new one. |
protected User |
handleOSSOLogin(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Does all the work for handling an Oracle Single Sign On Based authentication for the service controlled by this servlet. |
protected oracle.clex.process.controller.PostServiceException |
handlePostServiceException(oracle.clex.process.controller.PostServiceException postSE)
This method is called for most exceptions that occur after the service.start() in this Controller. |
protected oracle.clex.process.controller.PreServiceException |
handlePreServiceException(oracle.clex.process.controller.PreServiceException preSE)
This method is called for most exceptions that occur before the service.start() in this Controller. |
protected void |
handleResults(Service service,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Do whatever has to be done as a result of the service invocation finishing and returning output to the client. |
protected java.lang.Exception |
handleUnhandledException(java.lang.Exception e)
This method is called for any uncaught exceptions that are not handled by handlePreServiceException or
handlePostServiceException . |
void |
init(javax.servlet.ServletConfig sc)
Overloads the init function of the super. |
protected void |
initSessionObjects(javax.servlet.http.HttpSession session)
Cleans out the session objects except for the system user info so that it can be carried forward to another service without the user having to log on. |
protected void |
initSSOEnabler(javax.servlet.ServletConfig sc)
Initialize PartnerSSOEnabler static attribute with
servlet configuration argumentsusage example: |
protected boolean |
isMultipartFormData(javax.servlet.http.HttpServletRequest httpRequest)
Returns true if the request content type is MULTIPARTFORMDATA. |
protected void |
loadServiceInfo(Service service,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Registers Process Results in service's infoTable. |
protected MultipartRequest |
newMultipartRequest(javax.servlet.http.HttpServletRequest request)
Returns a new MultipartRequest instance for the given request. |
protected void |
postServiceStart(Service service,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Saves the state of the service. |
protected Service |
preServiceStart(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Called in doPost. |
void |
processParameters(Child aChildProcess)
This method does not do anything at the Controller level, but it is required to implement the method in the Parent interface. |
void |
processResults(Child aChildProcess)
This method does not do anything at the Controller level, but it is required to implement the method in the Parent interface. |
protected void |
saveState(Service service,
javax.servlet.http.HttpSession session)
Saves this service's state to the session for the next invocation. |
protected void |
setName(java.lang.String aServiceName)
Set the name of the service |
protected void |
setServiceDescriptorName(java.lang.String aServiceDescriptorName)
Set the name of the service descriptor file |
void |
terminate()
Deprecated. This method may be removed in a future release |
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service, service |
Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean DEBUG
public static final java.lang.String INFOTABLEPOOL
public static final java.lang.String REQUESTEDVALUES
public static final java.lang.String HTTPSESSIONID
public static final java.lang.String IS_SESSION_RESET
public static final java.lang.String HTTPREQUEST
public static final java.lang.String HTTPRESPONSE
public static final java.lang.String MULTIPARTREQUEST
public static final java.lang.String CONTROLLER
protected static final java.lang.String DEFAULT_UPLOAD_DIRECTORY
protected static final int DEFAULT_UPLOAD_LIMIT
protected static final java.lang.String CONTROLLER_USER
public static java.lang.String MULTIPART_UPLOAD_DIRECTORY
public static int MULTIPART_UPLOAD_LIMIT
protected static PartnerSSOEnabler ssoEnabler
protected Service serviceCache
protected java.lang.Object aSessionIdObj
Constructor Detail |
public HttpServletController()
Method Detail |
public void init(javax.servlet.ServletConfig sc) throws javax.servlet.ServletException
init
in class javax.servlet.GenericServlet
protected void initSSOEnabler(javax.servlet.ServletConfig sc) throws javax.servlet.ServletException
PartnerSSOEnabler
static attribute with
servlet configuration argumentsIn web.xml: <servlet> <servlet-name>proxyservlet</servlet-name> <servlet-class>oracle.clex.process.controller.HttpServletController</servlet-class> <init-param> <param-name>cle-service-descriptor</param-name> <param-value>aservice.xml</param-value> </init-param> <init-param> <param-name>provider_root</param-name> <param-value>C:\Oracle\iSuites\portal30\jpdk\providers\partnerApp, sessiontimeout=1800000</param-value> </init-param> <init-param> <param-name>listenerToken</param-name> <param-value>proxyservlet:login.server.host:80</param-value> </init-param> <init-param> <param-name>requestedUrl</param-name> <param-value>http://localhost:8888/servlet/proxyservlet</param-value> </init-param> <init-param> <param-name>onCancelUrl</param-name> <param-value>http://localhost:8888/</param-value> </init-param> <init-param> <param-name>partnerAppCookieName</param-name> <param-value>SSO_PAPP_SERVLET_ID</param-value> </init-param> <init-param> <param-name>partnerAppCookieDomain</param-name> <param-value>my.domain.com</param-value> </init-param> <init-param> <param-name>partnerAppCookieScope</param-name> <param-value>/</param-value> </init-param> <init-param> <param-name>partnerAppCookieDesc</param-name> <param-value>SSO application cookie</param-value> </init-param> <init-param> <param-name>providerName</param-name> <param-value>ssoProvider</param-value> </init-param> </servlet> <servlet> <servlet-name>proxyservletprovider</servlet-name> <servlet-class>oracle.portal.provider.v1.http.HttpProvider</servlet-class> <init-param> <param-name>provider_root</param-name> <param-value>C:\Oracle\iSuites\portal30\jpdk\providers\partnerApp, sessiontimeout=1800000</param-value> </init-param> <init-param> <param-name>listenerToken</param-name> <param-value>proxyservlet:login.server.host:80</param-value> </init-param> <init-param> <param-name>requestedUrl</param-name> <param-value>http://localhost:8888/servlet/proxyservlet</param-value> </init-param> <init-param> <param-name>onCancelUrl</param-name> <param-value>http://localhost:8888/</param-value> </init-param> <init-param> <param-name>partnerAppCookieName</param-name> <param-value>SSO_PAPP_SERVLET_ID</param-value> </init-param> <init-param> <param-name>partnerAppCookieDomain</param-name> <param-value>my.domain.com</param-value> </init-param> <init-param> <param-name>partnerAppCookieScope</param-name> <param-value>/</param-value> </init-param> <init-param> <param-name>partnerAppCookieDesc</param-name> <param-value>SSO application cookie</param-value> </init-param> <init-param> <param-name>providerName</param-name> <param-value>ssoProvider</param-value> </init-param> </servlet>
public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.net.MalformedURLException, javax.servlet.ServletException, java.io.IOException
The steps we go through are:
+- preServiceStart(...) --------------------------- | 1. Retrieve the active service for the client if there is any. | If not create a new instance of the service +- service.start(...) ----------------------------- | 2. Send start to the service | This is a blocking operation it will take from a few seconds | to a few hours :) +- postServiceStart(...) -------------------------- | 3. Ask the service for its html result. | 4. Save the service in the session object | 5. Stream the result to the client | 6. Done. +--------------------------------------------------
doPost
in class javax.servlet.http.HttpServlet
HttpServlet
protected Service preServiceStart(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws oracle.clex.process.controller.PreServiceException, java.lang.Exception
protected void postServiceStart(Service service, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws oracle.clex.process.controller.PostServiceException, java.lang.Exception
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.net.MalformedURLException, javax.servlet.ServletException, java.io.IOException
doPost(request, response)
doGet
in class javax.servlet.http.HttpServlet
protected java.util.Vector handleNewService(javax.servlet.http.HttpSession session)
protected void loadServiceInfo(Service service, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected void saveState(Service service, javax.servlet.http.HttpSession session) throws CLEException, java.lang.Exception
protected User handleOSSOLogin(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.lang.Exception
oracle.cle.resource.User
is returned representing the logged in user.protected void handleResults(Service service, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, CLEException
protected boolean handleAdditionalResults(Service service, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, CLEException
public java.lang.Object getInfo(java.lang.String key)
getInfo
in interface Parent
oracle.cle.process.Parent
key
- the name of the valuepublic java.lang.Object getInfo(java.lang.String key, Service service)
getInfo
in interface ServiceController
protected java.lang.String getValue(java.lang.String key, javax.servlet.http.HttpServletRequest aRequest, MultipartRequest aMultipartRequest)
protected java.lang.String[] getValues(java.lang.String key, javax.servlet.http.HttpServletRequest aRequest, MultipartRequest aMultipartRequest)
protected java.lang.String getPageId(javax.servlet.http.HttpServletRequest aRequest, MultipartRequest aMultipartRequest)
protected boolean isMultipartFormData(javax.servlet.http.HttpServletRequest httpRequest)
protected java.util.Hashtable cloneInfoTable(java.util.Hashtable aTable)
aTable
- Table to clonepublic void debug(java.lang.String text)
public void terminate()
terminate
in interface ServiceController
ProcessController
protected void initSessionObjects(javax.servlet.http.HttpSession session)
protected MultipartRequest checkMultipartRequest(javax.servlet.http.HttpServletRequest request) throws java.io.IOException, java.lang.Exception
request
- javax.servlet.http.HttpServletRequestprotected MultipartRequest handleMultipartRequest(javax.servlet.http.HttpServletRequest request) throws java.io.IOException, java.lang.Exception
request
- javax.servlet.http.HttpServletRequestprotected MultipartRequest newMultipartRequest(javax.servlet.http.HttpServletRequest request) throws java.lang.Exception
MultipartRequest
instance for the given request.
Override this method if you want to use an extension of the
MultipartRequest class or if you would like to use a different constructor.
This method gets invoked by the handleMultipartRequest
method.public java.lang.String getUploadDirectory()
/upload
This method's return value is passed to MultipartRequest objects
upon construction. Override this method to pass a different directory to
the MultipartRequest
constructor.
public int getUploadLimit()
This method's return value is passed to MultipartRequest objects
upon construction. Override this method to pass a different upload limit
to the MultipartRequest
constructor.
public java.lang.String getWebServerLogLocation()
public java.lang.Object getSessionId(Service aService)
getSessionId
in interface ServiceController
protected void clearRequestedValues(javax.servlet.http.HttpSession session)
public java.lang.Integer getDefaultControllerResultType()
getDefaultControllerResultType
in interface ServiceController
public java.lang.String getDefaultContentType()
public java.lang.String getCurrentContentType(Service service)
public java.lang.String getSetContentType(Service service)
public java.lang.String getLoggedOffPageLocation()
public java.util.Vector getChildren()
Parent
as of 8/28/2000 (Luis Amat)getChildren
in interface Parent
public void processParameters(Child aChildProcess)
processParameters
in interface Parent
oracle.cle.process.Child
- public void processResults(Child aChildProcess)
processResults
in interface Parent
oracle.cle.process.Child
- Child
public void buildTransitionTable(TransitionTable aTable)
buildTransitionTable
in interface Parent
oracle.cle.util.statemachine.TransistionTable
- public java.util.Vector getParents()
getParents
in interface Parent
public Parent getParent()
Parent
public final java.lang.String getName()
getName
in interface Parent
public java.lang.String getControllerValue(javax.servlet.http.HttpServletRequest request)
public static PartnerSSOEnabler getSSOEnabler()
protected oracle.clex.process.controller.PreServiceException handlePreServiceException(oracle.clex.process.controller.PreServiceException preSE)
doPost()
for HttpServletController
,
does not rethrow PreServiceExceptions after this method is called.protected oracle.clex.process.controller.PostServiceException handlePostServiceException(oracle.clex.process.controller.PostServiceException postSE)
doPost()
for HttpServletController
,
does not rethrow PostServiceExceptions after this method is called.protected java.lang.Exception handleUnhandledException(java.lang.Exception e)
handlePreServiceException
or
handlePostServiceException
. doPost()
for HttpServletController
,
rethrows this Exception after this method is called.public Service getConcreteService()
getConcreteService
in interface ServiceController
public java.lang.String getServiceDescriptorName()
protected void setServiceDescriptorName(java.lang.String aServiceDescriptorName)
protected void setName(java.lang.String aServiceName)
protected void handleJSPResult(Service service, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, CLEException
public void handleJSPRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String url) throws java.io.IOException, javax.servlet.ServletException
protected void handleLogoff(javax.servlet.http.HttpServletResponse response, java.lang.String logoffLocation) throws java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |