|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zkoss.zk.au.http.HttpAuWriter
public class HttpAuWriter
The writer used to write the output back to the client.
Constructor Summary | |
---|---|
HttpAuWriter()
|
Method Summary | |
---|---|
void |
close(java.lang.Object request,
java.lang.Object response)
Closes the writer and flush the result to client. |
java.lang.Object |
complete()
Indicates the writing has been completed. |
protected void |
flush(java.lang.Object request,
java.lang.Object response,
boolean bCompress)
Flush the result of responses to client. |
boolean |
isCompress()
Returns whether to compress the output. |
AuWriter |
open(java.lang.Object request,
java.lang.Object response)
Opens the connection. |
void |
resend(java.lang.Object prevContent)
Resend the content of the previous request returned by AuWriter.complete() . |
protected byte[] |
restore(java.lang.Object data)
Called to decode the last response for repeated request before retrieving. |
protected java.lang.Object |
save(byte[] data)
Called to encode the last response for repeated request before storing. |
void |
setCompress(boolean compress)
Sets whether to compress the output with GZIP. |
void |
write(AuResponse response)
Generates the specified the response to the output. |
void |
write(java.util.Collection<AuResponse> responses)
Generates a list of responses to the output. |
void |
writeResponseId(int resId)
Generates the response ID to the output. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpAuWriter()
Method Detail |
---|
public boolean isCompress()
public void setCompress(boolean compress)
AuWriter
Default: true.
setCompress
in interface AuWriter
public AuWriter open(java.lang.Object request, java.lang.Object response) throws java.io.IOException
Default: it creates an object to store the responses.
open
in interface AuWriter
request
- the request (HttpServletRequest if HTTP)response
- the response (HttpServletResponse if HTTP)
java.io.IOException
public void close(java.lang.Object request, java.lang.Object response) throws java.io.IOException
AuWriter
close
in interface AuWriter
request
- the request (HttpServletRequest if HTTP)response
- the response (HttpServletResponse if HTTP)
java.io.IOException
public void resend(java.lang.Object prevContent) throws java.io.IOException
AuWriter
AuWriter.complete()
.
The content is usually stored to a desktop
by DesktopCtrl.responseSent(java.lang.String, java.lang.Object)
,
and retrieved by DesktopCtrl.getLastResponse(java.lang.String)
.
Once this method is called, the caller shall not invoke
any other write method nor AuWriter.complete()
.
It shall invoke only AuWriter.close(java.lang.Object, java.lang.Object)
to end the writer.
resend
in interface AuWriter
prevContent
- the previous content returned by
AuWriter.close(java.lang.Object, java.lang.Object)
of the previous AuWriter
.
java.io.IOException
public java.lang.Object complete() throws java.io.IOException
AuWriter
AuWriter.close(java.lang.Object, java.lang.Object)
,
if the caller supports the resend mechanism.
The caller usually stores the return value to a desktop by
DesktopCtrl.responseSent(java.lang.String, java.lang.Object)
).
Unlike AuWriter.close(java.lang.Object, java.lang.Object)
, this method must be called
in an activated execution.
Once this method is called, the caller shall not invoke
any other write method. It shall invoke only AuWriter.close(java.lang.Object, java.lang.Object)
to end the writer.
complete
in interface AuWriter
java.io.IOException
protected void flush(java.lang.Object request, java.lang.Object response, boolean bCompress) throws java.io.IOException
bCompress
- whether to compress (if allowed).
java.io.IOException
protected java.lang.Object save(byte[] data)
Default: does nothing but return the input argument, data. The derived class might override this method to compress it.
restore(java.lang.Object)
protected byte[] restore(java.lang.Object data)
Default: does nothing but return the input argument, data. The derived class might override this method to uncompress it.
data
- the data returned by save(byte[])
save(byte[])
.public void writeResponseId(int resId) throws java.io.IOException
AuWriter
writeResponseId
in interface AuWriter
java.io.IOException
DesktopCtrl.getResponseId(boolean)
public void write(AuResponse response) throws java.io.IOException
AuWriter
write
in interface AuWriter
java.io.IOException
public void write(java.util.Collection<AuResponse> responses) throws java.io.IOException
AuWriter
write
in interface AuWriter
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |