| Both sides previous revision Previous revision Next revision | Previous revision |
| 3500:0400:0410:0413 [2026/08/13 00:55] – ↷ Page moved from docs:3500:0400:0410:0413 to 3500:0400:0410:0413 localdev | 3500:0400:0410:0413 [2026/08/13 02:57] (current) – external edit 127.0.0.1 |
|---|
| ==== Handling replies to service requests ==== | ==== Handling replies to service requests ==== |
| |
| When a service of the external party or //**AwareIM**// has been requested the service provider may send a reply. The reply is sent as a special notification (called the //service reply notification//). This notification implements the [[docs:3500:0300:0319|INotification]] interface and exposes methods that allow checking the status of the service request and retrieve error message if there was any. | When a service of the external party or //**AwareIM**// has been requested the service provider may send a reply. The reply is sent as a special notification (called the //service reply notification//). This notification implements the [[3500:0300:0319|INotification]] interface and exposes methods that allow checking the status of the service request and retrieve error message if there was any. |
| |
| If //**AwareIM**// requests services of external parties, replies from the external parties need to be delivered back to //**AwareIM**//. Rather than write the Source that would do this it is possible to use the special version of a Sink that would not only deliver service requests to the external party but also send the immediate replies back to //**AwareIM**//. | If //**AwareIM**// requests services of external parties, replies from the external parties need to be delivered back to //**AwareIM**//. Rather than write the Source that would do this it is possible to use the special version of a Sink that would not only deliver service requests to the external party but also send the immediate replies back to //**AwareIM**//. |
| <code java>INotification DomainFactory.createServiceReplyNotification (InotificationDefinition definition, int serviceStatus, String errorMessage);</code> | <code java>INotification DomainFactory.createServiceReplyNotification (InotificationDefinition definition, int serviceStatus, String errorMessage);</code> |
| |
| where ''definition'' must correspond to the structure of the reply declared for the requested service (or ''null'' if a "standard" reply has been declared), ''serviceStatus'' is the constant described in the ''[[pr_methods:getservicestatus|getServiceStatus]]'' method of the [[docs:3500:0300:0319|INotification]] interface and ''errorMessage'' is the message describing the error if service failed. | where ''definition'' must correspond to the structure of the reply declared for the requested service (or ''null'' if a "standard" reply has been declared), ''serviceStatus'' is the constant described in the ''[[ref:p_m:getservicestatus|getServiceStatus]]'' method of the [[3500:0300:0319|INotification]] interface and ''errorMessage'' is the message describing the error if service failed. |
| |
| Once the notification has been created it can be converted to ''DataObjects'' using the ''[[pr_methods:messagebuilder|MessageBuilder]]'' class and fed to the source. Here is the snippet of the code illustrating this: | Once the notification has been created it can be converted to ''DataObjects'' using the ''[[ref:p_m:messagebuilder|MessageBuilder]]'' class and fed to the source. Here is the snippet of the code illustrating this: |
| |
| <code java>public void processMessage (Message msg) | <code java>public void processMessage (Message msg) |