Package com.helger.phase4.duplicate
Class AS4DuplicateManagerInMemory
java.lang.Object
com.helger.phase4.duplicate.AS4DuplicateManagerInMemory
- All Implemented Interfaces:
IAS4DuplicateManager
This is the duplicate checker for avoiding duplicate messages.
- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.helger.commons.state.EChangeRemove all entries in the cache.com.helger.commons.collection.impl.ICommonsList<String>evictAllItemsBefore(OffsetDateTime aRefDT) Delete all duplicate items that were created before the provided time.findFirst(Predicate<? super IAS4DuplicateItem> aFilter) com.helger.commons.collection.impl.ICommonsList<IAS4DuplicateItem>getAll()getItemOfMessageID(String sMessageID) Find the first item with the provided message ID.booleanisEmpty()com.helger.commons.state.EContinueregisterAndCheck(String sMessageID, String sProfileID, String sPModeID) Check if the passed message ID was already handled.intsize()
-
Constructor Details
-
AS4DuplicateManagerInMemory
public AS4DuplicateManagerInMemory()
-
-
Method Details
-
registerAndCheck
@Nonnull public com.helger.commons.state.EContinue registerAndCheck(@Nullable String sMessageID, @Nullable String sProfileID, @Nullable String sPModeID) Description copied from interface:IAS4DuplicateManagerCheck if the passed message ID was already handled.- Specified by:
registerAndCheckin interfaceIAS4DuplicateManager- Parameters:
sMessageID- Message ID to check. May benull.sProfileID- Active AS4 profile ID. May be used to define the PMode further. May benull.sPModeID- Active AS4 PMode ID. May benull.- Returns:
EContinue.CONTINUEto continue processing a message, because it is no duplicate.EContinue.BREAKif it was determined as a duplicate.
-
clearCache
Description copied from interface:IAS4DuplicateManagerRemove all entries in the cache.- Specified by:
clearCachein interfaceIAS4DuplicateManager- Returns:
EChange
-
evictAllItemsBefore
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<String> evictAllItemsBefore(@Nonnull OffsetDateTime aRefDT) Description copied from interface:IAS4DuplicateManagerDelete all duplicate items that were created before the provided time.- Specified by:
evictAllItemsBeforein interfaceIAS4DuplicateManager- Parameters:
aRefDT- The reference date time to compare to. May not benull.- Returns:
- A non-
nulllist of all evicted message IDs.
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceIAS4DuplicateManager- Returns:
trueif there are no entries contained,falseotherwise.
-
size
- Specified by:
sizein interfaceIAS4DuplicateManager- Returns:
- The number contained entries. Always ≥ 0.
-
findFirst
-
getItemOfMessageID
Description copied from interface:IAS4DuplicateManagerFind the first item with the provided message ID.- Specified by:
getItemOfMessageIDin interfaceIAS4DuplicateManager- Parameters:
sMessageID- The message ID to be searched. May benull.- Returns:
nullif no matching entry is contained.
-
getAll
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<IAS4DuplicateItem> getAll()- Specified by:
getAllin interfaceIAS4DuplicateManager- Returns:
- All entries contained in the list.
-