Class FilesystemDecisionLoader

java.lang.Object
io.gorules.zen.loader.FilesystemDecisionLoader
All Implemented Interfaces:
DecisionLoader

public class FilesystemDecisionLoader extends Object implements DecisionLoader
Loads decision models from the filesystem.
  • Constructor Details

    • FilesystemDecisionLoader

      public FilesystemDecisionLoader(String rootPath)
      Create filesystem loader with default caching enabled.
      Parameters:
      rootPath - Root directory path
    • FilesystemDecisionLoader

      public FilesystemDecisionLoader(String rootPath, boolean useCache)
      Create filesystem loader with caching option.
      Parameters:
      rootPath - Root directory path
      useCache - Whether to cache loaded decisions
  • Method Details

    • load

      public CompletableFuture<io.gorules.zen_engine.JsonBuffer> load(String key)
      Description copied from interface: DecisionLoader
      Load a decision by its key.
      Specified by:
      load in interface DecisionLoader
      Parameters:
      key - Decision key/filename
      Returns:
      CompletableFuture with decision content as JsonBuffer
    • clearCache

      public void clearCache()
      Clear the cache.
    • evict

      public void evict(String key)
      Evict a specific decision from cache.
      Parameters:
      key - Decision key to evict