/** * Called when a recovery is needed to create a new item. * * @param aElement * The element to be created. Never <code>null</code>. */ @IsLocked (ELockType.WRITE) protected abstract void onRecoveryCreate (@Nonnull DATATYPE aElement);
/** * Called when a recovery is needed to update an existing item. * * @param aElement * The element to be updated. Never <code>null</code>. */ @IsLocked (ELockType.WRITE) protected abstract void onRecoveryUpdate (@Nonnull DATATYPE aElement);
/** * Create a new {@link EntityManager} when required. * * @return The created {@link EntityManager}. Never <code>null</code>. */ @Nonnull @IsLocked (ELockType.WRITE) protected abstract EntityManager createEntityManager ();
/** * Called when a recovery is needed to delete an existing item. * * @param aElement * The element to be deleted. Never <code>null</code>. */ @IsLocked (ELockType.WRITE) protected abstract void onRecoveryDelete (@Nonnull DATATYPE aElement);
@Override @IsLocked (ELockType.WRITE) protected void onRecoveryUpdate (@Nonnull final AuditItem aElement) { throw new UnsupportedOperationException (); }
@Override @IsLocked (ELockType.WRITE) protected void onRecoveryDelete (@Nonnull final AuditItem aElement) { throw new UnsupportedOperationException (); }
/** * Callback method that is invoked, when this object is modified. This method * must be overridden to do something useful. A use case scenario could e.g. * be automatic storage of changes. * * @throws OpenAS2Exception * In case anything goes wrong */ @OverrideOnDemand @IsLocked (ELockType.WRITE) protected void markAsChanged () throws OpenAS2Exception {}
@Override @IsLocked (ELockType.WRITE) protected void onRecoveryCreate (@Nonnull final AuditItem aItem) { m_aItems.internalAddItem (aItem); }
/** * Called between initial read and WAL handling. * * @param aDoc * The read document. Never <code>null</code> */ @OverrideOnDemand @IsLocked (ELockType.WRITE) protected void onBetweenReadAndWAL (@Nonnull final IMicroDocument aDoc) {}
@Override @IsLocked (ELockType.READ) public final boolean isNotEmpty () { return m_aRWLock.readLocked (m_aMap::isNotEmpty); }
@IsLocked (ELockType.READ) public final boolean isEmpty () { return m_aRWLock.readLocked (m_aMap::isEmpty); }
@IsLocked (ELockType.READ) protected final void internalForEachValue (@Nullable final Predicate <? super IMPLTYPE> aFilter, @Nullable final Consumer <? super IMPLTYPE> aConsumer) { m_aRWLock.readLocked ( () -> m_aMap.forEachValue (aFilter, aConsumer)); }
@IsLocked (ELockType.READ) public final void forEachValue (@Nullable final Predicate <? super INTERFACETYPE> aFilter, @Nullable final Consumer <? super INTERFACETYPE> aConsumer) { m_aRWLock.readLocked ( () -> m_aMap.forEachValue (aFilter, aConsumer)); }
@IsLocked (ELockType.READ) public final void forEachKey (@Nullable final Predicate <? super String> aFilter, @Nullable final Consumer <? super String> aConsumer) { m_aRWLock.readLocked ( () -> m_aMap.forEachKey (aFilter, aConsumer)); }
@IsLocked (ELockType.READ) public final void forEachValue (@Nullable final Consumer <? super INTERFACETYPE> aConsumer) { m_aRWLock.readLocked ( () -> m_aMap.forEachValue (aConsumer)); }
@IsLocked (ELockType.READ) public final void forEachKey (@Nullable final Consumer <? super String> aConsumer) { m_aRWLock.readLocked ( () -> m_aMap.forEachKey (aConsumer)); }
@IsLocked (ELockType.READ) public final void forEach (@Nullable final BiPredicate <? super String, ? super INTERFACETYPE> aFilter, @Nullable final BiConsumer <? super String, ? super INTERFACETYPE> aConsumer) { m_aRWLock.readLocked ( () -> m_aMap.forEach (aFilter, aConsumer)); }
@IsLocked (ELockType.READ) public final void forEach (@Nullable final BiConsumer <? super String, ? super INTERFACETYPE> aConsumer) { m_aRWLock.readLocked ( () -> m_aMap.forEach (aConsumer)); }
@IsLocked (ELockType.READ) protected final void internalForEachValue (@Nullable final Consumer <? super IMPLTYPE> aConsumer) { m_aRWLock.readLocked ( () -> m_aMap.forEachValue (aConsumer)); }
@Nonnull @ReturnsMutableCopy @IsLocked (ELockType.READ) protected final Iterable <IMPLTYPE> internalDirectGetAll () { return m_aRWLock.readLocked (m_aMap::values); }