Package org.trellisldp.ext.cassandra
Class CassandraBinaryService
- java.lang.Object
-
- org.trellisldp.ext.cassandra.CassandraBinaryService
-
- All Implemented Interfaces:
BinaryService,RetrievalService<Binary>
@ApplicationScoped public class CassandraBinaryService extends Object implements BinaryService
ImplementsBinaryServiceby chunking binary data across Cassandra.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONFIG_MAX_CHUNK_SIZEConfiguration key for adjusting the chunk size of binary resources.static intDEFAULT_CHUNK_SIZEThe default chunk size for binary resources, in bytes.
-
Constructor Summary
Constructors Constructor Description CassandraBinaryService()For use with RESTeasy and CDI proxies.CassandraBinaryService(IdentifierService idService, GetChunkSize get, Insert insert, Delete delete, Read read, ReadRange readRange)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgenerateIdentifier(IRI identifier)CompletionStage<Binary>get(IRI id)CompletionStage<Void>purgeContent(IRI identifier)CompletionStage<Void>setContent(BinaryMetadata meta, InputStream stream)
-
-
-
Field Detail
-
CONFIG_MAX_CHUNK_SIZE
public static final String CONFIG_MAX_CHUNK_SIZE
Configuration key for adjusting the chunk size of binary resources.- See Also:
- Constant Field Values
-
DEFAULT_CHUNK_SIZE
public static final int DEFAULT_CHUNK_SIZE
The default chunk size for binary resources, in bytes.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CassandraBinaryService
public CassandraBinaryService()
For use with RESTeasy and CDI proxies.- API Note:
- This construtor is used by CDI runtimes that require a public, no-argument constructor. It should not be invoked directly in user code.
-
CassandraBinaryService
@Inject public CassandraBinaryService(IdentifierService idService, GetChunkSize get, Insert insert, Delete delete, Read read, ReadRange readRange)
- Parameters:
idService-IdentifierServiceto use for binariesget- aGetChunkSizequery to useinsert- aInsertquery to usedelete- aDeletequery to useread- aReadquery to usereadRange- aReadRangequery to use
-
-
Method Detail
-
get
public CompletionStage<Binary> get(IRI id)
- Specified by:
getin interfaceRetrievalService<Binary>
-
setContent
public CompletionStage<Void> setContent(BinaryMetadata meta, InputStream stream)
- Specified by:
setContentin interfaceBinaryService
-
purgeContent
public CompletionStage<Void> purgeContent(IRI identifier)
- Specified by:
purgeContentin interfaceBinaryService
-
generateIdentifier
public String generateIdentifier(IRI identifier)
- Specified by:
generateIdentifierin interfaceBinaryService
-
-