Interface CuratorCacheStorage

    • Method Detail

      • standard

        static CuratorCacheStorage standard()
        Return a new standard storage instance
        Returns:
        storage instance
      • dataNotCached

        static CuratorCacheStorage dataNotCached()
        Return a new storage instance that does not retain the data bytes. i.e. ChildData objects returned by this storage will always return null for ChildData.getData().
        Returns:
        storage instance that does not retain data bytes
      • put

        java.util.Optional<ChildData> put​(ChildData data)
        Add an entry to storage and return any previous entry at that path
        Parameters:
        data - entry to add
        Returns:
        previous entry or empty()
      • remove

        java.util.Optional<ChildData> remove​(java.lang.String path)
        Remove the entry from storage and return any previous entry at that path
        Parameters:
        path - path to remove
        Returns:
        previous entry or empty()
      • clear

        void clear()
        Reset the storage to zero entries
      • get

        java.util.Optional<ChildData> get​(java.lang.String path)
        Return an entry from storage
        Specified by:
        get in interface CuratorCacheAccessor
        Parameters:
        path - path to get
        Returns:
        entry or empty()
      • size

        int size()
        Return the current number of entries in storage
        Specified by:
        size in interface CuratorCacheAccessor
        Returns:
        number of entries
      • stream

        java.util.stream.Stream<ChildData> stream()
        Return a stream over the storage entries. Note: for a standard storage instance, the stream behaves like a stream returned by ConcurrentHashMap.entrySet()
        Specified by:
        stream in interface CuratorCacheAccessor
        Returns:
        stream over entries