Class AS4DuplicateManagerXML

java.lang.Object
com.helger.dao.AbstractDAO
com.helger.dao.wal.AbstractWALDAO<AS4DuplicateItem>
com.helger.dao.wal.AbstractMapBasedWALDAO<IAS4DuplicateItem,AS4DuplicateItem>
com.helger.photon.io.dao.AbstractPhotonMapBasedWALDAO<IAS4DuplicateItem,AS4DuplicateItem>
com.helger.phase4.duplicate.AS4DuplicateManagerXML
All Implemented Interfaces:
com.helger.commons.lang.IHasSize, com.helger.commons.log.IHasConditionalLogger, com.helger.dao.IAutoSaveAware, com.helger.dao.IDAO, com.helger.dao.wal.IMapBasedDAO<IAS4DuplicateItem>, IAS4DuplicateManager

@ThreadSafe public class AS4DuplicateManagerXML extends com.helger.photon.io.dao.AbstractPhotonMapBasedWALDAO<IAS4DuplicateItem,AS4DuplicateItem> implements IAS4DuplicateManager
This is the duplicate checker for avoiding duplicate messages.
Author:
Philip Helger
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.helger.dao.wal.AbstractMapBasedWALDAO

    com.helger.dao.wal.AbstractMapBasedWALDAO.InitSettings<IMPLTYPE>

    Nested classes/interfaces inherited from interface com.helger.dao.IDAO

    com.helger.dao.IDAO.EMode
  • Field Summary

    Fields inherited from class com.helger.dao.wal.AbstractMapBasedWALDAO

    ELEMENT_ITEM, ELEMENT_ROOT

    Fields inherited from class com.helger.dao.wal.AbstractWALDAO

    DEFAULT_WAITING_TIME, WAL_XWS, WRITE_XWS

    Fields inherited from class com.helger.dao.AbstractDAO

    CONDLOG, DEFAULT_AUTO_SAVE_ENABLED, FILENAME_EXTENSION_NEW, FILENAME_EXTENSION_PREV, m_aRWLock, RW_LOCK
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.helger.commons.state.EChange
    Remove all entries in the cache.
    com.helger.commons.collection.impl.ICommonsList<String>
    Delete all duplicate items that were created before the provided time.
    Find the first item with the provided message ID.
    com.helger.commons.state.EContinue
    registerAndCheck(String sMessageID, String sProfileID, String sPModeID)
    Check if the passed message ID was already handled.

    Methods inherited from class com.helger.photon.io.dao.AbstractPhotonMapBasedWALDAO

    isReloadable, reload

    Methods inherited from class com.helger.dao.wal.AbstractMapBasedWALDAO

    callbacks, containsAllIDs, containsAny, containsNone, containsOnly, containsWithID, createWriteData, findAll, findAllMapped, findFirst, findFirstMapped, forEach, forEach, forEachKey, forEachKey, forEachValue, forEachValue, getAll, getAll, getAllIDs, getAllMapped, getAtIndex, getCount, getNone, getOfID, internalContainsWithID, internalCreateItem, internalCreateItem, internalDeleteItem, internalDeleteItem, internalDirectGetAll, internalForEachValue, internalForEachValue, internalGetAll, internalGetAllSortedByKey, internalGetOfID, internalMarkItemDeleted, internalMarkItemDeleted, internalMarkItemUndeleted, internalMarkItemUndeleted, internalRemoveAllItemsNoCallback, internalUpdateItem, internalUpdateItem, isEmpty, isNotEmpty, markAsChanged, onRead, onRecoveryCreate, onRecoveryDelete, onRecoveryUpdate, size, toString

    Methods inherited from class com.helger.dao.wal.AbstractWALDAO

    convertNativeToWALString, convertWALStringToNative, getDataTypeClass, getFilenameProvider, getInitCount, getIO, getLastFilename, getLastInitDateTime, getLastReadDateTime, getLastWriteDateTime, getReadCount, getSafeFile, getWaitingTime, getWALXMLWriterSettings, getWriteCount, getXMLWriterSettings, initialRead, markAsChanged, modifyWriteData, onBetweenReadAndWAL, onFilenameChange, onInit, onRecoveryErrorConvertToNative, setWaitingTime, triggerExceptionHandlersRead, triggerExceptionHandlersWrite, writeToFileOnPendingChanges

    Methods inherited from class com.helger.dao.AbstractDAO

    beginWithoutAutoSave, checkFileAccess, endWithoutAutoSave, exceptionHandlersRead, exceptionHandlersWrite, hasPendingChanges, internalHasPendingChanges, internalIsAutoSaveEnabled, internalSetPendingChanges, isAutoSaveEnabled, isSilentMode, setSilentMode

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.helger.phase4.duplicate.IAS4DuplicateManager

    getAll, isEmpty, size

    Methods inherited from interface com.helger.dao.IAutoSaveAware

    performWithoutAutoSave, performWithoutAutoSave, performWithoutAutoSaveThrowing, performWithoutAutoSaveThrowing
  • Constructor Details

    • AS4DuplicateManagerXML

      public AS4DuplicateManagerXML(@Nullable String sFilename) throws com.helger.dao.DAOException
      Throws:
      com.helger.dao.DAOException
  • Method Details

    • registerAndCheck

      @Nonnull public com.helger.commons.state.EContinue registerAndCheck(@Nullable String sMessageID, @Nullable String sProfileID, @Nullable String sPModeID)
      Description copied from interface: IAS4DuplicateManager
      Check if the passed message ID was already handled.
      Specified by:
      registerAndCheck in interface IAS4DuplicateManager
      Parameters:
      sMessageID - Message ID to check. May be null.
      sProfileID - Active AS4 profile ID. May be used to define the PMode further. May be null.
      sPModeID - Active AS4 PMode ID. May be null.
      Returns:
      EContinue.CONTINUE to continue processing a message, because it is no duplicate. EContinue.BREAK if it was determined as a duplicate.
    • clearCache

      @Nonnull public com.helger.commons.state.EChange clearCache()
      Description copied from interface: IAS4DuplicateManager
      Remove all entries in the cache.
      Specified by:
      clearCache in interface IAS4DuplicateManager
      Returns:
      EChange
    • evictAllItemsBefore

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<String> evictAllItemsBefore(@Nonnull OffsetDateTime aRefDT)
      Description copied from interface: IAS4DuplicateManager
      Delete all duplicate items that were created before the provided time.
      Specified by:
      evictAllItemsBefore in interface IAS4DuplicateManager
      Parameters:
      aRefDT - The reference date time to compare to. May not be null.
      Returns:
      A non-null list of all evicted message IDs.
    • getItemOfMessageID

      @Nullable public IAS4DuplicateItem getItemOfMessageID(@Nullable String sMessageID)
      Description copied from interface: IAS4DuplicateManager
      Find the first item with the provided message ID.
      Specified by:
      getItemOfMessageID in interface IAS4DuplicateManager
      Parameters:
      sMessageID - The message ID to be searched. May be null.
      Returns:
      null if no matching entry is contained.