Class PModeManager

java.lang.Object
com.helger.dao.AbstractDAO
com.helger.dao.wal.AbstractWALDAO<IMPLTYPE>
com.helger.dao.wal.AbstractMapBasedWALDAO<INTERFACETYPE,IMPLTYPE>
com.helger.photon.io.dao.AbstractPhotonMapBasedWALDAO<IPMode,PMode>
com.helger.phase4.model.pmode.PModeManager
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<IPMode>, IPModeManager

@ThreadSafe public class PModeManager extends com.helger.photon.io.dao.AbstractPhotonMapBasedWALDAO<IPMode,PMode> implements IPModeManager
Persisting manager for PMode 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 extends Object>

    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
    PModeManager(String sFilename)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Create or update the provided PMode.
    void
    Create a new PMode.
    com.helger.commons.state.EChange
    deletePMode(String sPModeID)
    Delete the provided PMode.
    Find the PMode with the provided ID
    com.helger.commons.state.EChange
    Mark the provided PMode as deleted.
    com.helger.commons.state.EChange
    Update an existing PMode.

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

    performWithoutAutoSave, performWithoutAutoSave, performWithoutAutoSaveThrowing, performWithoutAutoSaveThrowing

    Methods inherited from interface com.helger.phase4.model.pmode.IPModeManager

    findFirst, getAll, getAllIDs, getPModeOfServiceAndAction, validateAllPModes, validatePMode
  • Constructor Details

    • PModeManager

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

    • createPMode

      public void createPMode(@Nonnull PMode aPMode)
      Description copied from interface: IPModeManager
      Create a new PMode.
      Specified by:
      createPMode in interface IPModeManager
      Parameters:
      aPMode - The PMode to be created. May not be null.
    • updatePMode

      @Nonnull public com.helger.commons.state.EChange updatePMode(@Nonnull IPMode aPMode)
      Description copied from interface: IPModeManager
      Update an existing PMode.
      Specified by:
      updatePMode in interface IPModeManager
      Parameters:
      aPMode - The PMode to be updated. May not be null.
      Returns:
      EChange.CHANGED if something changed, EChange.UNCHANGED otherwise.
    • createOrUpdatePMode

      public void createOrUpdatePMode(@Nonnull PMode aPMode)
      Description copied from interface: IPModeManager
      Create or update the provided PMode.
      Specified by:
      createOrUpdatePMode in interface IPModeManager
      Parameters:
      aPMode - The PMode to be created or updated.
    • markPModeDeleted

      @Nonnull public com.helger.commons.state.EChange markPModeDeleted(@Nullable String sPModeID)
      Description copied from interface: IPModeManager
      Mark the provided PMode as deleted.
      Specified by:
      markPModeDeleted in interface IPModeManager
      Parameters:
      sPModeID - The ID of the PMode to be marked as deleted. May be null.
      Returns:
      EChange
    • deletePMode

      @Nonnull public com.helger.commons.state.EChange deletePMode(@Nullable String sPModeID)
      Description copied from interface: IPModeManager
      Delete the provided PMode.
      Specified by:
      deletePMode in interface IPModeManager
      Parameters:
      sPModeID - The ID of the PMode to be deleted. May be null.
      Returns:
      EChange
    • getPModeOfID

      @Nullable public IPMode getPModeOfID(@Nullable String sID)
      Description copied from interface: IPModeManager
      Find the PMode with the provided ID
      Specified by:
      getPModeOfID in interface IPModeManager
      Parameters:
      sID - The ID to search. May be null.
      Returns:
      null if no such PMode exists.