/** * @return <code>true</code> if auto save is enabled, <code>false</code> * otherwise. */ @MustBeLocked (ELockType.READ) protected final boolean internalIsAutoSaveEnabled () { return m_bAutoSaveEnabled; }
/** * @return <code>true</code> if unsaved changes are present */ @MustBeLocked (ELockType.READ) public final boolean internalHasPendingChanges () { return m_bPendingChanges; }
@MustBeLocked (ELockType.WRITE) public final void internalSetPendingChanges (final boolean bPendingChanges) { m_bPendingChanges = bPendingChanges; }
/** * Create the XML document that should be saved to the file. This method is * only called within a write lock! * * @return The non-<code>null</code> document to write to the file. */ @Nonnull @MustBeLocked (ELockType.WRITE) protected abstract IMicroDocument createWriteData ();
/** * Create the XML document that should be saved to the file. This method is * only called within a write lock! * * @return The non-<code>null</code> document to write to the file. */ @Nonnull @MustBeLocked (ELockType.WRITE) protected abstract IMicroDocument createWriteData ();
/** * Fill the internal structures with from the passed XML document. This method * is only called within a write lock! * * @param aDoc * The XML document to read from. Never <code>null</code>. * @return {@link EChange#CHANGED} if reading the data changed something in * the internal structures that requires a writing. */ @Nonnull @MustBeLocked (ELockType.WRITE) protected abstract EChange onRead (@Nonnull IMicroDocument aDoc);
/** * Fill the internal structures with from the passed XML document. This method * is only called within a write lock! * * @param aDoc * The XML document to read from. Never <code>null</code>. * @return {@link EChange#CHANGED} if reading the data changed something in * the internal structures that requires a writing. */ @Nonnull @MustBeLocked (ELockType.WRITE) protected abstract EChange onRead (@Nonnull IMicroDocument aDoc);
@Nonnegative @MustBeLocked (ELockType.READ) protected int internalGetFailedMailCount () { return m_aMap.size (); }
@Nullable @MustBeLocked (ELockType.READ) protected FailedMailData internalGetFailedMailOfID (@Nullable final String sID) { return m_aMap.get (sID); }
/** * Mark as changed - just to make markAsChanged accessible */ @MustBeLocked (ELockType.WRITE) protected void myMarkChanged () { super.markAsChanged (); }
/** * Called after a successful write of the file, if the filename is different * from the previous filename. This can e.g. be used to clear old data. * * @param sPreviousFilename * The previous filename. May be <code>null</code>. * @param sNewFilename * The new filename. Never <code>null</code>. */ @OverrideOnDemand @MustBeLocked (ELockType.WRITE) protected void onFilenameChange (@Nullable final String sPreviousFilename, @Nonnull final String sNewFilename) {}
/** * Mark an item as "no longer deleted" without actually adding it to the map. * This method only triggers the update action but does not alter the item. * Must only be invoked inside a write-lock. * * @param aItem * The item that was marked as "no longer deleted" */ @MustBeLocked (ELockType.WRITE) protected final void internalMarkItemUndeleted (@Nonnull final IMPLTYPE aItem) { internalMarkItemUndeleted (aItem, true); }
/** * Initial read - just to make initialRead accessible * * @throws DAOException * In case of error */ @MustBeLocked (ELockType.WRITE) protected void myInitialRead () throws DAOException { initialRead (); }
@Nonnegative @MustBeLocked (ELockType.READ) protected int internalSize () { return m_aMap.size (); }
@Override @MustBeLocked (ELockType.WRITE) protected void onRecoveryCreate (@Nonnull final IMPLTYPE aItem) { _addItem (aItem, EDAOActionType.CREATE); }
@Override @MustBeLocked (ELockType.WRITE) protected void onRecoveryUpdate (@Nonnull final IMPLTYPE aItem) { _addItem (aItem, EDAOActionType.UPDATE); }
/** * Mark an item as "deleted" without actually deleting it from the map. This * method only triggers the update action but does not alter the item. Must * only be invoked inside a write-lock. * * @param aItem * The item that was marked as "deleted" */ @MustBeLocked (ELockType.WRITE) protected final void internalMarkItemDeleted (@Nonnull final IMPLTYPE aItem) { internalMarkItemDeleted (aItem, true); }
/** * Called after a successful write of the file, if the filename is different * from the previous filename. This can e.g. be used to clear old data. * * @param sPreviousFilename * The previous filename. May be <code>null</code>. * @param sNewFilename * The new filename. Never <code>null</code>. */ @OverrideOnDemand @MustBeLocked (ELockType.WRITE) protected void onFilenameChange (@Nullable final String sPreviousFilename, @Nonnull final String sNewFilename) {}
/** * Update an existing item including invoking the callback. Must only be * invoked inside a write-lock. * * @param aItem * The item to be updated. May not be <code>null</code>. * @throws IllegalArgumentException * If no item with the same ID is already contained */ @MustBeLocked (ELockType.WRITE) protected final void internalUpdateItem (@Nonnull final IMPLTYPE aItem) { internalUpdateItem (aItem, true); }
/** * Remove all items without triggering any callback. Must only be invoked * inside a write-lock. * * @return {@link EChange#CHANGED} if something was contained, * {@link EChange#UNCHANGED} otherwise. */ @MustBeLocked (ELockType.WRITE) @Nonnull protected final EChange internalRemoveAllItemsNoCallback () { return m_aMap.removeAll (); }