Interface IStorageService

All Superinterfaces:
IGridService

public interface IStorageService extends IGridService
Grid-wide storage services for all AEKeyType.
  • Method Details

    • getInventory

      MEStorage getInventory()
      Returns:
      The network inventory.
    • getCachedInventory

      KeyCounter getCachedInventory()
      Returns the cached content of the network inventory. The cache is updated at most once per tick. Changes to network inventory will not be reflected by the cache until the next tick.

      Should be used when slightly outdated content is not a big deal. Preferred to getInventory().getAvailableStacks() for performance reasons.

      Returns:
      The cached stacks of this network. Does not return a copy. Do not modify!
    • addGlobalStorageProvider

      void addGlobalStorageProvider(IStorageProvider cc)
      Adds a IStorageProvider that is not associated with a specific IGridNode. This is for adding storage provided by IGridServices for examples.

      THIS IT NOT FOR USE BY NODES THAT PROVIDE THE IStorageProvider SERVICE. Those are automatically handled by the storage system.

      Parameters:
      cc - to be added cell provider
    • removeGlobalStorageProvider

      void removeGlobalStorageProvider(IStorageProvider cc)
      Remove a provider added with addGlobalStorageProvider(IStorageProvider).
    • refreshNodeStorageProvider

      void refreshNodeStorageProvider(IGridNode node)
      Refreshes the storage mounts provided by a node through its IStorageProvider.
      Throws:
      IllegalArgumentException - If the given node is not part of this grid, or did not provide IStorageProvider.
    • refreshGlobalStorageProvider

      void refreshGlobalStorageProvider(IStorageProvider provider)
      Refreshes the storage mounts provided by a global storage provider.
      Throws:
      IllegalArgumentException - If the given provider has not been registered.
    • invalidateCache

      void invalidateCache()
      Invalidates the cached inventory, causing it to be re-calculated the next time it is accessed.

      THIS IS A PERFORMANCE INTENSIVE OPERATION AND SHOULD BE USED WITH CARE.