Class DefaultDynamicBackingStore<I,​T>

    • Constructor Detail

      • DefaultDynamicBackingStore

        public DefaultDynamicBackingStore()
        Constructor.
    • Method Detail

      • computeManagementDataIfAbsent

        public MetadataManagementData<I> computeManagementDataIfAbsent​(@Nonnull
                                                                       I identifier,
                                                                       @Nonnull
                                                                       Function<I,​MetadataManagementData<I>> mappingFunction)
        Description copied from interface: DynamicBackingStore
        Get the management data for the specified identifier. If the management data does not exist it should be created using the supplied mapping function.

        Management data facilitates per-entity metadata locking and cache primitives e.g. next refresh time.

        Should do so in a thread-safe way e.g. if two threads enter this method, only one should be allowed to create management data for the same identifier.

        Specified by:
        computeManagementDataIfAbsent in interface DynamicBackingStore<I,​T>
        Parameters:
        identifier - the identifier of the entity to find management data about
        mappingFunction - the function used to create a new MetadataManagementData instance if none exist.
        Returns:
        a new or previously cache metadata management data.
      • getManagementData

        public MetadataManagementData<I> getManagementData​(@Nonnull
                                                           I identifier)
        Description copied from interface: DynamicBackingStore
        Get the management data for the specified identifier. If the management data does not exist, null is returned.
        Specified by:
        getManagementData in interface DynamicBackingStore<I,​T>
        Parameters:
        identifier - the identifier of the entity to find management data about
        Returns:
        the corresponding management data, or null if not found.
      • removeManagementData

        public void removeManagementData​(@Nonnull
                                         I identifier)
        Description copied from interface: DynamicBackingStore
        Remove the management data for the specified entityID.
        Specified by:
        removeManagementData in interface DynamicBackingStore<I,​T>
        Parameters:
        identifier - the input identifier