public class EhcacheAsynchronyCorrelator<AuditDatasetType extends WsAuditDataset> extends Object implements AsynchronyCorrelator<AuditDatasetType>
FORCE_CORRELATION
Constructor and Description |
---|
EhcacheAsynchronyCorrelator(net.sf.ehcache.Ehcache ehcache) |
Modifier and Type | Method and Description |
---|---|
boolean |
delete(String messageId)
Deletes information pieces about the message with the given ID.
|
AuditDatasetType |
getAuditDataset(String messageId)
Returns the audit dataset for the request message with the
given ID, or
null if the message is unknown. |
String |
getCorrelationKey(String messageId)
Returns the user-defined correlation key for the message with the
given ID, or
null if the message is unknown or the
user did not provided any correlation key. |
String |
getMessageId(String alternativeKey)
Determines WS-Addressing message ID ("primary key")
which corresponds to the given alternative key.
|
String |
getServiceEndpointUri(String messageId)
Returns the URI of the endpoint to which the message with the given
ID has been sent, or
null 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.
|
public EhcacheAsynchronyCorrelator(net.sf.ehcache.Ehcache ehcache)
public void storeServiceEndpointUri(String messageId, String serviceEndpointUri)
AsynchronyCorrelator
storeServiceEndpointUri
in interface AsynchronyCorrelator<AuditDatasetType extends WsAuditDataset>
messageId
- WS-Addressing message ID of the request.serviceEndpointUri
- URL of the endpoint the request is being sent to.public void storeCorrelationKey(String messageId, String correlationKey)
AsynchronyCorrelator
storeCorrelationKey
in interface AsynchronyCorrelator<AuditDatasetType extends WsAuditDataset>
messageId
- WS-Addressing message ID of the request.correlationKey
- correlation key provided by the user.public void storeAuditDataset(String messageId, WsAuditDataset auditDataset)
AsynchronyCorrelator
storeAuditDataset
in interface AsynchronyCorrelator<AuditDatasetType extends WsAuditDataset>
messageId
- WS-Addressing message ID of the request.auditDataset
- audit dataset.public String getServiceEndpointUri(String messageId)
AsynchronyCorrelator
null
if the message is unknown.getServiceEndpointUri
in interface AsynchronyCorrelator<AuditDatasetType extends WsAuditDataset>
public String getCorrelationKey(String messageId)
AsynchronyCorrelator
null
if the message is unknown or the
user did not provided any correlation key.getCorrelationKey
in interface AsynchronyCorrelator<AuditDatasetType extends WsAuditDataset>
public AuditDatasetType getAuditDataset(String messageId)
AsynchronyCorrelator
null
if the message is unknown.getAuditDataset
in interface AsynchronyCorrelator<AuditDatasetType extends WsAuditDataset>
public void storeAlternativeKeys(String messageId, String... alternativeKeys)
AsynchronyCorrelator
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.
storeAlternativeKeys
in interface AsynchronyCorrelator<AuditDatasetType extends WsAuditDataset>
messageId
- WS-Addressing message ID of the request.alternativeKeys
- alternative keys, should be not null
.public String getMessageId(String alternativeKey)
AsynchronyCorrelator
getMessageId
in interface AsynchronyCorrelator<AuditDatasetType extends WsAuditDataset>
alternativeKey
- alternative key.null
when not found.public boolean delete(String messageId)
AsynchronyCorrelator
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...).
delete
in interface AsynchronyCorrelator<AuditDatasetType extends WsAuditDataset>
true
when there actually was something to delete,
i.e. when the given ID was known; false
otherwise.Copyright © 2018 Open eHealth Foundation. All rights reserved.