Interface CorrelationManager<T>
-
public interface CorrelationManager<T>Correlation manager stores objects with a correlation key. Clients can access the same objects some time later with same correlation key. This mechanism is used in synchronous communication where request and response messages are stored for correlating consumer and producer components.- Since:
- 2.0
- Author:
- Christoph Deppisch
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tfind(String correlationKey, long timeout)Finds stored object by its correlation key.StringgetCorrelationKey(String correlationKeyName, TestContext context)Gets correlation key for given identifier.ObjectStore<T>getObjectStore()Gets the object store implementation.voidsaveCorrelationKey(String correlationKeyName, String correlationKey, TestContext context)Creates new correlation key in test context by saving as test variable.voidsetObjectStore(ObjectStore<T> store)Sets the object store implementationvoidstore(String correlationKey, T object)Store object to correlation storage using the given correlation key.
-
-
-
Method Detail
-
saveCorrelationKey
void saveCorrelationKey(String correlationKeyName, String correlationKey, TestContext context)
Creates new correlation key in test context by saving as test variable. Method is called when synchronous communication is initialized.- Parameters:
correlationKeyName-correlationKey-context-
-
getCorrelationKey
String getCorrelationKey(String correlationKeyName, TestContext context)
Gets correlation key for given identifier. Consults test context with test variables for retrieving stored correlation key.- Parameters:
correlationKeyName-context-- Returns:
-
store
void store(String correlationKey, T object)
Store object to correlation storage using the given correlation key.- Parameters:
correlationKey-object-
-
find
T find(String correlationKey, long timeout)
Finds stored object by its correlation key.- Parameters:
correlationKey-timeout-- Returns:
-
setObjectStore
void setObjectStore(ObjectStore<T> store)
Sets the object store implementation- Parameters:
store-
-
getObjectStore
ObjectStore<T> getObjectStore()
Gets the object store implementation.- Returns:
-
-