Package appeng.api.networking.storage
Interface IStorageService
- All Superinterfaces:
IGridService
Grid-wide storage services for all
AEKeyType
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds aIStorageProvider
that is not associated with a specificIGridNode
.Returns the cached content of the network inventory.void
Invalidates thecached inventory
, causing it to be re-calculated the next time it is accessed.void
refreshGlobalStorageProvider
(IStorageProvider provider) Refreshes the storage mounts provided by a global storage provider.void
Refreshes the storage mounts provided by anode
through itsIStorageProvider
.void
Remove a provider added withaddGlobalStorageProvider(IStorageProvider)
.
-
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 togetInventory().getAvailableStacks()
for performance reasons.- Returns:
- The cached stacks of this network. Does not return a copy. Do not modify!
-
addGlobalStorageProvider
Adds aIStorageProvider
that is not associated with a specificIGridNode
. This is for adding storage provided byIGridService
s for examples. THIS IT NOT FOR USE BYNODES
THAT PROVIDE THEIStorageProvider
SERVICE. Those are automatically handled by the storage system.- Parameters:
cc
- to be added cell provider
-
removeGlobalStorageProvider
Remove a provider added withaddGlobalStorageProvider(IStorageProvider)
. -
refreshNodeStorageProvider
Refreshes the storage mounts provided by anode
through itsIStorageProvider
.- Throws:
IllegalArgumentException
- If the given node is not part of this grid, or did not provideIStorageProvider
.
-
refreshGlobalStorageProvider
Refreshes the storage mounts provided by a global storage provider.- Throws:
IllegalArgumentException
- If the given provider has not beenregistered
.
-
invalidateCache
void invalidateCache()Invalidates thecached 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.
-