Class InternalOMRSEventProcessingContext
- java.lang.Object
-
- org.odpi.openmetadata.repositoryservices.connectors.omrstopic.InternalOMRSEventProcessingContext
-
public class InternalOMRSEventProcessingContext extends Object
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 Constructor Description InternalOMRSEventProcessingContext()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAsyncProcessingResult(Future<?> future)Registers aFutureassociated with asynchronous message processing.voidaddAsyncProcessingResult(OMRSFuture future)Registers anOMRSFutureassociated with asynchronous message processing.static voidclear()Clears theInternalOMRSEventProcessingContextfor the current thread.StringgetCurrentMessageId()Gets the unique identifier for the current message that is being processed.static InternalOMRSEventProcessingContextgetInstance()Gets the thread-localInternalOMRSEventProcessingContextinstance for the current thread.OMRSFuturegetOverallAsyncProcessingResult()Gets the overall asynchronous processing result from all consumers.voidsetCurrentMessageId(String messageId)Sets the unique identifier for the current message that is being processed.
-
-
-
Method Detail
-
addAsyncProcessingResult
public void addAsyncProcessingResult(Future<?> future)
Registers aFutureassociated with asynchronous message processing.- Parameters:
future- registered object
-
addAsyncProcessingResult
public void addAsyncProcessingResult(OMRSFuture future)
Registers anOMRSFutureassociated with asynchronous message processing.- Parameters:
future- registered object
-
getOverallAsyncProcessingResult
public OMRSFuture 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
public static InternalOMRSEventProcessingContext 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
public String getCurrentMessageId()
Gets the unique identifier for the current message that is being processed.- Returns:
- the current message id
-
setCurrentMessageId
public void setCurrentMessageId(String messageId)
Sets the unique identifier for the current message that is being processed.- Parameters:
messageId- The messageId to set
-
-