Class SpringCacheAsynchronyCorrelator<AuditDatasetType extends WsAuditDataset>
java.lang.Object
org.openehealth.ipf.commons.ihe.ws.correlation.SpringCacheAsynchronyCorrelator<AuditDatasetType>
- All Implemented Interfaces:
AsynchronyCorrelator<AuditDatasetType>
public class SpringCacheAsynchronyCorrelator<AuditDatasetType extends WsAuditDataset>
extends Object
implements AsynchronyCorrelator<AuditDatasetType>
Ehcache-based implementation of asynchronous message correlator.
- Author:
- Dmytro Rud
-
Field Summary
Fields inherited from interface org.openehealth.ipf.commons.ihe.ws.correlation.AsynchronyCorrelator
FORCE_CORRELATION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Deletes information pieces about the message with the given ID.getAuditDataset
(String messageId) Returns the audit dataset for the request message with the given ID, ornull
if the message is unknown.getCorrelationKey
(String messageId) Returns the user-defined correlation key for the message with the given ID, ornull
if the message is unknown or the user did not provided any correlation key.getMessageId
(String alternativeKey) Determines WS-Addressing message ID ("primary key") which corresponds to the given alternative key.getServiceEndpointUri
(String messageId) Returns the URI of the endpoint to which the message with the given ID has been sent, ornull
if the message is unknown.void
storeAlternativeKeys
(String messageId, String... alternativeKeys) Stores a set of alternative keys for the message with the given WS-Addressing ID.void
storeAuditDataset
(String messageId, WsAuditDataset auditDataset) Stores audit dataset.void
storeCorrelationKey
(String messageId, String correlationKey) Stores a user-defined correlation key.void
storeServiceEndpointUri
(String messageId, String serviceEndpointUri) Stores a service endpoint URI.
-
Constructor Details
-
SpringCacheAsynchronyCorrelator
-
-
Method Details
-
storeServiceEndpointUri
Description copied from interface:AsynchronyCorrelator
Stores a service endpoint URI.- Specified by:
storeServiceEndpointUri
in interfaceAsynchronyCorrelator<AuditDatasetType extends WsAuditDataset>
- Parameters:
messageId
- WS-Addressing message ID of the request.serviceEndpointUri
- URL of the endpoint the request is being sent to.
-
storeCorrelationKey
Description copied from interface:AsynchronyCorrelator
Stores a user-defined correlation key.- Specified by:
storeCorrelationKey
in interfaceAsynchronyCorrelator<AuditDatasetType extends WsAuditDataset>
- Parameters:
messageId
- WS-Addressing message ID of the request.correlationKey
- correlation key provided by the user.
-
storeAuditDataset
Description copied from interface:AsynchronyCorrelator
Stores audit dataset.- Specified by:
storeAuditDataset
in interfaceAsynchronyCorrelator<AuditDatasetType extends WsAuditDataset>
- Parameters:
messageId
- WS-Addressing message ID of the request.auditDataset
- audit dataset.
-
getServiceEndpointUri
Description copied from interface:AsynchronyCorrelator
Returns the URI of the endpoint to which the message with the given ID has been sent, ornull
if the message is unknown.- Specified by:
getServiceEndpointUri
in interfaceAsynchronyCorrelator<AuditDatasetType extends WsAuditDataset>
-
getCorrelationKey
Description copied from interface:AsynchronyCorrelator
Returns the user-defined correlation key for the message with the given ID, ornull
if the message is unknown or the user did not provided any correlation key.- Specified by:
getCorrelationKey
in interfaceAsynchronyCorrelator<AuditDatasetType extends WsAuditDataset>
-
getAuditDataset
Description copied from interface:AsynchronyCorrelator
Returns the audit dataset for the request message with the given ID, ornull
if the message is unknown.- Specified by:
getAuditDataset
in interfaceAsynchronyCorrelator<AuditDatasetType extends WsAuditDataset>
-
storeAlternativeKeys
Description copied from interface:AsynchronyCorrelator
Stores a set of alternative keys for the message with the given WS-Addressing ID. When the <RelatesTo> header of the incoming response does not contain a valid/a known message ID for correlation, the system will use transaction-specific mechanisms to extract additional keys from the message body and to perform the correlation of their basis.The correlator must maintain bi-directional correspondence between the "primary" key (WS-Addressing message ID of the request) and the alternative keys. The uniqueness of the alternative keys should be provided, but cannot be guaranteed.
- Specified by:
storeAlternativeKeys
in interfaceAsynchronyCorrelator<AuditDatasetType extends WsAuditDataset>
- Parameters:
messageId
- WS-Addressing message ID of the request.alternativeKeys
- alternative keys, should be notnull
.
-
getMessageId
Description copied from interface:AsynchronyCorrelator
Determines WS-Addressing message ID ("primary key") which corresponds to the given alternative key.- Specified by:
getMessageId
in interfaceAsynchronyCorrelator<AuditDatasetType extends WsAuditDataset>
- Parameters:
alternativeKey
- alternative key.- Returns:
- WS-Addressing message ID or
null
when not found.
-
delete
Description copied from interface:AsynchronyCorrelator
Deletes information pieces about the message with the given ID.This method is supposed to be called internally after the correlation of an asynchronous response has been completed; the user does not have to call it explicitly (but who knows...).
- Specified by:
delete
in interfaceAsynchronyCorrelator<AuditDatasetType extends WsAuditDataset>
- Returns:
true
when there actually was something to delete, i.e. when the given ID was known;false
otherwise.
-