Class ClientServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- edu.uiuc.ncsa.security.servlet.AbstractServlet
-
- org.oa4mp.client.api.servlet.ClientServlet
-
- All Implemented Interfaces:
edu.uiuc.ncsa.security.core.Logable
,Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
- Direct Known Subclasses:
OA2ReadyServlet
,OA2StartRequest
,SimpleReadyServlet
,SimpleStartRequest
public abstract class ClientServlet extends edu.uiuc.ncsa.security.servlet.AbstractServlet
Basic Client servlet. it has the machinery in it for reading in a configuration file, setting up theClientEnvironment
and making theOA4MPService
instance. It also includes a utility call for getting a cookie with the identifier (stored with the key "oa4mp_client_req_id" in the users browser).
Look at the two sample uses of this inSimpleStartRequest
andSimpleReadyServlet
to see how to extend and use it.Created by Jeff Gaynor
on 2/10/12 at 12:51 PM- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ACTION_KEY
static String
ACTION_REDIRECT_VALUE
static edu.uiuc.ncsa.security.core.cache.Cleanup<edu.uiuc.ncsa.security.core.Identifier,Asset>
assetCleanup
static String
OA4MP_CLIENT_REQUEST_ID
If a client specifically requests a response with debugging information then this will be returned ONLY in cases of an error on the server.static String
REDIR
-
Constructor Summary
Constructors Constructor Description ClientServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
clearCookie(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Clear the CILogon client cookie.void
destroy()
protected HashMap<String,Asset>
getAssetCache()
ClientEnvironment
getCE()
Convenience for client servlets.OA4MPService
getOA4MPService()
void
loadEnvironment()
protected void
shutdownCleanup(edu.uiuc.ncsa.security.core.cache.Cleanup c)
-
Methods inherited from class edu.uiuc.ncsa.security.servlet.AbstractServlet
checkContentType, CONST, debug, doGet, doIt, doPing, doPost, error, error, getConfigurationLoader, getEnvironment, getExceptionHandler, getFirstParameterValue, getInitialization, getMyLogger, handleException, info, init, isDebugOn, printAllParameters, printAllParameters, resetState, setConfigurationLoader, setDebugOn, setEnvironment, setExceptionHandler, setInitialization, warn
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
-
-
-
-
Field Detail
-
ACTION_KEY
public static final String ACTION_KEY
- See Also:
- Constant Field Values
-
ACTION_REDIRECT_VALUE
public static final String ACTION_REDIRECT_VALUE
- See Also:
- Constant Field Values
-
REDIR
public static final String REDIR
- See Also:
- Constant Field Values
-
OA4MP_CLIENT_REQUEST_ID
public static final String OA4MP_CLIENT_REQUEST_ID
If a client specifically requests a response with debugging information then this will be returned ONLY in cases of an error on the server. It is up to the client to unpack this. To use this, add the key to the request with a value of true.- See Also:
- Constant Field Values
-
assetCleanup
public static edu.uiuc.ncsa.security.core.cache.Cleanup<edu.uiuc.ncsa.security.core.Identifier,Asset> assetCleanup
-
-
Method Detail
-
getCE
public ClientEnvironment getCE()
Convenience for client servlets. Does the cast automatically- Returns:
-
loadEnvironment
public void loadEnvironment() throws IOException
- Specified by:
loadEnvironment
in classedu.uiuc.ncsa.security.servlet.AbstractServlet
- Throws:
IOException
-
destroy
public void destroy()
- Specified by:
destroy
in interfacejavax.servlet.Servlet
- Overrides:
destroy
in classjavax.servlet.GenericServlet
-
shutdownCleanup
protected void shutdownCleanup(edu.uiuc.ncsa.security.core.cache.Cleanup c)
-
getOA4MPService
public OA4MPService getOA4MPService() throws IOException
- Throws:
IOException
-
clearCookie
protected String clearCookie(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Clear the CILogon client cookie. This way if there is an error the user won't get a stale one with a possible server-side exception later.
This clears the client request id cookie ("oa4mp_client_req_id") and returns the currently set value for it. This- Parameters:
request
-response
-
-
-