Package org.saidone.service
Class MongoNodeService
java.lang.Object
org.saidone.component.BaseComponent
org.saidone.service.MongoNodeService
- All Implemented Interfaces:
NodeService,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
Default
NodeService implementation that persists node metadata using
a MongoNodeRepositoryImpl. It throws
NodeNotFoundOnVaultException when a requested node is not present in
the repository.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteById(String nodeId) Deletes the node wrapper identified by the given ID.findAll()Retrieves all stored node wrappers.org.springframework.data.domain.Page<NodeWrapper> findByArchiveDateRange(Instant from, Instant to, org.springframework.data.domain.Pageable pageable) Retrieves node wrappers archived within the specified date range using pagination.Retrieves the stored node wrapper by its identifier.findByKv(int kv) Retrieves all node wrappers associated with the specified encryption key version.Retrieves all node wrappers having the given notarization transaction ID.voidsave(NodeWrapper nodeWrapper) Persists the given wrapped node metadata.Methods inherited from class org.saidone.component.BaseComponent
init, setApplicationContext, shutDown, stop
-
Constructor Details
-
MongoNodeService
public MongoNodeService()
-
-
Method Details
-
save
Persists the given wrapped node metadata.This implementation simply delegates to
MongoNodeRepositoryImpl.save(NodeWrapper).- Specified by:
savein interfaceNodeService- Parameters:
nodeWrapper- the node wrapper to store
-
findById
Retrieves the stored node wrapper by its identifier.- Specified by:
findByIdin interfaceNodeService- Parameters:
nodeId- the Alfresco node identifier- Returns:
- the stored
NodeWrapper - Throws:
NodeNotFoundOnVaultException- if the node does not exist
-
findByArchiveDateRange
public org.springframework.data.domain.Page<NodeWrapper> findByArchiveDateRange(Instant from, Instant to, org.springframework.data.domain.Pageable pageable) Retrieves node wrappers archived within the specified date range using pagination. Both bounds are inclusive. Passingnullfor one of the parameters will make the range open-ended on that side.- Specified by:
findByArchiveDateRangein interfaceNodeService- Parameters:
from- the lower bound of the archive date range, inclusiveto- the upper bound of the archive date range, inclusivepageable- pagination information- Returns:
- page of
NodeWrapper
-
findByNtx
Retrieves all node wrappers having the given notarization transaction ID. Anulltransaction ID is used to select nodes that have not yet been notarized.- Specified by:
findByNtxin interfaceNodeService- Parameters:
ntx- the notarization transaction ID to filter by- Returns:
- iterable collection of
NodeWrapper
-
findByKv
Retrieves all node wrappers associated with the specified encryption key version.- Specified by:
findByKvin interfaceNodeService- Parameters:
kv- the encryption key version to filter by- Returns:
- iterable collection of
NodeWrapper
-
findAll
Retrieves all stored node wrappers.The returned iterable is backed by the underlying repository and reflects the current state of the vault.
- Specified by:
findAllin interfaceNodeService- Returns:
- iterable collection of
NodeWrapper
-
deleteById
Deletes the node wrapper identified by the given ID.- Specified by:
deleteByIdin interfaceNodeService- Parameters:
nodeId- the Alfresco node identifier
-