public class SimpleApplicationEmulator extends Object implements ITKMessageConsumer, Runnable
Constructor and Description |
---|
SimpleApplicationEmulator()
Instantiates a new simple application emulator.
|
Modifier and Type | Method and Description |
---|---|
void |
onMessage(ITKMessage request)
Call to process a request message where no application response is returned
synchronously.
|
ITKMessage |
onSyncMessage(ITKMessage request)
Call to process a request message where the application response is returned
synchronously (in the same thread)
|
void |
run() |
public SimpleApplicationEmulator()
public ITKMessage onSyncMessage(ITKMessage request) throws ITKMessagingException
ITKMessageConsumer
onSyncMessage
in interface ITKMessageConsumer
request
- The itk request message to process. Examples might include an
Spine Mini Services getPatientDetailsByNHSNumberRequest-v1-0
messageITKMessage
representing the application/business response
to the provided request
. The response may represent business processing
success or failure depending on the contents of the request
and the
implementation of the underlying service.ITKMessagingException
- if there are any syntactic, semantic or more general
application processing issues when processing the request or constructing the response.
In this context the ITKMessagingException
should not be used to represent
business processing failures such as a query returned no results - in general the
underlying messaging specifications support "error" business response to support
these types of failure.public void onMessage(ITKMessage request) throws ITKMessagingException
ITKMessageConsumer
request
originator asynchronously.onMessage
in interface ITKMessageConsumer
request
- The itk request message to process. Examples might include an
Spine Mini Services nonCodedCDADocument-v2-0
messageITKMessagingException
- if there are any syntactic, semantic or more general
application processing issues when processing the request or constructing the response.
In general it is recommended that full syntactic and as much business level validation
as practical is performed against the request
prior to the method returning
such that faults can be raised and reported back via the underlying transport.
In this context the ITKMessagingException
should not be used to represent
business processing failures such as a query returned no results - in general the
underlying messaging specifications support "error" business response to support
these types of failure.All 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