Package org.oa4mp.client.api.servlet
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:
SimpleReadyServlet,SimpleStartRequest
public abstract class ClientServlet extends edu.uiuc.ncsa.security.servlet.AbstractServletBasic Client servlet. it has the machinery in it for reading in a configuration file, setting up theClientEnvironmentand making theOA4MPServiceinstance. 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 inSimpleStartRequestandSimpleReadyServletto 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 StringACTION_KEYstatic StringACTION_REDIRECT_VALUEstatic edu.uiuc.ncsa.security.core.cache.Cleanup<edu.uiuc.ncsa.security.core.Identifier,Asset>assetCleanupstatic StringOA4MP_CLIENT_REQUEST_IDIf a client specifically requests a response with debugging information then this will be returned ONLY in cases of an error on the server.static StringREDIR
-
Constructor Summary
Constructors Constructor Description ClientServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringclearCookie(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Clear the CILogon client cookie.voiddestroy()protected HashMap<String,Asset>getAssetCache()ClientEnvironmentgetCE()Convenience for client servlets.OA4MPServicegetOA4MPService()voidloadEnvironment()protected voidshutdownCleanup(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, getInitialization, getMyLogger, getRequestIPAddress, handleException, info, init, isDebugOn, logOK, logOK, 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:
loadEnvironmentin classedu.uiuc.ncsa.security.servlet.AbstractServlet- Throws:
IOException
-
destroy
public void destroy()
- Specified by:
destroyin interfacejavax.servlet.Servlet- Overrides:
destroyin 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-
-
-