Interface E3RequestContext


public interface E3RequestContext
Provides information and services to E3 Request Handlers and E3 Request Functions.
  • Method Details

    • addDeferredRequestTask

      void addDeferredRequestTask(E3Task job)
      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:
      E3InternalRequest object
    • createRequest

      E3InternalRequest createRequest(File body)
      Creates an HTTP POST request for internal use
      Parameters:
      body - file containing request body
      Returns:
      E3InternalRequest object
    • 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

      File createTemporaryFile(boolean deleteOnExit) throws com.arbortext.e3.E3RequestException
      Creates a temporary file; the file will be accessible to code running in both the E3 servlet and an E3 Subprocess
      Parameters:
      deleteOnExit - if True, set the file's delete-upon-JVM-exit flag
      Returns:
      File object for temporary file
      Throws:
      com.arbortext.e3.E3RequestException - upon error
    • deleteFile

      void deleteFile(File target)
      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

      boolean deleteRecursive(File target)
      Deletes a file or directory and its content
      Parameters:
      target - file or directory to be deleted
      Returns:
      true if fileOrDir if deletion succeds;
      false if deletion fails.
    • findQueue

      com.arbortext.e3.E3Queue findQueue(String id)
      Finds a queue object.
      Parameters:
      id - name of object to search for. May be null.
      Returns:
      E3Queue object or null.
    • getAllowedFunctions

      Iterable<com.arbortext.e3cf.E3FunctionDescriptor> getAllowedFunctions()
      Returns an iterator over the list of allowed functions
      Returns:
      Iterator over list of E3FunctionDescriptor objects
    • getCacheManagers

      Iterable<E3CacheManager> getCacheManagers()
      Return an iterator over the list of cache managers
      Returns:
      Iterator over 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:
      Iterator over list of E3Initializer objects
    • getParameter

      String getParameter(String name)
      Returns the value of a parameter
      Parameters:
      name - parameter name
      Returns:
      parameter value or null
    • getParameterNames

      Iterable<String> getParameterNames()
      Returns an iterator over the list of global parameter names
      Returns:
      Iterator over a list of strings
    • getParameterSets

      Iterable<com.arbortext.e3.E3ParameterSet> getParameterSets()
      Returns a list of standalone parameter sets.
      Returns:
      Iterable over a set of E3ParameterSet objects.
    • getQueueManagers

      Iterable<E3QueueManager> getQueueManagers()
      Return an iterator over the list of queue managers
      Returns:
      Iterator over list of E3QueueManager objects
    • getRequestHandlers

      Iterable<E3RequestHandler> getRequestHandlers()
      Return an iterator over the list of request handlers
      Returns:
      Iterator over list of E3RequestHandler objects
    • getRequestSelector

      E3RequestSelector getRequestSelector(String id)
      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:
      Iterator over list of E3RequestSelector objects
    • getSecurityConstraints

      Iterable<com.arbortext.e3.E3SecurityConstraint> getSecurityConstraints()
      Returns an iterator over the list of security constraints.
      Returns:
      Iterator over list of E3SecurityConstraint objects
    • getDataFields

      Iterable<com.arbortext.e3.E3DataField> getDataFields()
    • getServletConfig

      javax.servlet.ServletConfig getServletConfig()
      Returns the servlet configuration object.
      Returns:
      ServletConfig for this servlet
    • getServletContext

      javax.servlet.ServletContext getServletContext()
      Returns the servlet context object.
      Returns:
      ServletContext for this servlet
    • getStackTrace

      String getStackTrace(Throwable throwable)
      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:
      Iterator over list of E3SubprocessPool objects
    • getNotifiers

      Iterable<com.arbortext.e3.E3Notifier> getNotifiers()
      Return an iterator over the list of notifications
      Returns:
      Iterator over 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:
      File object for directory
    • getTemporaryPrefix

      String getTemporaryPrefix()
      Returns the string that will be used as a prefix in creating all temporary files.
      Returns:
      String prefix
    • getTemporarySuffix

      String getTemporarySuffix()
      Returns the string that will be used as a suffix in creating all temporary files.
      Returns:
      String prefix
    • getTestSets

      Iterable<com.arbortext.e3.E3TestSet> getTestSets()
      Returns a list of standalone test sets.
      Returns:
      Iterable over a set of E3TestSet objects.
    • getTransactionArchive

      com.arbortext.e3.E3TransactionArchive getTransactionArchive()
      Returns a reference to the transaction archive.
      Returns:
      E3TransactionArchive object
    • getVersion

      E3Version getVersion()
      Returns a version descriptor
      Returns:
      E3Version object
    • isFunctionAllowed

      boolean isFunctionAllowed(String type, String name)
      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:
      True if execution is allowed, False otherwise
    • logDebugMessage

      void logDebugMessage(String message)
      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

      void logDebugMessage(String message, Throwable exception)
      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
      exception - exception whose stack trace should be appended
    • logMessage

      void logMessage(String message)
      Writes a string to the servlet context log.
      Parameters:
      message - string to write
    • logMessage

      void logMessage(String message, Throwable exception)
      Writes a string to the servlet context log.
      Parameters:
      message - string to write
      exception - exception whose stack trace should be appended
    • logVerboseDebugMessage

      void logVerboseDebugMessage(String message)
      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

      void logVerboseDebugMessage(String message, Throwable exception)
      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
      exception - exception whose stack trace should be appended
    • patternMatch

      boolean patternMatch(String string, String pattern)
      Indicates whether a string matches a pattern
      Parameters:
      string - string to test
      pattern - pattenr to check against
      Returns:
      True if 'string' matches 'pattern', False otherwise
    • 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:
      File into 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

      void trace(String message)
      Writes a string to the platform-specific trace mechanism
      Parameters:
      message - String to 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 interface
      e3Data - 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 restore
      target - directory to which we should restore
      Throws:
      com.arbortext.e3.E3RequestException - upon error