Package net.handle.server.storage
Class MongoDbHandleStorage
java.lang.Object
net.handle.server.storage.MongoDbHandleStorage
- All Implemented Interfaces:
net.handle.hdllib.HandleStorage
A handle storage class for connecting to MongoDB.
To use this storage module configure your config.dct file with the following options.
"storage_type" = "CUSTOM"
"storage_class" = "net.handle.server.storage.MongoDbHandleStorage"
"storage_config" = {
"connectionUri" = "mongodb://localhost:27017"
"databaseName" = "handle"
"handlesCollectionName" = "handles"
"nasCollectionName" = "nas"
"maxTimeMs" = "30000"
"maxTimeMsLongRunning" = "3600000"
}
The values given in the above example are the default values; "storage_config" can be omitted
if no changes are desired.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcreateHandle(byte[] handleBytes, net.handle.hdllib.HandleValue[] values) voidbooleandeleteHandle(byte[] handleBytes) Enumeration<byte[]> getHandlesForNA(byte[] naHdl) byte[][]getRawHandleValues(byte[] handleBytes, int[] indexList, byte[][] typeList) booleanhaveNA(byte[] authHandle) voidinit(net.cnri.util.StreamTable config) voidscanHandles(net.handle.hdllib.ScanCallback callback) voidscanNAs(net.handle.hdllib.ScanCallback callback) voidsetHaveNA(byte[] authHandle, boolean flag) voidshutdown()voidupdateValue(byte[] handleBytes, net.handle.hdllib.HandleValue[] values) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.handle.hdllib.HandleStorage
createOrUpdateRecord, exists, scanHandlesFrom, scanNAsFrom, supportsDumpResumption
-
Constructor Details
-
MongoDbHandleStorage
public MongoDbHandleStorage()
-
-
Method Details
-
init
- Specified by:
initin interfacenet.handle.hdllib.HandleStorage- Throws:
Exception
-
haveNA
public boolean haveNA(byte[] authHandle) throws net.handle.hdllib.HandleException - Specified by:
haveNAin interfacenet.handle.hdllib.HandleStorage- Throws:
net.handle.hdllib.HandleException
-
setHaveNA
public void setHaveNA(byte[] authHandle, boolean flag) throws net.handle.hdllib.HandleException - Specified by:
setHaveNAin interfacenet.handle.hdllib.HandleStorage- Throws:
net.handle.hdllib.HandleException
-
createHandle
public void createHandle(byte[] handleBytes, net.handle.hdllib.HandleValue[] values) throws net.handle.hdllib.HandleException - Specified by:
createHandlein interfacenet.handle.hdllib.HandleStorage- Throws:
net.handle.hdllib.HandleException
-
deleteHandle
public boolean deleteHandle(byte[] handleBytes) throws net.handle.hdllib.HandleException - Specified by:
deleteHandlein interfacenet.handle.hdllib.HandleStorage- Throws:
net.handle.hdllib.HandleException
-
getRawHandleValues
public byte[][] getRawHandleValues(byte[] handleBytes, int[] indexList, byte[][] typeList) throws net.handle.hdllib.HandleException - Specified by:
getRawHandleValuesin interfacenet.handle.hdllib.HandleStorage- Throws:
net.handle.hdllib.HandleException
-
updateValue
public void updateValue(byte[] handleBytes, net.handle.hdllib.HandleValue[] values) throws net.handle.hdllib.HandleException - Specified by:
updateValuein interfacenet.handle.hdllib.HandleStorage- Throws:
net.handle.hdllib.HandleException
-
scanHandles
public void scanHandles(net.handle.hdllib.ScanCallback callback) throws net.handle.hdllib.HandleException - Specified by:
scanHandlesin interfacenet.handle.hdllib.HandleStorage- Throws:
net.handle.hdllib.HandleException
-
scanNAs
public void scanNAs(net.handle.hdllib.ScanCallback callback) throws net.handle.hdllib.HandleException - Specified by:
scanNAsin interfacenet.handle.hdllib.HandleStorage- Throws:
net.handle.hdllib.HandleException
-
getHandlesForNA
- Specified by:
getHandlesForNAin interfacenet.handle.hdllib.HandleStorage- Throws:
net.handle.hdllib.HandleException
-
deleteAllRecords
public void deleteAllRecords() throws net.handle.hdllib.HandleException- Specified by:
deleteAllRecordsin interfacenet.handle.hdllib.HandleStorage- Throws:
net.handle.hdllib.HandleException
-
checkpointDatabase
public void checkpointDatabase() throws net.handle.hdllib.HandleException- Specified by:
checkpointDatabasein interfacenet.handle.hdllib.HandleStorage- Throws:
net.handle.hdllib.HandleException
-
shutdown
public void shutdown()- Specified by:
shutdownin interfacenet.handle.hdllib.HandleStorage
-