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 TypeMethodDescriptionvoid
deleteById
(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.void
save
(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:
save
in interfaceNodeService
- Parameters:
nodeWrapper
- the node wrapper to store
-
findById
Retrieves the stored node wrapper by its identifier.- Specified by:
findById
in 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. Passingnull
for one of the parameters will make the range open-ended on that side.- Specified by:
findByArchiveDateRange
in 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. Anull
transaction ID is used to select nodes that have not yet been notarized.- Specified by:
findByNtx
in 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:
findByKv
in 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:
findAll
in interfaceNodeService
- Returns:
- iterable collection of
NodeWrapper
-
deleteById
Deletes the node wrapper identified by the given ID.- Specified by:
deleteById
in interfaceNodeService
- Parameters:
nodeId
- the Alfresco node identifier
-