Package org.saidone.service.content
Interface ContentService
- All Known Implementing Classes:
GridFsContentService
,S3ContentService
public interface ContentService
Abstraction over the persistence mechanism used to store node content.
Implementations handle saving, retrieving and deleting binary files as well
as computing cryptographic hashes.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
archiveNodeContent
(org.alfresco.core.model.Node node, InputStream inputStream) Saves the content of the provided node into the underlying store.computeHash
(String nodeId, String algorithm) Computes the cryptographic hash of a stored node's content using the given algorithm.void
deleteNodeContent
(String nodeId) Deletes content associated with the given node id from the store.getNodeContent
(String nodeId) Retrieves previously archived content for the given node id.getNodeContentInfo
(String nodeId) Retrieves only metadata information about the stored content of the given node without returning the binary stream.
-
Method Details
-
archiveNodeContent
Saves the content of the provided node into the underlying store.- Parameters:
node
- node whose content should be archivedinputStream
- stream providing the node content
-
getNodeContent
Retrieves previously archived content for the given node id.- Parameters:
nodeId
- identifier of the node- Returns:
- a
NodeContentStream
descriptor containing stream and metadata
-
getNodeContentInfo
Retrieves only metadata information about the stored content of the given node without returning the binary stream.- Parameters:
nodeId
- identifier of the node- Returns:
- a
NodeContentInfo
descriptor populated with file name, content type and checksum details
-
deleteNodeContent
Deletes content associated with the given node id from the store.- Parameters:
nodeId
- identifier of the node
-
computeHash
Computes the cryptographic hash of a stored node's content using the given algorithm.- Parameters:
nodeId
- identifier of the nodealgorithm
- name of the hash algorithm, e.g. MD5 or SHA-256- Returns:
- the hexadecimal encoded hash string
-