Interface NestedDirectoryBackend

    • Method Detail

      • withReadAccess

        default <T> T withReadAccess​(Supplier<T> block)
        Check if the caches need a reset.
        Parameters:
        block - the supplier object executed within the session
        Returns:
        the result of the supplier code block
      • withReadAccess

        default void withReadAccess​(Runnable block)
        Check if the caches need a reset.
        Parameters:
        block - the runnable object executed within the session
      • withWriteAccess

        default <T> T withWriteAccess​(Supplier<T> block)
        Check if the caches need a reset.
        Parameters:
        block - the supplier object executed within the session
        Returns:
        the result of the supplier code block
      • withWriteAccess

        default void withWriteAccess​(Runnable block)
        Check if the caches need a reset.
        Parameters:
        block - the runnable object executed within the session
      • requireReset

        default boolean requireReset()
        Check if the caches need a reset.
        Returns:
        the boolean
      • upsertGroup

        default void upsertGroup​(String id)
        To keep the cache up-to-date a group entity is updated or inserted.
        Parameters:
        id - the group ID
      • upsertAllGroups

        default int upsertAllGroups​(int startIndex,
                                    int maxResults)
        To keep the cache up-to-date all group entities are updated or inserted.
        Parameters:
        startIndex - the start index for pagination
        maxResults - the maximum number of results for pagination
        Returns:
        the number of handled entities
      • upsertAllGroups

        default int upsertAllGroups()
        To keep the cache up-to-date all group entities are updated or inserted.
        Returns:
        the number of handled entities
      • upsertUser

        default void upsertUser​(String id)
        To keep the cache up-to-date an user entity is updated or inserted.
        Parameters:
        id - the user ID
      • upsertUser

        default void upsertUser​(String id,
                                String idOther)
        To keep the cache up-to-date an user entity is updated or inserted. The user inherits the groups of another user
        Parameters:
        id - the user ID
        idOther - the user ID of an existing user
      • upsertAllUsers

        default int upsertAllUsers​(int startIndex,
                                   int maxResults)
        To keep the cache up-to-date all user entities are updated or inserted.
        Parameters:
        startIndex - the start index for pagination
        maxResults - the maximum number of results for pagination
        Returns:
        the number of handled entities
      • upsertAllUsers

        default int upsertAllUsers()
        To keep the cache up-to-date all user entities are updated or inserted.
        Returns:
        the number of handled entities
      • upsertMembership

        default void upsertMembership​(MembershipEntity membership)
        To keep the cache up-to-date a membership entity is updated or inserted.
        Parameters:
        membership - the membership entity
      • dropGroup

        default void dropGroup​(String id)
        To keep the cache up-to-date a group entity is dropped.
        Parameters:
        id - the group ID
      • dropAllGroups

        default void dropAllGroups()
        To reset the cache all group entities are dropped.
      • dropUser

        default void dropUser​(String id)
        To keep the cache up-to-date an user entity is dropped.
        Parameters:
        id - the user ID
      • dropAllUsers

        default void dropAllUsers()
        To reset the cache all user entities are dropped.
      • dropMembership

        default void dropMembership​(MembershipEntity membership)
        To keep the cache up-to-date a membership entity is dropped.
        Parameters:
        membership - the membership entity
      • getMemberships

        MappableCursor<MembershipEntity> getMemberships()
        Returns a cursor for membership entities.
        Returns:
        the cursor with membership elements
      • acquireDbLock

        default boolean acquireDbLock​(int lockId)
        try to acquire a databaselock
        Returns:
        the boolean
      • releaseDbLock

        default void releaseDbLock​(int lockId)
        releases a databaselock