Interface AuWriter
- All Known Implementing Classes:
HttpAuWriter
AuRequest.
To use the writer, open(java.lang.Object, java.lang.Object) must be called first.
And, close(java.lang.Object, java.lang.Object) after all responses are written.
- Since:
- 3.0.1
- Author:
- tomyeh
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidCloses the writer and flush the result to client.complete()Indicates the writing has been completed.Initializes the writer.voidResend the content of the previous request returned bycomplete().voidsetCompress(boolean compress) Sets whether to compress the output with GZIP.voidwrite(Collection<AuResponse> responses) Generates a list of responses to the output.voidwrite(AuResponse response) Generates the specified the response to the output.voidwriteResponseId(int resId) Generates the response ID to the output.
-
Method Details
-
setCompress
void setCompress(boolean compress) Sets whether to compress the output with GZIP.Default: true.
- Since:
- 3.6.3
-
open
Initializes the writer.- Parameters:
request- the request (HttpServletRequest if HTTP)response- the response (HttpServletResponse if HTTP)- Returns:
- this object
- Throws:
IOException- Since:
- 6.0.0 (the signature is simplified)
-
close
Closes the writer and flush the result to client.- Parameters:
request- the request (HttpServletRequest if HTTP)response- the response (HttpServletResponse if HTTP)- Throws:
IOException
-
complete
Indicates the writing has been completed. Invokes this method beforeclose(java.lang.Object, java.lang.Object), if the caller supports the resend mechanism. The caller usually stores the return value to a desktop byDesktopCtrl.responseSent(java.lang.String, java.lang.Object)).Unlike
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
close(java.lang.Object, java.lang.Object)to end the writer.- Throws:
IOException- Since:
- 5.0.4
-
resend
Resend the content of the previous request returned bycomplete().The content is usually stored to a desktop by
DesktopCtrl.responseSent(java.lang.String, java.lang.Object), and retrieved byDesktopCtrl.getLastResponse(java.lang.String).Once this method is called, the caller shall not invoke any other write method nor
complete(). It shall invoke onlyclose(java.lang.Object, java.lang.Object)to end the writer.- Parameters:
prevContent- the previous content returned byclose(java.lang.Object, java.lang.Object)of the previousAuWriter.- Throws:
IllegalArgumentException- if prevContent is null.IllegalStateException- if any of write methods (such aswrite(org.zkoss.zk.au.AuResponse)) is called.IOException- Since:
- 5.0.4
-
writeResponseId
Generates the response ID to the output.- Throws:
IOException- Since:
- 3.5.0
- See Also:
-
write
Generates the specified the response to the output.- Throws:
IOException
-
write
Generates a list of responses to the output.- Throws:
IOException
-