Interface E3RequestResponse

All Known Subinterfaces:
E3ApplicationResponse

public interface E3RequestResponse
Describes the response that will be sent to the HTTP or SOAP client.

For a SOAP client, the HTTP response headers will be mapped to the [OUT] headers parameter. Similarly, any HTTP response body will be sent as a SOAP response attachment. Any non-2xx status code will cause a SOAP Fault to be returned. The message for the SOAP Fault is taken from the response body.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    State code indicating that we'll return the status code, HTTP headers, and the output file specified via setOutputFile.
    static final int
    State code indicating that we'll return the status code, HTTP headers, and the output file specified via setOutputFile.
    static final int
    Maximum legal state code
    static final int
    Minimum legal state code
    static final int
    State code indicating that we'll return the status code, HTTP headers, and the HTML page set using setOutputPage.
    static final int
    State code indicating that we'll send a temporary redirect to the client.
    static final int
    State code indicating we'll return a fabricated HTML page based upon the status code.
    static final int
    State code indicating that we'll return a fabricated HTML page based upon the status code and error message.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addDateHeader(String name, long date)
    Adds a response header with the given name and date value.
    void
    addHeader(String name, String value)
    Adds a response header with the given name and value.
    void
    addIntHeader(String name, int value)
    Adds a response header with the given name and an integer value.
    boolean
    Returns a boolean indicating whether the named response header has already been set.
    boolean
    Returns the alternate archive flag.
    boolean
    Returns the archive flag.
    Returns the name of the charset used for the MIME body to be sent in this response.
    int
    Returns the HTTP response code that will be transmitted to the client.
    Returns an enumeration containing the names of the headers that will be transmitted to the client.
    Returns an enumeration containing the values for a specified HTTP header.
    Returns the locale assigned to the response.
    Returns the file that's currently slated for transmission to the HTTP or SOAP client or null if the E3Application hasn't called setOutputFile.
    boolean
    Returns the recycle-subprocess flag.
    int
    Returns a code indicating what will be returned to the client that made the HTTP or SOAP request to E3 based upon the current content of the E3ApplicationRequest object.
    Returns our string buffer.
    boolean
    Determines if this response is setup to return a file.
    boolean
    Determines if this response is setup to return a string.
    void
    Clears any data in the response.
    void
    sendError(int sc)
    Resets the response, then stores the status code for transmission to the client.
    void
    sendError(int sc, String msg)
    Resets the response, then stores the status code and descriptive error message for transmission to th client.
    void
    sendRedirect(String location)
    Resets the response, then sets the status code and response headers to send a temporary redirect response to the client using the specified redirect location URL.
    void
    setAlternateArchiveFlag(boolean newValue)
    Sets the alternate archive flag.
    void
    setArchiveFlag(boolean newValue)
    Sets the archive flag.
    void
    Sets the HTTP Content-Length header.
    void
    Sets the content type of the response being sent to the client.
    void
    setDateHeader(String name, long date)
    Sets a response header with the given name and date value.
    void
    setHeader(String name, String value)
    Sets a response header with the given name and value.
    void
    setIntHeader(String name, int value)
    Sets a response header with the given name and integer value.
    void
    Sets the locale of the response, setting the headers (including the Content-Type's charset) as appropriate.
    void
    setOutputFile(File target, boolean deleteAfterUse)
    Sets up to return the content of a file.
    void
    Sets up to return an HTML page.
    void
    setOutputPath(String target, boolean deleteAfterUse)
    Sets up to return the content of a file.
    void
    setRecycleSubprocessFlag(boolean newValue)
    Sets our 'recycle-subprocess' flag.
    void
    setStatus(int sc)
    Sets the status code for this response.
  • Field Details

    • STATE_MINIMUM

      static final int STATE_MINIMUM
      Minimum legal state code
      See Also:
    • STATE_SC

      static final int STATE_SC
      State code indicating we'll return a fabricated HTML page based upon the status code.
      See Also:
    • STATE_SC_MSG

      static final int STATE_SC_MSG
      State code indicating that we'll return a fabricated HTML page based upon the status code and error message.
      See Also:
    • STATE_PAGE

      static final int STATE_PAGE
      State code indicating that we'll return the status code, HTTP headers, and the HTML page set using setOutputPage.
      See Also:
    • STATE_FILE

      static final int STATE_FILE
      State code indicating that we'll return the status code, HTTP headers, and the output file specified via setOutputFile.
      See Also:
    • STATE_FILE_DELETE

      static final int STATE_FILE_DELETE
      State code indicating that we'll return the status code, HTTP headers, and the output file specified via setOutputFile. After transmitting the file to the client, E3 will delete the file.
      See Also:
    • STATE_REDIRECT

      static final int STATE_REDIRECT
      State code indicating that we'll send a temporary redirect to the client.
      See Also:
    • STATE_MAXIMUM

      static final int STATE_MAXIMUM
      Maximum legal state code
      See Also:
  • Method Details

    • addDateHeader

      void addDateHeader(String name, long date)
      Adds a response header with the given name and date value. The date is specified in terms of milliseconds since the millenium. This method allows headers to have multiple values.
      Parameters:
      name - the name of the header
      date - the assigned date value
    • addHeader

      void addHeader(String name, String value)
      Adds a response header with the given name and value. This method allows headers to have multiple values.
      Parameters:
      name - the name of the header
      value - the header value
    • addIntHeader

      void addIntHeader(String name, int value)
      Adds a response header with the given name and an integer value. This method allows headers to have multiple values.
      Parameters:
      name - the name of the header
      value - the assigned integer value
    • containsHeader

      boolean containsHeader(String name)
      Returns a boolean indicating whether the named response header has already been set.
      Parameters:
      name - the header name
      Returns:
      true if the named response header has already been set, false otherwise.
    • getAlternateArchiveFlag

      boolean getAlternateArchiveFlag()
      Returns the alternate archive flag.
      Returns:
      TRUE if, SHOULD this transaction be archived, the archive file should be written to an alternate location that is not web-visible. FALSE if the archive file should be written to the normal location and be accessible via the GUI.
    • getArchiveFlag

      boolean getArchiveFlag()
      Returns the archive flag.
      Returns:
      TRUE if this transaction will be archived upon completion FALSE otherwise.
    • getCharacterEncoding

      String getCharacterEncoding()
      Returns the name of the charset used for the MIME body to be sent in this response.

      If no charset has been assigned, it is implicitly set to ISO-8859-1 (Latin-1).

      For a SOAP client, this is unsupported/ignored.

      Returns:
      a String specifying the name of the charset
    • getCode

      int getCode()
      Returns the HTTP response code that will be transmitted to the client.
      Returns:
      code
    • getHeaderNames

      Enumeration<String> getHeaderNames()
      Returns an enumeration containing the names of the headers that will be transmitted to the client. If there are no headers, returns an empty enumeration.
    • getHeaderValues

      Enumeration<String> getHeaderValues(String name)
      Returns an enumeration containing the values for a specified HTTP header. If no values are set for the specified header, returns an empty enumeration.
    • getLocale

      Locale getLocale()
      Returns the locale assigned to the response.

      For a SOAP client, this is unsupported.

    • getOutputFile

      File getOutputFile()
      Returns the file that's currently slated for transmission to the HTTP or SOAP client or null if the E3Application hasn't called setOutputFile.
      Returns:
      File to be returned nor null
    • getRecycleSubprocessFlag

      boolean getRecycleSubprocessFlag()
      Returns the recycle-subprocess flag.
      Returns:
      TRUE if the sub-process that executed the request to generate this response was (or should be) terminated, and another sub-process started in its place.
    • getState

      int getState()
      Returns a code indicating what will be returned to the client that made the HTTP or SOAP request to E3 based upon the current content of the E3ApplicationRequest object. See the "STATE_" constants defined above.
      Returns:
      integer code indicating current response state
    • getString

      String getString()
      Returns our string buffer. This may be an HTTP error message, a redirect target, or a complete HTML page, depending upon our state.
      Returns:
      string buffer content
    • hasFileResult

      boolean hasFileResult()
      Determines if this response is setup to return a file. If so, the file can be accessed via getOutputFile().
      Returns:
      true if this is setup to return a file
    • hasStringResult

      boolean hasStringResult()
      Determines if this response is setup to return a string. If so, the string can be accessed via getString();
      Returns:
      true if this is setup to return a string
    • reset

      void reset()
      Clears any data in the response. This restores the E3RequestResponse object to the state it was in when it was passed to doGet or doPost.
    • sendError

      void sendError(int sc)
      Resets the response, then stores the status code for transmission to the client.

      For a SOAP client, a non-2xx status code will result in a SOAP Fault being returned to the client.

      Parameters:
      sc - status code
    • sendError

      void sendError(int sc, String msg)
      Resets the response, then stores the status code and descriptive error message for transmission to th client.

      For a SOAP client, a non-2xx status code will result in a SOAP Fault being returned to the client.

      Parameters:
      sc - status code
      msg - error message
    • sendRedirect

      void sendRedirect(String location)
      Resets the response, then sets the status code and response headers to send a temporary redirect response to the client using the specified redirect location URL. if location is a relative URL, it will be converted to an absolute URL before transmission.

      For a SOAP client, this is unsupported.

      Parameters:
      location - the redirect location URL
    • setAlternateArchiveFlag

      void setAlternateArchiveFlag(boolean newValue)
      Sets the alternate archive flag.
      Parameters:
      newValue - TRUE if, should this transaction be archived, the archive file should be written to an alternative location that is not web visible.
      FALSE if, should this transaction be archived, the archive file should be written to the standard location and be accessible from the GUI.
    • setArchiveFlag

      void setArchiveFlag(boolean newValue)
      Sets the archive flag.
      Parameters:
      newValue - TRUE to archive this transaction, FALSE to not request archiving.
      Note that there are circumstances in which this flag may not be honored. For example, if the transaction archive is disabled, then no transactions are archived; if the selector says to archive all transactions, then setting this flag to FALSE won't matter.
    • setContentLength

      void setContentLength(int len)
      Sets the HTTP Content-Length header.
      Parameters:
      len - an integer specifying the length of the content being returnedto the client
    • setContentType

      void setContentType(String type)
      Sets the content type of the response being sent to the client. The content type may include the type of character encoding used, for example, text/html; charset=ISO-8859-4.
      Parameters:
      type - a string specifying the MIME type of the content
    • setDateHeader

      void setDateHeader(String name, long date)
      Sets a response header with the given name and date value. The date is specified in terms of milliseconds since the epoch. If the header has already been set, the new value overwrites the previous one. The containsHeader method can be used to test for the presence of a header before setting its value.
      Parameters:
      name - the name of the header
      date - the assigned date value
    • setHeader

      void setHeader(String name, String value)
      Sets a response header with the given name and value. If the header has already been set, the new value overwrites the previous one. The containsHeader method can be used to test for the presence of a header before setting its value.
      Parameters:
      name - the name of the header
      value - the header value
    • setIntHeader

      void setIntHeader(String name, int value)
      Sets a response header with the given name and integer value. If the header has already been set, the new value overwrites the previous one. The containsHeader method can be used to test for the presence of a header before setting its value.
      Parameters:
      name - the name of the header
      value - the assigned integer value
    • setLocale

      void setLocale(Locale loc)
      Sets the locale of the response, setting the headers (including the Content-Type's charset) as appropriate. By default the response locale is the default locale for the server.

      For a SOAP client, this is unsupported.

      Parameters:
      loc - the locale of the response
    • setOutputFile

      void setOutputFile(File target, boolean deleteAfterUse)
      Sets up to return the content of a file. Discards the error message (if any) set by a prior call to sendError() and/or the HTML page (if any) set by a prior call to setOutputPage
      Parameters:
      target - file to be transmitted
      deleteAfterUse - 1 -> E3 will delete the file after transmitting it to the client 0 -> E3 won't delete the file
    • setOutputPage

      void setOutputPage(String page)
      Sets up to return an HTML page. The parameter page must contain a complete HTML document; E3 will not augment it in any way.
      Parameters:
      page - HTML page to return
    • setRecycleSubprocessFlag

      void setRecycleSubprocessFlag(boolean newValue)
      Sets our 'recycle-subprocess' flag.
      Parameters:
      newValue - value to set
    • setOutputPath

      void setOutputPath(String target, boolean deleteAfterUse)
      Sets up to return the content of a file. Discards the error message (if any) set by a prior call to sendError() and/or the HTML page (if any) set by a prior call to setOutputPage
      Parameters:
      target - String containing the absolute path to the file to be returned.
      deleteAfterUse - 1 -> E3 will delete the file after transmitting it to the client 0 -> E3 won't delete the file
    • setStatus

      void setStatus(int sc)
      Sets the status code for this response.

      For a SOAP client, a non-2xx status code will result in a SOAP Fault being returned to the client.

      Parameters:
      sc - status code to set