AutoCloseable, ContentAddressableStorepublic class ContentAddressableStoreInfinispanImpl extends ContentAddressableStoreImpl
| Modifier and Type | Field | Description |
|---|---|---|
static String |
cacheNamePropertyName |
|
static String |
configFilePropertyName |
| Constructor | Description |
|---|---|
ContentAddressableStoreInfinispanImpl(Properties properties) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
|
boolean |
contains(Hash hash) |
Check whether content exists in the store with the specified hash
|
boolean |
contains(Hash hash,
ContentEncoding contentEncoding) |
Check whether content exists in the store with the specified hash with the specified encoding
|
boolean |
delete(Hash hash) |
Delete content from the store.
|
long |
getContentLength(Hash hash) |
Get the length of the content with the specified hash
|
long |
getContentLength(Hash hash,
ContentEncoding contentEncoding) |
Get the length of the encoded content with the specified hash.
|
List<Hash> |
getHashes() |
Get a list of all hashes in the store.
|
InputStream |
read(Hash hash) |
Read content from the store.
|
InputStream |
read(Hash hash,
ContentEncoding contentEncoding) |
Read content from the store, returning using the given encoding.
|
Hash |
write(InputStream inputStream) |
Write content to the store, returning its hash.
|
Hash |
write(InputStream inputStream,
List<ContentEncoding> encodings) |
Write content to the store in raw format and also formats specified in
the ContentEncodings.
|
addListener, notifyListenersContentAdded, notifyListenersContentRemoved, removeListenerpublic static final String configFilePropertyName
public static final String cacheNamePropertyName
public ContentAddressableStoreInfinispanImpl(Properties properties) throws IOException
IOExceptionpublic Hash write(InputStream inputStream) throws IOException
ContentAddressableStoreinputStream - Content to be writtenIOExceptionpublic Hash write(InputStream inputStream, List<ContentEncoding> encodings) throws IOException
ContentAddressableStoreinputStream - Content to be writtenIOExceptionpublic boolean contains(Hash hash)
ContentAddressableStorehash - Hash of content to checktrue if content exists in the store with specified
hashpublic boolean contains(Hash hash, ContentEncoding contentEncoding)
ContentAddressableStorehash - Hash of content to checkcontentEncoding - Type of encoding to use.true if content exists in the store with specified
hash and specified encoding.public InputStream read(Hash hash) throws FileNotFoundException
ContentAddressableStorehash - The hash of the content to read.InputStream of content if content exists; otherwise
null.FileNotFoundExceptionpublic InputStream read(Hash hash, ContentEncoding contentEncoding) throws FileNotFoundException
ContentAddressableStorehash - The hash of the (raw) content to read.contentEncoding - Type of encoding to use to return the stream. If null then no
encoding is used.InputStream of content if content exists; otherwise
null.FileNotFoundExceptionpublic long getContentLength(Hash hash) throws IOException
ContentAddressableStorehash - The hash of the contentIOExceptionpublic long getContentLength(Hash hash, ContentEncoding contentEncoding) throws IOException
ContentAddressableStorehash - The hash of the contentcontentEncoding - The encoding type to use. If null then no encoding is used and
the raw content is assumed.IOExceptionpublic List<Hash> getHashes() throws IOException
ContentAddressableStoreIOExceptionpublic boolean delete(Hash hash) throws IOException
ContentAddressableStorehash - Hash of content to deletetrue if the content existed and was deleted;
otherwise false.IOExceptionpublic void close()
Copyright © 2018. All rights reserved.