Class InternalOMRSEventProcessingContext
java.lang.Object
org.odpi.openmetadata.repositoryservices.connectors.omrstopic.InternalOMRSEventProcessingContext
Internal Asynchronous message processing context. This class allows egeria to be notified when a message is being
processed asynchronously so that the consumer can correctly record when the message has been
completely processed. This class is not considered part of the Egeria public
API and may change without notice.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAsyncProcessingResult(Future<?> future) Registers aFutureassociated with asynchronous message processing.voidaddAsyncProcessingResult(OMRSFuture future) Registers anOMRSFutureassociated with asynchronous message processing.static voidclear()Clears theInternalOMRSEventProcessingContextfor the current thread.Gets the unique identifier for the current message that is being processed.Gets the thread-localInternalOMRSEventProcessingContextinstance for the current thread.Gets the overall asynchronous processing result from all consumers.voidsetCurrentMessageId(String messageId) Sets the unique identifier for the current message that is being processed.
-
Constructor Details
-
InternalOMRSEventProcessingContext
public InternalOMRSEventProcessingContext()
-
-
Method Details
-
addAsyncProcessingResult
Registers aFutureassociated with asynchronous message processing.- Parameters:
future- registered object
-
addAsyncProcessingResult
Registers anOMRSFutureassociated with asynchronous message processing.- Parameters:
future- registered object
-
getOverallAsyncProcessingResult
Gets the overall asynchronous processing result from all consumers. This method is guaranteed to return a non-null result. If there is no asynchronous processing happening, an instance ofCompletedFuturewill be returned, indicating that asynchronous processing has finished- Returns:
- the overall processing result
-
getInstance
Gets the thread-localInternalOMRSEventProcessingContextinstance for the current thread.- Returns:
- the instance of
InternalOMRSEventProcessingContextfor the current thread
-
clear
public static void clear()Clears theInternalOMRSEventProcessingContextfor the current thread. -
getCurrentMessageId
Gets the unique identifier for the current message that is being processed.- Returns:
- the current message id
-
setCurrentMessageId
Sets the unique identifier for the current message that is being processed.- Parameters:
messageId- The messageId to set
-