public class Hl7OverHttpResponseEncoder extends AbstractHl7OverHttpEncoder
Modifier and Type | Field and Description |
---|---|
static String |
HTTP_HEADER_HL7_SIGNATURE |
static String |
HTTP_HEADER_HL7_SIGNATURE_LC |
protected static Charset |
ourDefaultCharset |
Constructor and Description |
---|
Hl7OverHttpResponseEncoder() |
Modifier and Type | Method and Description |
---|---|
protected void |
addSpecificHeaders() |
Charset |
getCharset()
Returns the charset associated with this message.
|
byte[] |
getData() |
static Charset |
getDefaultCharset() |
Map<String,String> |
getHeaders() |
String |
getMessage() |
String |
getPassword() |
String |
getPath() |
String |
getPathRaw() |
ISigner |
getSigner() |
String |
getUsername() |
boolean |
isCharsetExplicitlySet() |
protected void |
setActionLineAppropriately() |
void |
setAddConnectionCloseHeader(boolean theAddConnectionCloseHeader)
Adds a header to the HTTP response: "
Connection: close ". |
void |
setCharset(Charset theCharset)
Deprecated.
The HL7 over HTTP specification now mandates the use of UTF-8. Using this method to set a value other than UTF-8 will lead to a non-conformant application
|
protected void |
setData(byte[] theData) |
void |
setGzipData(boolean theGzipData)
Should response be GZipped?
|
void |
setHeaders(LinkedHashMap<String,String> theHeaders) |
void |
setPassword(String thePassword) |
void |
setPath(String thePath) |
void |
setSigner(ISigner theSigner)
Optionally may be used to provide a signer implementation which signs HL7
content.
|
void |
setUsername(String theUsername) |
protected void |
verifyNotUsed()
Throws an
IllegalStateException if called more than once |
encode, encodeToOutputStream, getActionLine, setActionLine, setDataProvider, setMessage
public static final String HTTP_HEADER_HL7_SIGNATURE
public static final String HTTP_HEADER_HL7_SIGNATURE_LC
protected static final Charset ourDefaultCharset
public Hl7OverHttpResponseEncoder()
protected void addSpecificHeaders()
addSpecificHeaders
in class AbstractHl7OverHttpEncoder
protected void setActionLineAppropriately()
setActionLineAppropriately
in class AbstractHl7OverHttpEncoder
public void setAddConnectionCloseHeader(boolean theAddConnectionCloseHeader)
Connection: close
". Note that setting this to true (default is false) will ONLY add the header, it does not actually close the connection. The
caller is responsible for that.public void setGzipData(boolean theGzipData)
public Charset getCharset()
null
.public byte[] getData()
public Map<String,String> getHeaders()
public String getMessage()
public String getPassword()
public String getPathRaw()
public String getUsername()
public boolean isCharsetExplicitlySet()
true
if the charset was explicitly set using
setCharset(Charset)
@Deprecated public void setCharset(Charset theCharset)
theCharset
- The encoding charset to use (default is UTF-8)protected void setData(byte[] theData)
theData
- the data to setpublic void setHeaders(LinkedHashMap<String,String> theHeaders)
theHeaders
- the headers to setpublic void setPassword(String thePassword)
thePassword
- The authorization passwordpublic void setSigner(ISigner theSigner)
ISigner
,
StandardMessageSigner
public void setUsername(String theUsername)
theUsername
- The authorization usernameprotected void verifyNotUsed()
IllegalStateException
if called more than oncepublic static Charset getDefaultCharset()
Copyright © 2012–2017 University Health Network. All rights reserved.