public class ITKMessagePropertiesImpl extends Object implements ITKMessageProperties
BUSINESS_ACK_HANDLING_SPECIFICATION_KEY, INTERACTION_HANDLING_SPECIFICATION_KEY
Constructor and Description |
---|
ITKMessagePropertiesImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addHandlingSpecification(String key,
String value)
Allows the message originator to add a handling specification to the
associated
ITKMessage .Handling specifications provide an extensible mechanism for the message originator to attach special processing instructions with the message. |
static ITKMessageProperties |
build(Document distributionEnvelope)
Builds the.
|
static Document |
extractDistributionEnvelopeFromSoap(Document doc)
Extract distribution envelope from soap.
|
ITKIdentity |
getAuditIdentity()
Returns the audit identity of the ITK message originator
|
String |
getBusinessPayloadId()
Obtains the business payloadId associated with this
message.
|
ITKAddress |
getFromAddress()
Obtains the originators ITK address
|
String |
getHandlingSpecification(String key)
Convenience method that allows the value of the handling specification
to be obtained directly.
|
Map<String,String> |
getHandlingSpecifications()
Obtains the Map of the handling specifications associated with the
ITKMessage .Handling specifications provide an extensible mechanism for the message originator to attach special processing instructions with the message. |
ITKTransportProperties |
getInboundTransportProperties()
Obtains the
ITKTransportProperties that are associated with the
ITKMessage that was received by the service provider on the inbound
leg in an asynchronous request/response invocation.The inboundITKTransportProperties are not expected to
be processed by the application layer, however where present
the application layer is responsible for attaching the
inboundITKTransportProperties to any responses generated
such that these transport properties are available to the transport layers
transmitting the response.A typical use of this mechanism is for the propagation of the <wsa:replyTo/> address such that it is available to the
to the transport layers managing the "reply".Note although this pattern adds some additional burden on the application layer it offers significant advantages over the alternative where the transport layer has to maintain state and correlate messages - potentially over several distributed nodes |
String |
getProfileId()
Obtains the profileId associated with the ITKMessage.
|
String |
getServiceId()
ITK message service associated with the message
|
ITKAddress |
getToAddress()
Obtains the destination address for the associated ITK Message.
Note Whilst the ITK Specifications allow for multiple recipients to be specified this version of the ITK API only supports a single recipient to be defined as this satisfies the majority of anticipated use-cases. |
String |
getTrackingId()
Obtains the tracking id associated with the ITKMessage
when sending the message between two or more endpoints.
|
void |
setAuditIdentity(ITKIdentity auditIdentity)
Sets the audit identity of the message originator
|
void |
setBusinessPayloadId(String businessPayloadId)
Sets the business payloadId associated with this
message.
|
void |
setFromAddress(ITKAddress fromAddress)
Sets the originators address for this message.
|
void |
setInboundTransportProperties(ITKTransportProperties inboundTransportProperties)
Sets the
ITKTransportProperties that are associated with the
ITKMessage that was received by the service provider on the inbound
leg in an asynchronous request/response invocation.The inboundITKTransportProperties are not expected to
be processed by the application layer, however where present
the application layer is responsible for attaching the
inboundITKTransportProperties to any responses generated
such that these transport properties are available to the transport layers
transmitting the response.A typical use of this mechanism is for the propagation of the <wsa:replyTo/> URL such that it is available to the
to the transport layers managing the "reply".Note although this pattern adds some additional burden on the application layer it offers significant advantages over the alternative where the transport layer has to maintain state and correlate messages - potentially over several distributed nodes |
void |
setProfileId(String profileId)
Sets the profileId associated with the ITKMessage.
|
void |
setServiceId(String serviceId)
Sets the ITK message serviceId associated with this message
|
void |
setToAddress(ITKAddress toAddress)
Sets the destination address for the associated ITK Message.
Note Whilst the ITK Specifications allow for multiple recipients to be specified this version of the ITK API only supports a single recipient to be defined as this satisfies the majority of anticipated use-cases. |
void |
setTrackingId(String trackingId)
Sets the tracking id associated with the ITKMessage
prior to sending the message between two or more endpoints.
|
public String getTrackingId()
ITKMessageProperties
ITKMessageProperties.getBusinessPayloadId()
.ITKAckDetails.getTrackingRef()
)
and ITK Business Acknowledgements.getTrackingId
in interface ITKMessageProperties
public void setTrackingId(String trackingId)
ITKMessageProperties
ITKMessageProperties.setBusinessPayloadId(String)
.ITKAckDetails.getTrackingRef()
)
and ITK Business Acknowledgements.setTrackingId
in interface ITKMessageProperties
trackingId
- a String UUID representing the tracking Id
for this transmission. Note if the message is resent a new tracking
Id should be createdpublic ITKAddress getFromAddress()
ITKMessageProperties
getFromAddress
in interface ITKMessageProperties
public void setFromAddress(ITKAddress fromAddress)
ITKMessageProperties
setFromAddress
in interface ITKMessageProperties
fromAddress
- the ITKAddress object with the address details of the message
originatorpublic ITKAddress getToAddress()
ITKMessageProperties
getToAddress
in interface ITKMessageProperties
public void setToAddress(ITKAddress toAddress)
ITKMessageProperties
setToAddress
in interface ITKMessageProperties
toAddress
- the ITKAddress object containing the address details of the
intended recipientpublic ITKIdentity getAuditIdentity()
ITKMessageProperties
getAuditIdentity
in interface ITKMessageProperties
public void setAuditIdentity(ITKIdentity auditIdentity)
ITKMessageProperties
setAuditIdentity
in interface ITKMessageProperties
public String getServiceId()
ITKMessageProperties
getServiceId
in interface ITKMessageProperties
public void setServiceId(String serviceId)
ITKMessageProperties
setServiceId
in interface ITKMessageProperties
serviceId
- The String identifying the ITK Service (from ITK Domain Message Specifications)public String getBusinessPayloadId()
ITKMessageProperties
ITKMessageProperties.getTrackingId()
as it is an id that is
typically embedded somewhere in the business payload - for
example as a document instance id in a CDA message, whereas
the ITKMessageProperties.getTrackingId()
is specifically an id assigned
when sending the message between two or more endpoints and
should not have meaning beyond the original ITK transmission and
associated acknowledgements.getBusinessPayloadId
in interface ITKMessageProperties
public void setBusinessPayloadId(String businessPayloadId)
ITKMessageProperties
setBusinessPayloadId
in interface ITKMessageProperties
businessPayloadId
- The UUID associated with the
ITK Message business payloadpublic String getProfileId()
ITKMessageProperties
getProfileId
in interface ITKMessageProperties
nhs-en:profile:nonCodedCDADocument-v2-0
)public void setProfileId(String profileId)
ITKMessageProperties
setProfileId
in interface ITKMessageProperties
profileId
- The profile id (e.g. nhs-en:profile:nonCodedCDADocument-v2-0
)public ITKTransportProperties getInboundTransportProperties()
ITKMessageProperties
ITKTransportProperties
that are associated with the
ITKMessage that was received by the service provider on the inbound
leg in an asynchronous request/response invocation.inboundITKTransportProperties
are not expected to
be processed by the application layer, however where present
the application layer is responsible for attaching the
inboundITKTransportProperties
to any responses generated
such that these transport properties are available to the transport layers
transmitting the response.<wsa:replyTo/>
address such that it is available to the
to the transport layers managing the "reply".getInboundTransportProperties
in interface ITKMessageProperties
inboundITKTransportProperties
- the ITKTransportProperties
that
were obtained from the inbound message.public void setInboundTransportProperties(ITKTransportProperties inboundTransportProperties)
ITKMessageProperties
ITKTransportProperties
that are associated with the
ITKMessage that was received by the service provider on the inbound
leg in an asynchronous request/response invocation.inboundITKTransportProperties
are not expected to
be processed by the application layer, however where present
the application layer is responsible for attaching the
inboundITKTransportProperties
to any responses generated
such that these transport properties are available to the transport layers
transmitting the response.<wsa:replyTo/>
URL such that it is available to the
to the transport layers managing the "reply".setInboundTransportProperties
in interface ITKMessageProperties
inboundTransportProperties
- The ITKTransportProperties
that
were obtained from the inbound message.public Map<String,String> getHandlingSpecifications()
ITKMessageProperties
ITKMessage
.ITKMessageProperties.BUSINESS_ACK_HANDLING_SPECIFICATION_KEY
), and one to explicitly
associated an interaction Id with the message
(ITKMessageProperties.INTERACTION_HANDLING_SPECIFICATION_KEY
).getHandlingSpecifications
in interface ITKMessageProperties
Map
of all handling specifications associated
with the message. For each entry in the Map contains both the key
(e.g. urn:nhs:itk:ns:201005:ackrequested
) and the
associated value. If no handling specifications are associated
with the message then an empty map is returned.public void addHandlingSpecification(String key, String value)
ITKMessageProperties
ITKMessage
.ITKMessageProperties.BUSINESS_ACK_HANDLING_SPECIFICATION_KEY
), and one to explicitly
associated an interaction Id with the message
(ITKMessageProperties.INTERACTION_HANDLING_SPECIFICATION_KEY
).addHandlingSpecification
in interface ITKMessageProperties
key
- The handling specification key - for instance
ITKMessageProperties.BUSINESS_ACK_HANDLING_SPECIFICATION_KEY
value
- The appropriate value
for the handling specificationpublic String getHandlingSpecification(String key)
ITKMessageProperties
getHandlingSpecification
in interface ITKMessageProperties
key
- The handling specification key - for instance ITKMessageProperties.BUSINESS_ACK_HANDLING_SPECIFICATION_KEY
value
associated with the provided key or null
if the
handling specification indicated by the key was not presentpublic static Document extractDistributionEnvelopeFromSoap(Document doc) throws ITKMessagingException
doc
- the docITKMessagingException
- the iTK messaging exceptionpublic static ITKMessageProperties build(Document distributionEnvelope) throws ITKMessagingException
distributionEnvelope
- the distribution envelopeITKMessagingException
- the iTK messaging exceptionAll content is available under the Open Government Licence, except where otherwise stated
All example source code is available under Apache 2.0, except where otherwise stated