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 TypeMethodDescription@NonNull com.helger.base.state.EChangeRemove all entries in the cache.@NonNull com.helger.collection.commons.ICommonsList<String> evictAllItemsBefore(@NonNull OffsetDateTime aRefDT) Delete all duplicate items that were created before the provided time.@Nullable IAS4DuplicateItemfindFirst(@NonNull Predicate<? super IAS4DuplicateItem> aFilter) @NonNull com.helger.collection.commons.ICommonsList<IAS4DuplicateItem> getAll()@Nullable IAS4DuplicateItemgetItemOfMessageID(@Nullable String sMessageID) Find the first item with the provided message ID.booleanisEmpty()@NonNull com.helger.base.state.EContinueregisterAndCheck(@Nullable String sMessageID, @Nullable String sProfileID, @Nullable String sPModeID) Check if the passed message ID was already handled.intsize()toString()
-
Constructor Details
-
AS4DuplicateManagerInMemory
public AS4DuplicateManagerInMemory()
-
-
Method Details
-
registerAndCheck
public @NonNull com.helger.base.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
public @NonNull com.helger.base.state.EChange clearCache()Description copied from interface:IAS4DuplicateManagerRemove all entries in the cache.- Specified by:
clearCachein interfaceIAS4DuplicateManager- Returns:
EChange
-
evictAllItemsBefore
@ReturnsMutableCopy public @NonNull com.helger.collection.commons.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
@Nonnegative public int 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
@ReturnsMutableCopy public @NonNull com.helger.collection.commons.ICommonsList<IAS4DuplicateItem> getAll()- Specified by:
getAllin interfaceIAS4DuplicateManager- Returns:
- All entries contained in the list.
-
toString
-