Class MPCManagerXML

java.lang.Object
com.helger.dao.AbstractDAO
com.helger.dao.wal.AbstractWALDAO<MPC>
com.helger.dao.wal.AbstractMapBasedWALDAO<IMPC,MPC>
com.helger.photon.io.dao.AbstractPhotonMapBasedWALDAO<IMPC,MPC>
com.helger.phase4.model.mpc.MPCManagerXML
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<IMPC>, IMPCManager

@ThreadSafe public class MPCManagerXML extends com.helger.photon.io.dao.AbstractPhotonMapBasedWALDAO<IMPC,MPC> implements IMPCManager
Manager for MPC objects.
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
    MPCManagerXML(String sFilename)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    createMPC(MPC aMPC)
    Create a new MPC.
    com.helger.commons.state.EChange
    deleteMPC(String sMPCID)
    Delete the MPC with the provided ID.
    Get the MPC with the specified ID.
    com.helger.commons.state.EChange
    Mark the MPC with the provided ID as deleted.
    protected com.helger.commons.state.EChange
     
    com.helger.commons.state.EChange
    Update an existing MPC

    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, 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.dao.IAutoSaveAware

    performWithoutAutoSave, performWithoutAutoSave, performWithoutAutoSaveThrowing, performWithoutAutoSaveThrowing

    Methods inherited from interface com.helger.phase4.model.mpc.IMPCManager

    containsWithID, getMPCOrDefaultOfID
  • Constructor Details

    • MPCManagerXML

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

    • onInit

      @Nonnull protected com.helger.commons.state.EChange onInit()
      Overrides:
      onInit in class com.helger.dao.wal.AbstractWALDAO<MPC>
    • createMPC

      public void createMPC(@Nonnull MPC aMPC)
      Description copied from interface: IMPCManager
      Create a new MPC.
      Specified by:
      createMPC in interface IMPCManager
      Parameters:
      aMPC - The MPC to be added. May not be null.
    • updateMPC

      @Nonnull public com.helger.commons.state.EChange updateMPC(@Nonnull IMPC aMPC)
      Description copied from interface: IMPCManager
      Update an existing MPC
      Specified by:
      updateMPC in interface IMPCManager
      Parameters:
      aMPC - The MPC to be updated. May not be null.
      Returns:
      EChange.CHANGED if something changed, EChange.UNCHANGED otherwise.
    • markMPCDeleted

      @Nonnull public com.helger.commons.state.EChange markMPCDeleted(@Nullable String sMPCID)
      Description copied from interface: IMPCManager
      Mark the MPC with the provided ID as deleted.
      Specified by:
      markMPCDeleted in interface IMPCManager
      Parameters:
      sMPCID - The ID of the MPC to be marked as deleted. May be null.
      Returns:
      EChange.CHANGED if marking as deleted succeeded, EChange.UNCHANGED otherwise.
    • deleteMPC

      @Nonnull public com.helger.commons.state.EChange deleteMPC(@Nullable String sMPCID)
      Description copied from interface: IMPCManager
      Delete the MPC with the provided ID.
      Specified by:
      deleteMPC in interface IMPCManager
      Parameters:
      sMPCID - The ID of the MPC to be deleted. May be null.
      Returns:
      EChange.CHANGED if deleting succeeded, EChange.UNCHANGED otherwise.
    • getMPCOfID

      @Nullable public IMPC getMPCOfID(@Nullable String sID)
      Description copied from interface: IMPCManager
      Get the MPC with the specified ID.
      Specified by:
      getMPCOfID in interface IMPCManager
      Parameters:
      sID - The ID to search. May be null.
      Returns:
      null if no such MPC exists, the MPC otherwise.