Package com.helger.phase4.servlet
Interface IAS4ResponseAbstraction
public interface IAS4ResponseAbstraction
A synthetic wrapper for an AS4 HTTP response. By default
AS4UnifiedResponse is the logical implementation, but the return
types are different.- Since:
- 0.9.6
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptionvoidsetContent(byte[] aBytes, Charset aCharset) Set the response payload as a byte array with a certain character set.voidsetContent(com.helger.commons.http.HttpHeaderMap aHeaderMap, com.helger.commons.io.IHasInputStream aHasIS) Set the content as an input stream provider.voidsetMimeType(com.helger.commons.mime.IMimeType aMimeType) Set the MIME type (Content-Type) of the response.voidsetStatus(int nStatusCode) Set the HTTP status code to be returned.static IAS4ResponseAbstractionwrap(AS4UnifiedResponse aHttpResponse) Create theIAS4ResponseAbstractionfor use withAS4UnifiedResponse.
-
Method Details
-
setContent
Set the response payload as a byte array with a certain character set. This is called, if the an XML response is sent back.- Parameters:
aBytes- The bytes to be set. May not benull.aCharset- The character set of the byte array. May not benull.- Since:
- 0.9.7 this was merged from setContent and setCharset
-
setContent
void setContent(@Nonnull com.helger.commons.http.HttpHeaderMap aHeaderMap, @Nonnull com.helger.commons.io.IHasInputStream aHasIS) Set the content as an input stream provider. This is used if a MIME response is sent back.- Parameters:
aHeaderMap- Custom HTTP headers to be used. Nevernullbut maybe empty.aHasIS- The input stream provider.- Since:
- 0.9.9 this was merged from addCustomResponseHeaders and setContent
-
setMimeType
Set the MIME type (Content-Type) of the response.- Parameters:
aMimeType- Mime type to use. May not benull.
-
setStatus
void setStatus(int nStatusCode) Set the HTTP status code to be returned.- Parameters:
nStatusCode- The HTTP status code.
-
wrap
Create theIAS4ResponseAbstractionfor use withAS4UnifiedResponse.- Parameters:
aHttpResponse- The unified response to be wrapped. May not benull.- Returns:
- Never
null.
-