public interface RegionDatabase
If there are multiple worlds, then there should be one region database
per world. To manage multiple region databases, consider using an
implementation of a RegionDriver.
RegionDriver| Modifier and Type | Method and Description |
|---|---|
String |
getName()
Get a displayable name for this store.
|
Set<ProtectedRegion> |
loadAll()
Load all regions from storage and place them into the passed map.
|
void |
saveAll(Set<ProtectedRegion> regions)
Replace all the data in the store with the given collection of regions.
|
void |
saveChanges(RegionDifference difference)
Perform a partial save that only commits changes, rather than the
entire region index.
|
String getName()
Set<ProtectedRegion> loadAll() throws StorageException
The map will only be modified from one thread. The keys of each map entry will be in respect to the ID of the region but transformed to be lowercase. Until this method returns, the map may not be modified by any other thread simultaneously. If an exception is thrown, then the state in which the map is left is undefined.
The provided map should have reasonably efficient
get() and put() calls in order to maximize performance.
StorageException - thrown on read errorvoid saveAll(Set<ProtectedRegion> regions) throws StorageException
regions - a set of regionsStorageException - thrown on write errorvoid saveChanges(RegionDifference difference) throws DifferenceSaveException, StorageException
difference - the differenceDifferenceSaveException - thrown if partial saves are not supportedStorageException - thrown on write errorCopyright © 2015. All Rights Reserved.