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 TypeMethodDescriptionvoid
void
createHandle
(byte[] handleBytes, net.handle.hdllib.HandleValue[] values) void
boolean
deleteHandle
(byte[] handleBytes) Enumeration
<byte[]> getHandlesForNA
(byte[] naHdl) byte[][]
getRawHandleValues
(byte[] handleBytes, int[] indexList, byte[][] typeList) boolean
haveNA
(byte[] authHandle) void
init
(net.cnri.util.StreamTable config) void
scanHandles
(net.handle.hdllib.ScanCallback callback) void
scanNAs
(net.handle.hdllib.ScanCallback callback) void
setHaveNA
(byte[] authHandle, boolean flag) void
shutdown()
void
updateValue
(byte[] handleBytes, net.handle.hdllib.HandleValue[] values) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.handle.hdllib.HandleStorage
createOrUpdateRecord, exists, scanHandlesFrom, scanNAsFrom, supportsDumpResumption
-
Constructor Details
-
MongoDbHandleStorage
public MongoDbHandleStorage()
-
-
Method Details
-
init
- Specified by:
init
in interfacenet.handle.hdllib.HandleStorage
- Throws:
Exception
-
haveNA
public boolean haveNA(byte[] authHandle) throws net.handle.hdllib.HandleException - Specified by:
haveNA
in interfacenet.handle.hdllib.HandleStorage
- Throws:
net.handle.hdllib.HandleException
-
setHaveNA
public void setHaveNA(byte[] authHandle, boolean flag) throws net.handle.hdllib.HandleException - Specified by:
setHaveNA
in 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:
createHandle
in interfacenet.handle.hdllib.HandleStorage
- Throws:
net.handle.hdllib.HandleException
-
deleteHandle
public boolean deleteHandle(byte[] handleBytes) throws net.handle.hdllib.HandleException - Specified by:
deleteHandle
in 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:
getRawHandleValues
in 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:
updateValue
in 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:
scanHandles
in 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:
scanNAs
in interfacenet.handle.hdllib.HandleStorage
- Throws:
net.handle.hdllib.HandleException
-
getHandlesForNA
- Specified by:
getHandlesForNA
in interfacenet.handle.hdllib.HandleStorage
- Throws:
net.handle.hdllib.HandleException
-
deleteAllRecords
public void deleteAllRecords() throws net.handle.hdllib.HandleException- Specified by:
deleteAllRecords
in interfacenet.handle.hdllib.HandleStorage
- Throws:
net.handle.hdllib.HandleException
-
checkpointDatabase
public void checkpointDatabase() throws net.handle.hdllib.HandleException- Specified by:
checkpointDatabase
in interfacenet.handle.hdllib.HandleStorage
- Throws:
net.handle.hdllib.HandleException
-
shutdown
public void shutdown()- Specified by:
shutdown
in interfacenet.handle.hdllib.HandleStorage
-