Interface E3RequestResponse
- All Known Subinterfaces:
E3ApplicationResponse
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
FieldsModifier and TypeFieldDescriptionstatic final intState code indicating that we'll return the status code, HTTP headers, and the output file specified viasetOutputFile.static final intState code indicating that we'll return the status code, HTTP headers, and the output file specified viasetOutputFile.static final intMaximum legal state codestatic final intMinimum legal state codestatic final intState code indicating that we'll return the status code, HTTP headers, and the HTML page set usingsetOutputPage.static final intState code indicating that we'll send a temporary redirect to the client.static final intState code indicating we'll return a fabricated HTML page based upon the status code.static final intState code indicating that we'll return a fabricated HTML page based upon the status code and error message. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDateHeader(String name, long date) Adds a response header with the given name and date value.voidAdds a response header with the given name and value.voidaddIntHeader(String name, int value) Adds a response header with the given name and an integer value.booleancontainsHeader(String name) Returns a boolean indicating whether the named response header has already been set.booleanReturns the alternate archive flag.booleanReturns the archive flag.Returns the name of the charset used for the MIME body to be sent in this response.intgetCode()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.getHeaderValues(String name) 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 ornullif the E3Application hasn't calledsetOutputFile.booleanReturns the recycle-subprocess flag.intgetState()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 theE3ApplicationRequestobject.Returns our string buffer.booleanDetermines if this response is setup to return a file.booleanDetermines if this response is setup to return a string.voidreset()Clears any data in the response.voidsendError(int sc) Resets the response, then stores the status code for transmission to the client.voidResets the response, then stores the status code and descriptive error message for transmission to th client.voidsendRedirect(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.voidsetAlternateArchiveFlag(boolean newValue) Sets the alternate archive flag.voidsetArchiveFlag(boolean newValue) Sets the archive flag.voidsetContentLength(int len) Sets the HTTP Content-Length header.voidsetContentType(String type) Sets the content type of the response being sent to the client.voidsetDateHeader(String name, long date) Sets a response header with the given name and date value.voidSets a response header with the given name and value.voidsetIntHeader(String name, int value) Sets a response header with the given name and integer value.voidSets the locale of the response, setting the headers (including the Content-Type's charset) as appropriate.voidsetOutputFile(File target, boolean deleteAfterUse) Sets up to return the content of a file.voidsetOutputPage(String page) Sets up to return an HTML page.voidsetOutputPath(String target, boolean deleteAfterUse) Sets up to return the content of a file.voidsetRecycleSubprocessFlag(boolean newValue) Sets our 'recycle-subprocess' flag.voidsetStatus(int sc) Sets the status code for this response.
-
Field Details
-
STATE_MINIMUM
static final int STATE_MINIMUMMinimum legal state code- See Also:
-
STATE_SC
static final int STATE_SCState code indicating we'll return a fabricated HTML page based upon the status code.- See Also:
-
STATE_SC_MSG
static final int STATE_SC_MSGState 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_PAGEState code indicating that we'll return the status code, HTTP headers, and the HTML page set usingsetOutputPage.- See Also:
-
STATE_FILE
static final int STATE_FILEState code indicating that we'll return the status code, HTTP headers, and the output file specified viasetOutputFile.- See Also:
-
STATE_FILE_DELETE
static final int STATE_FILE_DELETEState code indicating that we'll return the status code, HTTP headers, and the output file specified viasetOutputFile. After transmitting the file to the client, E3 will delete the file.- See Also:
-
STATE_REDIRECT
static final int STATE_REDIRECTState code indicating that we'll send a temporary redirect to the client.- See Also:
-
STATE_MAXIMUM
static final int STATE_MAXIMUMMaximum legal state code- See Also:
-
-
Method Details
-
addDateHeader
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 headerdate- the assigned date value
-
addHeader
Adds a response header with the given name and value. This method allows headers to have multiple values.- Parameters:
name- the name of the headervalue- the header value
-
addIntHeader
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 headervalue- the assigned integer value
-
containsHeader
Returns a boolean indicating whether the named response header has already been set.- Parameters:
name- the header name- Returns:
trueif the named response header has already been set,falseotherwise.
-
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
Stringspecifying 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
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 ornullif the E3Application hasn't calledsetOutputFile.- Returns:
Fileto be returned nornull
-
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 theE3ApplicationRequestobject. 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 theE3RequestResponseobject to the state it was in when it was passed todoGetordoPost. -
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
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 codemsg- error message
-
sendRedirect
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. iflocationis 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
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
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. ThecontainsHeadermethod can be used to test for the presence of a header before setting its value.- Parameters:
name- the name of the headerdate- the assigned date value
-
setHeader
Sets a response header with the given name and value. If the header has already been set, the new value overwrites the previous one. ThecontainsHeadermethod can be used to test for the presence of a header before setting its value.- Parameters:
name- the name of the headervalue- the header value
-
setIntHeader
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. ThecontainsHeadermethod can be used to test for the presence of a header before setting its value.- Parameters:
name- the name of the headervalue- the assigned integer value
-
setLocale
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
Sets up to return the content of a file. Discards the error message (if any) set by a prior call tosendError()and/or the HTML page (if any) set by a prior call tosetOutputPage- Parameters:
target- file to be transmitteddeleteAfterUse- 1 -> E3 will delete the file after transmitting it to the client 0 -> E3 won't delete the file
-
setOutputPage
Sets up to return an HTML page. The parameterpagemust 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
Sets up to return the content of a file. Discards the error message (if any) set by a prior call tosendError()and/or the HTML page (if any) set by a prior call tosetOutputPage- Parameters:
target-Stringcontaining 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
-