public interface ObjectStore
Modifier and Type | Method and Description |
---|---|
ObjectInfo |
addBucketLink(java.lang.String objectName,
ObjectStore toStore)
Add a link to another object store (bucket).
|
ObjectInfo |
addLink(java.lang.String objectName,
ObjectInfo toInfo)
Add a link to another object.
|
ObjectInfo |
delete(java.lang.String objectName)
Delete the object by name.
|
ObjectInfo |
get(java.lang.String objectName,
java.io.OutputStream outputStream)
Get an object by name from the store, reading it into the output stream, if the object exists.
|
java.lang.String |
getBucketName()
Get the name of the object store's bucket.
|
ObjectInfo |
getInfo(java.lang.String objectName)
Get the info for an object if the object exists / is not deleted.
|
ObjectInfo |
getInfo(java.lang.String objectName,
boolean includingDeleted)
Get the info for an object if the object exists, optionally including deleted.
|
java.util.List<ObjectInfo> |
getList()
Get a list of all object [infos] in the store.
|
ObjectStoreStatus |
getStatus()
Get the ObjectStoreStatus object.
|
ObjectInfo |
put(java.io.File file)
Place the contents of the file into a new object using the file name as the object name.
|
ObjectInfo |
put(ObjectMeta meta,
java.io.InputStream inputStream)
Place the contents of the input stream into a new object.
|
ObjectInfo |
put(java.lang.String objectName,
byte[] input)
Place the bytes into a new object.
|
ObjectInfo |
put(java.lang.String objectName,
java.io.InputStream inputStream)
Place the contents of the input stream into a new object.
|
ObjectStoreStatus |
seal()
Close (seal) the bucket to changes.
|
ObjectInfo |
updateMeta(java.lang.String objectName,
ObjectMeta meta)
Update the metadata of name, description or headers.
|
io.nats.client.impl.NatsObjectStoreWatchSubscription |
watch(ObjectStoreWatcher watcher,
ObjectStoreWatchOption... watchOptions)
Create a watch on the store (bucket).
|
java.lang.String getBucketName()
ObjectInfo put(ObjectMeta meta, java.io.InputStream inputStream) throws java.io.IOException, JetStreamApiException, java.security.NoSuchAlgorithmException
meta
- the metadata for the objectinputStream
- the source input streamjava.io.IOException
- covers various communication issues with the NATS server such as timeout or interruptionJetStreamApiException
- the request had an error related to the datajava.security.NoSuchAlgorithmException
- if the Digest Algorithm is not known. Currently, the only supported algorithm is SHA-256ObjectInfo put(java.lang.String objectName, java.io.InputStream inputStream) throws java.io.IOException, JetStreamApiException, java.security.NoSuchAlgorithmException
objectName
- the name of the objectinputStream
- the source input streamjava.io.IOException
- covers various communication issues with the NATS server such as timeout or interruptionJetStreamApiException
- the request had an error related to the datajava.security.NoSuchAlgorithmException
- if the Digest Algorithm is not known. Currently, the only supported algorithm is SHA-256ObjectInfo put(java.lang.String objectName, byte[] input) throws java.io.IOException, JetStreamApiException, java.security.NoSuchAlgorithmException
objectName
- the name of the objectinput
- the bytes to storejava.io.IOException
- covers various communication issues with the NATS server such as timeout or interruptionJetStreamApiException
- the request had an error related to the datajava.security.NoSuchAlgorithmException
- if the Digest Algorithm is not known. Currently, the only supported algorithm is SHA-256ObjectInfo put(java.io.File file) throws java.io.IOException, JetStreamApiException, java.security.NoSuchAlgorithmException
file
- the file to readjava.io.IOException
- covers various communication issues with the NATS server such as timeout or interruptionJetStreamApiException
- the request had an error related to the datajava.security.NoSuchAlgorithmException
- if the Digest Algorithm is not known. Currently, the only supported algorithm is SHA-256ObjectInfo get(java.lang.String objectName, java.io.OutputStream outputStream) throws java.io.IOException, JetStreamApiException, java.lang.InterruptedException, java.security.NoSuchAlgorithmException
objectName
- The name of the objectoutputStream
- the destination stream.java.io.IOException
- covers various communication issues with the NATS server such as timeout or interruptionJetStreamApiException
- the request had an error related to the datajava.lang.InterruptedException
- if the thread is interruptedjava.security.NoSuchAlgorithmException
- if the Digest Algorithm is not known. Currently, the only supported algorithm is SHA-256ObjectInfo getInfo(java.lang.String objectName) throws java.io.IOException, JetStreamApiException
objectName
- The name of the objectjava.io.IOException
- covers various communication issues with the NATS server such as timeout or interruptionJetStreamApiException
- the request had an error related to the dataObjectInfo getInfo(java.lang.String objectName, boolean includingDeleted) throws java.io.IOException, JetStreamApiException
objectName
- The name of the objectincludingDeleted
- whether to return info for deleted objectsjava.io.IOException
- covers various communication issues with the NATS server such as timeout or interruptionJetStreamApiException
- the request had an error related to the dataObjectInfo updateMeta(java.lang.String objectName, ObjectMeta meta) throws java.io.IOException, JetStreamApiException
objectName
- The name of the objectmeta
- the metadata with the new or unchanged name, description and headers.java.io.IOException
- covers various communication issues with the NATS server such as timeout or interruptionJetStreamApiException
- the request had an error related to the dataObjectInfo delete(java.lang.String objectName) throws java.io.IOException, JetStreamApiException
objectName
- The name of the objectjava.io.IOException
- covers various communication issues with the NATS server such as timeout or interruptionJetStreamApiException
- the request had an error related to the dataObjectInfo addLink(java.lang.String objectName, ObjectInfo toInfo) throws java.io.IOException, JetStreamApiException
objectName
- The name of the objecttoInfo
- the info object of the object to link tojava.io.IOException
- covers various communication issues with the NATS server such as timeout or interruptionJetStreamApiException
- the request had an error related to the dataObjectInfo addBucketLink(java.lang.String objectName, ObjectStore toStore) throws java.io.IOException, JetStreamApiException
objectName
- The name of the objecttoStore
- the store object to link tojava.io.IOException
- covers various communication issues with the NATS server such as timeout or interruptionJetStreamApiException
- the request had an error related to the dataObjectStoreStatus seal() throws java.io.IOException, JetStreamApiException
java.io.IOException
- covers various communication issues with the NATS server such as timeout or interruptionJetStreamApiException
- the request had an error related to the datajava.util.List<ObjectInfo> getList() throws java.io.IOException, JetStreamApiException, java.lang.InterruptedException
java.io.IOException
- covers various communication issues with the NATS server such as timeout or interruptionJetStreamApiException
- the request had an error related to the datajava.lang.InterruptedException
- if the thread is interruptedio.nats.client.impl.NatsObjectStoreWatchSubscription watch(ObjectStoreWatcher watcher, ObjectStoreWatchOption... watchOptions) throws java.io.IOException, JetStreamApiException, java.lang.InterruptedException
watcher
- the implementation to receive changes.watchOptions
- the watch options to apply. If multiple conflicting options are supplied, the last options wins.java.io.IOException
- covers various communication issues with the NATS server such as timeout or interruptionJetStreamApiException
- the request had an error related to the datajava.lang.InterruptedException
- if the thread is interruptedObjectStoreStatus getStatus() throws java.io.IOException, JetStreamApiException
java.io.IOException
- covers various communication issues with the NATS server such as timeout or interruptionJetStreamApiException
- the request had an error related to the data the request had an error related to the data