Class OA2ServletUtils
- java.lang.Object
-
- org.oa4mp.server.loader.oauth2.servlet.OA2ServletUtils
-
public class OA2ServletUtils extends Object
Utilities for various servlets. These handle the exceptions from the script runtime engine and perform a full rollback. These are messy, but unavoidable.Created by Jeff Gaynor
on 4/26/22 at 6:52 AM
-
-
Field Summary
Fields Modifier and Type Field Description static int
stackTraceMaxLines
static String
TEMPLATES_KEY
-
Constructor Summary
Constructors Constructor Description OA2ServletUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
handleScriptEngineException(Object callingObject, OA2SE oa2SE, Throwable t, edu.uiuc.ncsa.security.core.util.MetaDebugUtil debugger, OA2ServiceTransaction transaction, edu.uiuc.ncsa.security.storage.XMLMap tBackup)
static void
handleScriptEngineException(Object callingObject, OA2SE oa2SE, Throwable exception, edu.uiuc.ncsa.security.core.util.MetaDebugUtil debugger, OA2ServiceTransaction transaction, edu.uiuc.ncsa.security.storage.XMLMap tBackup, TXRecord txRecord)
protected static void
ppξ(Throwable throwable, Object callingObject, OA2SE oa2SE, edu.uiuc.ncsa.security.core.util.MetaDebugUtil debugger, String message)
Pretty print the exception.static void
processReservedXAs(net.sf.json.JSONObject xas, OA2ServiceTransaction t)
This takes the set of reservedExtendedParameters
and sets state in the transaction.static void
processXAs(Map<String,String[]> params, OA2ServiceTransaction t, OA2Client client)
static void
processXAs(javax.servlet.http.HttpServletRequest request, OA2ServiceTransaction t, OA2Client client)
Process the extended attrubutes from the request's parameter map.protected static void
rollback(OA2SE oa2SE, edu.uiuc.ncsa.security.storage.XMLMap backup, TXRecord txRecord)
static String
truncateStackTrace(Throwable e, int n, boolean printIt)
Take a stack trace and print the first n lines of it.protected static String
truncateStackTrace2(Throwable e, int n, boolean printIt)
-
-
-
Field Detail
-
stackTraceMaxLines
public static int stackTraceMaxLines
-
TEMPLATES_KEY
public static final String TEMPLATES_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
handleScriptEngineException
public static void handleScriptEngineException(Object callingObject, OA2SE oa2SE, Throwable t, edu.uiuc.ncsa.security.core.util.MetaDebugUtil debugger, OA2ServiceTransaction transaction, edu.uiuc.ncsa.security.storage.XMLMap tBackup)
-
handleScriptEngineException
public static void handleScriptEngineException(Object callingObject, OA2SE oa2SE, Throwable exception, edu.uiuc.ncsa.security.core.util.MetaDebugUtil debugger, OA2ServiceTransaction transaction, edu.uiuc.ncsa.security.storage.XMLMap tBackup, TXRecord txRecord)
- Parameters:
callingObject
-oa2SE
-exception
-debugger
-transaction
-tBackup
-txRecord
-
-
rollback
protected static void rollback(OA2SE oa2SE, edu.uiuc.ncsa.security.storage.XMLMap backup, TXRecord txRecord)
-
truncateStackTrace
public static String truncateStackTrace(Throwable e, int n, boolean printIt)
Take a stack trace and print the first n lines of it.- Parameters:
e
-n
-- Returns:
- the truncated stack trace
-
truncateStackTrace2
protected static String truncateStackTrace2(Throwable e, int n, boolean printIt)
-
ppξ
protected static void ppξ(Throwable throwable, Object callingObject, OA2SE oa2SE, edu.uiuc.ncsa.security.core.util.MetaDebugUtil debugger, String message)
Pretty print the exception. This decides what to print and shortens the stack trace.- Parameters:
throwable
-callingObject
-debugger
-message
-
-
processReservedXAs
public static void processReservedXAs(net.sf.json.JSONObject xas, OA2ServiceTransaction t)
This takes the set of reservedExtendedParameters
and sets state in the transaction. These parameters are reserved for system use and not propagated to the client scripting environment. Moreover, they are available to every client.- Parameters:
xas
-t
-
-
processXAs
public static void processXAs(Map<String,String[]> params, OA2ServiceTransaction t, OA2Client client)
-
processXAs
public static void processXAs(javax.servlet.http.HttpServletRequest request, OA2ServiceTransaction t, OA2Client client)
Process the extended attrubutes from the request's parameter map.- Parameters:
request
-t
-client
-
-
-