Package church.i18n.processing.storage
Class ThreadIndependentStorage
java.lang.Object
church.i18n.processing.storage.ThreadIndependentStorage
- All Implemented Interfaces:
MessageStorage,MessageStorageAppender,StorageMessageProvider
Thread independent storage of processing messages.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMessages(@NotNull ProcessingMessage... messages) Add messages into message storage.voidaddMessages(@NotNull String processingId, @NotNull ProcessingMessage... messages) Add messages into the thread independent storage.voidaddMessages(@NotNull String processingId, @NotNull List<ProcessingMessage> messages) Add messages into the thread independent storage.voidaddMessages(@NotNull List<ProcessingMessage> messages) Add messages into the thread independent storage.voidClear message from the storage.voidclearStorage(@NotNull String processingId) Clear message from the storage associated withprocessingId.@NotNull List<ProcessingMessage> get()Retrieve all messages from the message storage without clearing them.@NotNull List<ProcessingMessage> Retrieve all messages from the message storage without clearing them.@NotNull List<ProcessingMessage> Retrieve all messages from storage and clear messages associated with theprocessingId.@NotNull List<ProcessingMessage> getAndClear(@NotNull String processingId) Retrieve all messages from storage and clear messages associated with theprocessingId.toString()
-
Constructor Details
-
ThreadIndependentStorage
-
-
Method Details
-
addMessages
Description copied from interface:MessageStorageAdd messages into message storage.- Specified by:
addMessagesin interfaceMessageStorage- Parameters:
messages- Messages to append.
-
addMessages
Description copied from interface:MessageStorageAdd messages into the thread independent storage.- Specified by:
addMessagesin interfaceMessageStorage- Parameters:
messages- Messages to append.
-
clearStorage
public void clearStorage()Description copied from interface:MessageStorageClear message from the storage.- Specified by:
clearStoragein interfaceMessageStorage
-
get
Description copied from interface:MessageStorageRetrieve all messages from the message storage without clearing them.- Specified by:
getin interfaceMessageStorage- Returns:
- List of messages in a storage.
-
getAndClear
Description copied from interface:MessageStorageRetrieve all messages from storage and clear messages associated with theprocessingId.- Specified by:
getAndClearin interfaceMessageStorage- Returns:
- List of messages in a storage.
-
addMessages
public void addMessages(@NotNull @NotNull String processingId, @NotNull @NotNull ProcessingMessage... messages) Description copied from interface:MessageStorageAppenderAdd messages into the thread independent storage.- Specified by:
addMessagesin interfaceMessageStorageAppender- Parameters:
processingId- Processing identifier, to associate messages with.messages- Messages to append.
-
addMessages
public void addMessages(@NotNull @NotNull String processingId, @NotNull @NotNull List<ProcessingMessage> messages) Description copied from interface:MessageStorageAppenderAdd messages into the thread independent storage.- Specified by:
addMessagesin interfaceMessageStorageAppender- Parameters:
processingId- Processing identifier, to associate messages with.messages- Messages to append.
-
clearStorage
Description copied from interface:StorageMessageProviderClear message from the storage associated withprocessingId.- Specified by:
clearStoragein interfaceStorageMessageProvider- Parameters:
processingId- Identifier of messages associated with.
-
get
Description copied from interface:StorageMessageProviderRetrieve all messages from the message storage without clearing them.- Specified by:
getin interfaceStorageMessageProvider- Parameters:
processingId- Identifier of messages associated with.- Returns:
- List of messages associated with the
processingId.
-
getAndClear
Description copied from interface:StorageMessageProviderRetrieve all messages from storage and clear messages associated with theprocessingId.- Specified by:
getAndClearin interfaceStorageMessageProvider- Parameters:
processingId- Identifier of messages associated with.- Returns:
- List of messages associated with
processingId.
-
toString
-