Class AbstractCachedDataManager

java.lang.Object
me.lucko.luckperms.common.cacheddata.AbstractCachedDataManager
All Implemented Interfaces:
net.luckperms.api.cacheddata.CachedDataManager
Direct Known Subclasses:
HolderCachedDataManager

public abstract class AbstractCachedDataManager extends Object implements net.luckperms.api.cacheddata.CachedDataManager
Abstract implementation of CachedDataManager.
  • Constructor Details

    • AbstractCachedDataManager

      protected AbstractCachedDataManager(LuckPermsPlugin plugin)
  • Method Details

    • getPlugin

      public LuckPermsPlugin getPlugin()
    • permissionData

      public @NonNull net.luckperms.api.cacheddata.CachedDataManager.Container<net.luckperms.api.cacheddata.CachedPermissionData> permissionData()
      Specified by:
      permissionData in interface net.luckperms.api.cacheddata.CachedDataManager
    • metaData

      public @NonNull net.luckperms.api.cacheddata.CachedDataManager.Container<net.luckperms.api.cacheddata.CachedMetaData> metaData()
      Specified by:
      metaData in interface net.luckperms.api.cacheddata.CachedDataManager
    • getPermissionData

      public @NonNull PermissionCache getPermissionData(@NonNull net.luckperms.api.query.QueryOptions queryOptions)
      Specified by:
      getPermissionData in interface net.luckperms.api.cacheddata.CachedDataManager
    • getMetaData

      public @NonNull MonitoredMetaCache getMetaData(@NonNull net.luckperms.api.query.QueryOptions queryOptions)
      Specified by:
      getMetaData in interface net.luckperms.api.cacheddata.CachedDataManager
    • getPermissionData

      public @NonNull PermissionCache getPermissionData()
      Specified by:
      getPermissionData in interface net.luckperms.api.cacheddata.CachedDataManager
    • getMetaData

      public @NonNull MonitoredMetaCache getMetaData()
      Specified by:
      getMetaData in interface net.luckperms.api.cacheddata.CachedDataManager
    • getMetadataForQueryOptions

      protected abstract CacheMetadata getMetadataForQueryOptions(net.luckperms.api.query.QueryOptions queryOptions)
      Returns a CacheMetadata instance for the given QueryOptions.
      Parameters:
      queryOptions - the query options the cache is for
      Returns:
      the metadata instance
    • getQueryOptions

      protected abstract net.luckperms.api.query.QueryOptions getQueryOptions()
      Gets the most appropriate active query options instance for the holder.
      Returns:
      the query options
    • getCalculatorFactory

      protected abstract CalculatorFactory getCalculatorFactory()
      Gets the CalculatorFactory used to build PermissionCalculators.
      Returns:
      the calculator factory
    • getDefaultMetaStackDefinition

      protected abstract net.luckperms.api.metastacking.MetaStackDefinition getDefaultMetaStackDefinition(net.luckperms.api.node.ChatMetaType type)
      Gets the default MetaStackDefinition for use if one wasn't specifically provided.
      Parameters:
      type - the type of meta stack
      Returns:
      a meta stack definition instance
    • resolvePermissions

      protected abstract <M extends Map<String, net.luckperms.api.node.Node>> M resolvePermissions(IntFunction<M> mapFactory, net.luckperms.api.query.QueryOptions queryOptions)
      Resolves the owners permissions data for the given QueryOptions.
      Type Parameters:
      M - the map type
      Parameters:
      mapFactory - a function to create a map instance to return the results in
      queryOptions - the query options
      Returns:
      the resolved permissions
    • resolveMeta

      protected abstract void resolveMeta(MetaAccumulator accumulator, net.luckperms.api.query.QueryOptions queryOptions)
      Resolves the owners meta data for the given QueryOptions.
      Parameters:
      accumulator - the accumulator to add resolved meta to
      queryOptions - the query options
    • invalidate

      public final void invalidate()
      Specified by:
      invalidate in interface net.luckperms.api.cacheddata.CachedDataManager
    • invalidatePermissionCalculators

      public final void invalidatePermissionCalculators()
      Specified by:
      invalidatePermissionCalculators in interface net.luckperms.api.cacheddata.CachedDataManager
    • performCacheCleanup

      public final void performCacheCleanup()