public class ResponseHeadersAsObjectMetadata extends MetadataResponseHeaderImpl
ResponseHeaderHandler
which adds all the HTTP headers from the
response as object metadata to the AdaptrisMessage
.
For each header field that exists, there will be a corresponding URLConnectionHeaderField
in object metadata.
Note that HttpURLConnection
exposes header fields as a List<String>
so this is reflected in the URLConnectionHeaderField
. In most situations there will only be a single entry in the list.
This will include header fields where the key is null
; this will end up as the string "null"
. HttpURLConnection
exposes the HTTP status line (e.g. 200 HTTP/1.1 OK
as a header field with no key so this will
generally be the object metadata associated with "null"
.
In the adapter configuration file this class is aliased as http-response-headers-as-object-metadata which is the preferred alternative to the fully qualified classname when building your configuration.
log
Constructor and Description |
---|
ResponseHeadersAsObjectMetadata() |
ResponseHeadersAsObjectMetadata(java.lang.String prefix) |
Modifier and Type | Method and Description |
---|---|
protected void |
addMetadata(java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers,
AdaptrisMessage reply) |
generateKey, getMetadataPrefix, handle, setMetadataPrefix
public ResponseHeadersAsObjectMetadata()
public ResponseHeadersAsObjectMetadata(java.lang.String prefix)
protected void addMetadata(java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers, AdaptrisMessage reply)
addMetadata
in class MetadataResponseHeaderImpl