Package com.arbortext.e3
Interface E3RequestContext
public interface E3RequestContext
Provides information and services to E3 Request Handlers and
E3 Request Functions.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a job to the list of jobs to be performed after the current request finishes processing but before the response is returned to the user.allocateE3Subprocess(javax.servlet.http.HttpServletRequest request) Allocates an E3 subprocess, possibly blocking until one is available.Creates an HTTP GET request for internal usecreateRequest(File body) Creates an HTTP POST request for internal useCreates an empty E3RequestResponse objectcreateResponse(E3RequestResponse source) Creates an E3RequestResponse object with the same content as another response.createTemporaryFile(boolean deleteOnExit) Creates a temporary file; the file will be accessible to code running in both the E3 servlet and an E3 SubprocessvoiddeleteFile(File target) Schedules a file for deletion.booleandeleteRecursive(File target) Deletes a file or directory and its contentcom.arbortext.e3.E3QueueFinds a queue object.Iterable<com.arbortext.e3cf.E3FunctionDescriptor> Returns an iterator over the list of allowed functionsReturn an iterator over the list of cache managersIterable<com.arbortext.e3.E3DataField> Returns the name to be assigned to any transaction whose request doesn't specify a transaction-name parameter.Returns the location in which Epic is installedReturn an iterator over the list of initializersIterable<com.arbortext.e3.E3Notifier> Return an iterator over the list of notificationsgetParameter(String name) Returns the value of a parameterReturns an iterator over the list of global parameter namesIterable<com.arbortext.e3.E3ParameterSet> Returns a list of standalone parameter sets.Return an iterator over the list of queue managersIterable<com.arbortext.e3.E3Queue> Return the list of the queues available in the manager.Return an iterator over the list of request handlersReturns a request selectorReturn an iterator over the list of request selectorsIterable<com.arbortext.e3.E3SecurityConstraint> Returns an iterator over the list of security constraints.javax.servlet.ServletConfigReturns the servlet configuration object.javax.servlet.ServletContextReturns the servlet context object.getStackTrace(Throwable throwable) Returns an exception stack trace as a string.Return an iterator over the list of subprocess poolsReturns the directory in which temporary files should be createdReturns the string that will be used as a prefix in creating all temporary files.Returns the string that will be used as a suffix in creating all temporary files.Iterable<com.arbortext.e3.E3TestSet> Returns a list of standalone test sets.com.arbortext.e3.E3TransactionArchiveReturns a reference to the transaction archive.Returns a version descriptorbooleanisFunctionAllowed(String type, String name) Indictates whether a given function should be passed to an E3 subprocess for execution.voidlogDebugMessage(String message) Writes a string to the servlet context log only if debugging is enabled.voidlogDebugMessage(String message, Throwable exception) Writes a string to the servlet context log only if debugging is enabled.voidlogMessage(String message) Writes a string to the servlet context log.voidlogMessage(String message, Throwable exception) Writes a string to the servlet context log.voidlogVerboseDebugMessage(String message) Writes a string to the servlet context log only if verbose debugging is enabled.voidlogVerboseDebugMessage(String message, Throwable exception) Writes a string to the servlet context log only if verbose debugging is enabled.booleanpatternMatch(String string, String pattern) Indicates whether a string matches a patternreceiveFile(javax.servlet.http.HttpServletRequest request) Allocates a temporary file and stores the file accompanying an HTTP POST request into itvoidrestoreZipArchive(File archive, File target) Deprecated, for removal: This API element is subject to removal in a future version.booleanshouldRecycleSubprocess(javax.servlet.http.HttpServletRequest request) Indicates whether the sub-process that processes a request should be terminated after doing so.voidWrites a string to the platform-specific trace mechanismvoidtransmitResponse(javax.servlet.http.HttpServletResponse httpResponse, E3RequestResponse e3Data) Transmits a response to an HTTP client.
-
Method Details
-
addDeferredRequestTask
Adds a job to the list of jobs to be performed after the current request finishes processing but before the response is returned to the user.- Parameters:
job- task to be performed
-
allocateE3Subprocess
E3Subprocess allocateE3Subprocess(javax.servlet.http.HttpServletRequest request) throws com.arbortext.e3.E3RequestException Allocates an E3 subprocess, possibly blocking until one is available.- Parameters:
request- request being processed- Returns:
- E3 subprocess object
- Throws:
com.arbortext.e3.E3RequestException- on error
-
createRequest
E3InternalRequest createRequest()Creates an HTTP GET request for internal use- Returns:
E3InternalRequestobject
-
createRequest
Creates an HTTP POST request for internal use- Parameters:
body- file containing request body- Returns:
E3InternalRequestobject
-
createResponse
E3RequestResponse createResponse()Creates an empty E3RequestResponse object- Returns:
- new object
-
createResponse
E3RequestResponse createResponse(E3RequestResponse source) throws com.arbortext.e3.E3RequestException Creates an E3RequestResponse object with the same content as another response.If the source object includes a file, the file will be duplicated and the new response will reference its own on-disk file
If the source object has state STATE_FILE_DELETE, the new response will have state STATE_FILE; the caller/creator is responsible for deleting the on-disk file by calling reset().
- Parameters:
source- object to be cloned- Returns:
- new E3RequestResponse object
- Throws:
com.arbortext.e3.E3RequestException- upon error
-
createTemporaryFile
Creates a temporary file; the file will be accessible to code running in both the E3 servlet and an E3 Subprocess- Parameters:
deleteOnExit- ifTrue, set the file's delete-upon-JVM-exit flag- Returns:
Fileobject for temporary file- Throws:
com.arbortext.e3.E3RequestException- upon error
-
deleteFile
Schedules a file for deletion. Deletion is not immediate; instead, deletion is queued until the currently-running thread is entirely done processing the current request.- Parameters:
target- file to delete
-
deleteRecursive
Deletes a file or directory and its content- Parameters:
target- file or directory to be deleted- Returns:
- true if
fileOrDirif deletion succeds;
false if deletion fails.
-
findQueue
Finds a queue object.- Parameters:
id- name of object to search for. May be null.- Returns:
E3Queueobject or null.
-
getAllowedFunctions
Iterable<com.arbortext.e3cf.E3FunctionDescriptor> getAllowedFunctions()Returns an iterator over the list of allowed functions- Returns:
Iteratorover list ofE3FunctionDescriptorobjects
-
getCacheManagers
Iterable<E3CacheManager> getCacheManagers()Return an iterator over the list of cache managers- Returns:
Iteratorover list of E3CacheManager objects
-
getDefaultTransactionName
String getDefaultTransactionName()Returns the name to be assigned to any transaction whose request doesn't specify a transaction-name parameter.- Returns:
- default transaction name or NULL
-
getEpicInstallation
File getEpicInstallation()Returns the location in which Epic is installed- Returns:
- absolute path to Epic installation
-
getInitializers
Iterable<E3Initializer> getInitializers()Return an iterator over the list of initializers- Returns:
Iteratorover list of E3Initializer objects
-
getParameter
Returns the value of a parameter- Parameters:
name- parameter name- Returns:
- parameter value or null
-
getParameterNames
Returns an iterator over the list of global parameter names- Returns:
Iteratorover a list of strings
-
getParameterSets
Iterable<com.arbortext.e3.E3ParameterSet> getParameterSets()Returns a list of standalone parameter sets.- Returns:
Iterableover a set ofE3ParameterSetobjects.
-
getQueueManagers
Iterable<E3QueueManager> getQueueManagers()Return an iterator over the list of queue managers- Returns:
Iteratorover list of E3QueueManager objects
-
getRequestHandlers
Iterable<E3RequestHandler> getRequestHandlers()Return an iterator over the list of request handlers- Returns:
Iteratorover list of E3RequestHandler objects
-
getRequestSelector
Returns a request selector- Parameters:
id- ID to look for- Returns:
- request selector or null if not found
-
getRequestSelectors
Iterable<E3RequestSelector> getRequestSelectors()Return an iterator over the list of request selectors- Returns:
Iteratorover list of E3RequestSelector objects
-
getSecurityConstraints
Iterable<com.arbortext.e3.E3SecurityConstraint> getSecurityConstraints()Returns an iterator over the list of security constraints.- Returns:
Iteratorover list ofE3SecurityConstraintobjects
-
getDataFields
Iterable<com.arbortext.e3.E3DataField> getDataFields() -
getServletConfig
javax.servlet.ServletConfig getServletConfig()Returns the servlet configuration object.- Returns:
ServletConfigfor this servlet
-
getServletContext
javax.servlet.ServletContext getServletContext()Returns the servlet context object.- Returns:
ServletContextfor this servlet
-
getStackTrace
Returns an exception stack trace as a string.This has nothing to do with E3, but it's much easier than allocating a PrintWriter every time we want a stack trace to include in an error message.
- Parameters:
throwable- Exception to process- Returns:
String> containing stack trace
-
getSubprocessPools
Iterable<E3SubprocessPool> getSubprocessPools()Return an iterator over the list of subprocess pools- Returns:
Iteratorover list of E3SubprocessPool objects
-
getNotifiers
Iterable<com.arbortext.e3.E3Notifier> getNotifiers()Return an iterator over the list of notifications- Returns:
Iteratorover list of E3Notification objects
-
getQueues
Iterable<com.arbortext.e3.E3Queue> getQueues()Return the list of the queues available in the manager.- Returns:
- queue list in the manager
-
getTemporaryDirectory
File getTemporaryDirectory()Returns the directory in which temporary files should be created- Returns:
Fileobject for directory
-
getTemporaryPrefix
String getTemporaryPrefix()Returns the string that will be used as a prefix in creating all temporary files.- Returns:
Stringprefix
-
getTemporarySuffix
String getTemporarySuffix()Returns the string that will be used as a suffix in creating all temporary files.- Returns:
Stringprefix
-
getTestSets
Iterable<com.arbortext.e3.E3TestSet> getTestSets()Returns a list of standalone test sets.- Returns:
Iterableover a set ofE3TestSetobjects.
-
getTransactionArchive
com.arbortext.e3.E3TransactionArchive getTransactionArchive()Returns a reference to the transaction archive.- Returns:
E3TransactionArchiveobject
-
getVersion
E3Version getVersion()Returns a version descriptor- Returns:
E3Versionobject
-
isFunctionAllowed
Indictates whether a given function should be passed to an E3 subprocess for execution.- Parameters:
type- "java", "javascript", "acl", etc.name- fully-qualified name of function to check- Returns:
Trueif execution is allowed,Falseotherwise
-
logDebugMessage
Writes a string to the servlet context log only if debugging is enabled.
To enable debugging output, add"<Parameter name="debug" value="true"/>to the top-level parameters in e3config.xml.- Parameters:
message- string to write
-
logDebugMessage
Writes a string to the servlet context log only if debugging is enabled.
To enable debugging output, add"<Parameter name="debug" value="true"/>to the top-level parameters in e3config.xml.- Parameters:
message- string to writeexception- exception whose stack trace should be appended
-
logMessage
Writes a string to the servlet context log.- Parameters:
message- string to write
-
logMessage
Writes a string to the servlet context log.- Parameters:
message- string to writeexception- exception whose stack trace should be appended
-
logVerboseDebugMessage
Writes a string to the servlet context log only if verbose debugging is enabled. This is intended to keep truly large data out of the debug log even when normal debugging is on.
To enable debugging output, add"<Parameter name="debug-verbose" value="true"/>"to the top-level parameters in e3config.xml.- Parameters:
message- string to write
-
logVerboseDebugMessage
Writes a string to the servlet context log only if verbose debugging is enabled. This is intended to keep truly large data out of the debug log even when normal debugging is on.
To enable debugging output, add"<Parameter name="debug-verbose" value="true"/>"to the top-level parameters in e3config.xml.- Parameters:
message- string to writeexception- exception whose stack trace should be appended
-
patternMatch
Indicates whether a string matches a pattern- Parameters:
string- string to testpattern- pattenr to check against- Returns:
Trueif 'string' matches 'pattern',Falseotherwise
-
receiveFile
File receiveFile(javax.servlet.http.HttpServletRequest request) throws com.arbortext.e3.E3RequestException Allocates a temporary file and stores the file accompanying an HTTP POST request into it- Parameters:
request- HTTP request being processed- Returns:
Fileinto which POSTed file was stored or NULL if the request had no attachment- Throws:
com.arbortext.e3.E3RequestException- upon any error
-
shouldRecycleSubprocess
boolean shouldRecycleSubprocess(javax.servlet.http.HttpServletRequest request) Indicates whether the sub-process that processes a request should be terminated after doing so.- Parameters:
request- request to check- Returns:
- TRUE if the sub-process should be recycled, FALSE otherwise
-
trace
Writes a string to the platform-specific trace mechanism- Parameters:
message-Stringto write
-
transmitResponse
void transmitResponse(javax.servlet.http.HttpServletResponse httpResponse, E3RequestResponse e3Data) Transmits a response to an HTTP client. If transmission fails, logs as much failure information as is available to the servlet log.- Parameters:
httpResponse- HTTP response object from servlet interfacee3Data- data to be transmitted
-
restoreZipArchive
@Deprecated(since="8.3.0.0", forRemoval=true) void restoreZipArchive(File archive, File target) throws com.arbortext.e3.E3RequestException Deprecated, for removal: This API element is subject to removal in a future version.Restores a zip archive to a directory- Parameters:
archive- file containing archive to restoretarget- directory to which we should restore- Throws:
com.arbortext.e3.E3RequestException- upon error
-