|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.cics.server.HttpResponse
Usage:
This class provides the Java implementation of HTTP responses related to the following
CICS API WEB server commands:
The writeHeader() method allows HTTP header information to be added to a response. This is equivalent to CICS API command WEB WRITE.
The setter methods allow instance variables to be set in the HttpResponse object. These variables relate to the following options on the CICS API command WEB SEND:
The sendDocument() method sends the specified Document object to the clients browser. This is equivalent to CICS API command WEB SEND DOCUMENT.
The sendFrom() method sends an application buffer to the clients browser. This is equivalent to CICS API command WEB SEND FROM.
The sendChunk() sends a chunk of a chunked response to the client. When all the chunks of the chunked response have been sent the sendLastChunk() method must be used to terminate the chunked response. This is equivalent to using CICS API commands WEB SEND FROM CHUNKYES and WEB SEND CHUNKEND to send a chunked response.
A equivalent method for CICS API command WEB RETRIEVE is not supplied. This command returns the DOCTOKEN of the document sent using an earlier WEB SEND command. The Document object sent by the sendDocument() method should still be available so a method equivalent to this command is not required.
Field Summary | |
---|---|
static int |
NOTSET
|
Constructor Summary | |
---|---|
HttpResponse()
Usage: Public default constructor. |
Method Summary | |
---|---|
void |
sendChunk(byte[] from)
Usage: Send a chunk of the chunked response to the client. |
void |
sendChunk(java.lang.String from)
Usage: Send a chunk of the chunked response to the client. |
void |
sendDocument(Document doc)
Usage: Send a document to the client. |
void |
sendDocument(Document doc,
short statusCode,
java.lang.String statusText,
java.lang.String clntCodePage)
Usage: Send a document to the client. |
void |
sendFrom(byte[] from)
Usage: Send an application buffer to the client. |
void |
sendFrom(java.lang.String from)
Usage: Send an application buffer to the client. |
void |
sendLastChunk()
Usage: Indicate that the chunked response is complete. |
void |
setActionEventual()
Usage: Sets WEB SEND command option ACTION to EVENTUAL. |
void |
setActionImmediate()
Usage: Sets WEB SEND command option ACTION to IMMEDIATE. |
void |
setClientCodePage(java.lang.String clntCodePage)
Usage: Sets WEB SEND command option CLNTCODEPAGE. |
void |
setClose()
Usage: Sets WEB SEND command option CLOSESTATUS to CLOSE. |
void |
setHostCodePage(java.lang.String hostCodePage)
Usage: Sets WEB SEND command option HOSTCODEPAGE. |
void |
setMediaType(java.lang.String mediaType)
Usage: Sets WEB SEND command option MEDIATYPE. |
void |
setNoClose()
Usage: Sets WEB SEND command option CLOSESTATUS to NOCLOSE. |
void |
setNoServerConvert()
Usage: Sets WEB SEND command option SERVERCONV to NOSRVCONVERT. |
void |
setServerConvert()
Usage: Sets WEB SEND command option SERVERCONV to SRVCONVERT. |
void |
setStatus(short statusCode,
java.lang.String statusText)
Usage: Sets WEB SEND command option STATUSCODE and STATUSTEXT.. |
void |
writeHeader(java.lang.String header,
java.lang.String value)
Usage: Add HTTP header information to the response. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NOTSET
Constructor Detail |
public HttpResponse()
None
Method Detail |
public void writeHeader(java.lang.String header, java.lang.String value) throws InvalidRequestException
header
- contains the name of the HTTP headervalue
- contains the value of the named header
InvalidRequestException
- a INVREQ condition occurredpublic void setServerConvert()
None
public void setNoServerConvert()
None
public void setClientCodePage(java.lang.String clntCodePage)
clntCodePage
- contains the codepage into which the HTTP response body is to be converting
when the WEB SEND command is issued
None
public void setHostCodePage(java.lang.String hostCodePage)
hostCodePage
- contains the codepage that the data being sent by the WEB SEND command is
encoded in
None
public void setMediaType(java.lang.String mediaType)
mediaType
- contains mediatype information to be used by the WEB SEND command
None
public void setStatus(short statusCode, java.lang.String statusText)
statusCode
- contains a HTTP status codestatusText
- contains text describing the value of the status code
None
public void setClose()
None
public void setNoClose()
None
public void setActionEventual()
None
public void setActionImmediate()
None
public void sendDocument(Document doc, short statusCode, java.lang.String statusText, java.lang.String clntCodePage) throws InvalidRequestException, RecordNotFoundException, LengthErrorException, IOErrorException
doc
- is the Document object to be sent to the clientstatusCode
- contains a HTTP status codestatusText
- contains text describing the value of the status codeclntCodePage
- contains the name of the ASCII codepage in which the data
is to be delivered to the browser
InvalidRequestException
- a INVREQ condition occurred
RecordNotFoundException
- a NOTFND condition occurred
LengthErrorException
- a LENGERR condition occurred
IOErrorException
- a IOERR condition occurredpublic void sendDocument(Document doc) throws InvalidRequestException, RecordNotFoundException, LengthErrorException, IOErrorException
doc
- is the Document object to be sent to the client
InvalidRequestException
- a INVREQ condition occurred
RecordNotFoundException
- a NOTFND condition occurred
LengthErrorException
- a LENGERR condition occurred
IOErrorException
- a IOERR condition occurredpublic void sendFrom(java.lang.String from) throws InvalidRequestException, RecordNotFoundException, LengthErrorException, IOErrorException
from
- is the data to be sent to the client
InvalidRequestException
- a INVREQ condition occurred
RecordNotFoundException
- a NOTFND condition occurred
LengthErrorException
- a LENGERR condition occurred
IOErrorException
- a IOERR condition occurredpublic void sendFrom(byte[] from) throws InvalidRequestException, RecordNotFoundException, LengthErrorException, IOErrorException
from
- is the data to be sent to the client
InvalidRequestException
- a INVREQ condition occurred
RecordNotFoundException
- a NOTFND condition occurred
LengthErrorException
- a LENGERR condition occurred
IOErrorException
- a IOERR condition occurredpublic void sendChunk(java.lang.String from) throws InvalidRequestException, RecordNotFoundException, LengthErrorException, IOErrorException
from
- is the data that forms a subsequent chunk of the chunked response being sent
to the client
InvalidRequestException
- a INVREQ condition occurred
RecordNotFoundException
- a NOTFND condition occurred
LengthErrorException
- a LENGERR condition occurred
IOErrorException
- a IOERR condition occurredpublic void sendChunk(byte[] from) throws InvalidRequestException, RecordNotFoundException, LengthErrorException, IOErrorException
from
- is the data that forms a subsequent chunk of the chunked response being sent
to the client
InvalidRequestException
- a INVREQ condition occurred
RecordNotFoundException
- a NOTFND condition occurred
LengthErrorException
- a LENGERR condition occurred
IOErrorException
- a IOERR condition occurredpublic void sendLastChunk() throws InvalidRequestException, RecordNotFoundException, LengthErrorException, IOErrorException
InvalidRequestException
- a INVREQ condition occurred
RecordNotFoundException
- a NOTFND condition occurred
LengthErrorException
- a LENGERR condition occurred
IOErrorException
- a IOERR condition occurred
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |