Package net.handle.hdllib
Interface HandleStorage
-
- All Known Subinterfaces:
HandleStorage2
public interface HandleStorageHandleStorage is an interface to an object that is capable of storing handles and their values.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidcheckpointDatabase()Checkpoint (ie backup, and reset transaction logs) the database.voidcreateHandle(byte[] handle, HandleValue[] values)Creates the specified handle in the "database" with the specified initial valuesdefault voidcreateOrUpdateRecord(byte[] handle, HandleValue[] values)Creates or updates the handle to have the exact given handle values.voiddeleteAllRecords()Remove all of the records from the database.booleandeleteHandle(byte[] handle)Delete the specified handle in the database.default booleanexists(byte[] handle)Returns true if the given handle exists in the database.java.util.Enumeration<byte[]>getHandlesForNA(byte[] naHdl)Scan the database for handles with the given prefix and return an Enumeration of byte arrays with each byte array being a handle.byte[][]getRawHandleValues(byte[] handle, int[] indexList, byte[][] typeList)Return the pre-packaged values of the given handle that are either in the indexList or the typeList.booleanhaveNA(byte[] authHandle)Returns true if this server is responsible for the given prefix.voidinit(net.cnri.util.StreamTable configTable)Initializes the handle storage object with the given configuration table.voidscanHandles(ScanCallback callback)Scan the database, calling a method in the specified callback for every handle in the database.default voidscanHandlesFrom(byte[] startingPoint, boolean inclusive, ScanCallback callback)Scan the database, calling a method in the specified callback for every handle in the database.voidscanNAs(ScanCallback callback)Scan the homed prefix database, calling a method in the specified callback for every prefix in the database.default voidscanNAsFrom(byte[] startingPoint, boolean inclusive, ScanCallback callback)Scan the homed prefix database, calling a method in the specified callback for every prefix in the database.voidsetHaveNA(byte[] authHandle, boolean flag)Sets a flag indicating whether or not this server is responsible for the given prefix.voidshutdown()Save pending data and close any open files.default booleansupportsDumpResumption()Returns true ifscanHandlesFrom(byte[], boolean, ScanCallback)andscanNAsFrom(byte[], boolean, ScanCallback)are implemented; otherwise false.voidupdateValue(byte[] handle, HandleValue[] value)Replace the handle value that has the same index as the given handle value with the given handle value.
-
-
-
Method Detail
-
init
void init(net.cnri.util.StreamTable configTable) throws java.lang.Exception
Initializes the handle storage object with the given configuration table.- Throws:
java.lang.Exception
-
haveNA
boolean haveNA(byte[] authHandle) throws HandleExceptionReturns true if this server is responsible for the given prefix.- Throws:
HandleException
-
setHaveNA
void setHaveNA(byte[] authHandle, boolean flag) throws HandleExceptionSets a flag indicating whether or not this server is responsible for the given prefix.- Throws:
HandleException
-
createHandle
void createHandle(byte[] handle, HandleValue[] values) throws HandleExceptionCreates the specified handle in the "database" with the specified initial values- Throws:
HandleException
-
deleteHandle
boolean deleteHandle(byte[] handle) throws HandleExceptionDelete the specified handle in the database. Returns true if the given handle was in the database.- Throws:
HandleException
-
getRawHandleValues
byte[][] getRawHandleValues(byte[] handle, int[] indexList, byte[][] typeList) throws HandleExceptionReturn the pre-packaged values of the given handle that are either in the indexList or the typeList. This method should return any values of type ALIAS or REDIRECT, even if they were not requested. Return null to indicate handle not found; byte[0][] to indicate values not found.- Throws:
HandleException
-
updateValue
void updateValue(byte[] handle, HandleValue[] value) throws HandleExceptionReplace the handle value that has the same index as the given handle value with the given handle value.- Throws:
HandleException
-
scanHandles
void scanHandles(ScanCallback callback) throws HandleException
Scan the database, calling a method in the specified callback for every handle in the database.- Throws:
HandleException
-
scanNAs
void scanNAs(ScanCallback callback) throws HandleException
Scan the homed prefix database, calling a method in the specified callback for every prefix in the database.- Throws:
HandleException
-
getHandlesForNA
java.util.Enumeration<byte[]> getHandlesForNA(byte[] naHdl) throws HandleExceptionScan the database for handles with the given prefix and return an Enumeration of byte arrays with each byte array being a handle. naHdl is the prefix handle for the prefix that you want to list the handles for.- Throws:
HandleException
-
deleteAllRecords
void deleteAllRecords() throws HandleExceptionRemove all of the records from the database.- Throws:
HandleException
-
checkpointDatabase
void checkpointDatabase() throws HandleExceptionCheckpoint (ie backup, and reset transaction logs) the database. If not supported, or if the operation failed this should throw an exception. This may just be an asynchronous call that *starts* the checkpoint process, so the method may return if the checkpoint was started, not necessarily if it was successful.- Throws:
HandleException
-
shutdown
void shutdown()
Save pending data and close any open files.
-
supportsDumpResumption
default boolean supportsDumpResumption()
Returns true ifscanHandlesFrom(byte[], boolean, ScanCallback)andscanNAsFrom(byte[], boolean, ScanCallback)are implemented; otherwise false.
-
scanHandlesFrom
default void scanHandlesFrom(byte[] startingPoint, boolean inclusive, ScanCallback callback) throws HandleExceptionScan the database, calling a method in the specified callback for every handle in the database.- Throws:
HandleException
-
scanNAsFrom
default void scanNAsFrom(byte[] startingPoint, boolean inclusive, ScanCallback callback) throws HandleExceptionScan the homed prefix database, calling a method in the specified callback for every prefix in the database.- Throws:
HandleException
-
exists
default boolean exists(byte[] handle) throws HandleExceptionReturns true if the given handle exists in the database.- Throws:
HandleException
-
createOrUpdateRecord
default void createOrUpdateRecord(byte[] handle, HandleValue[] values) throws HandleExceptionCreates or updates the handle to have the exact given handle values.- Throws:
HandleException
-
-