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

@Service public class MongoNodeService extends BaseComponent implements NodeService
Default NodeService implementation that persists node metadata using a MongoNodeRepositoryImpl. It throws NodeNotFoundOnVaultException when a requested node is not present in the repository.
  • Constructor Details

    • MongoNodeService

      public MongoNodeService()
  • Method Details

    • save

      public void save(NodeWrapper nodeWrapper)
      Persists the given wrapped node metadata.

      This implementation simply delegates to MongoNodeRepositoryImpl.save(NodeWrapper).

      Specified by:
      save in interface NodeService
      Parameters:
      nodeWrapper - the node wrapper to store
    • findById

      public NodeWrapper findById(String nodeId)
      Retrieves the stored node wrapper by its identifier.
      Specified by:
      findById in interface NodeService
      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. Passing null for one of the parameters will make the range open-ended on that side.
      Specified by:
      findByArchiveDateRange in interface NodeService
      Parameters:
      from - the lower bound of the archive date range, inclusive
      to - the upper bound of the archive date range, inclusive
      pageable - pagination information
      Returns:
      page of NodeWrapper
    • findByNtx

      public Iterable<NodeWrapper> findByNtx(String ntx)
      Retrieves all node wrappers having the given notarization transaction ID. A null transaction ID is used to select nodes that have not yet been notarized.
      Specified by:
      findByNtx in interface NodeService
      Parameters:
      ntx - the notarization transaction ID to filter by
      Returns:
      iterable collection of NodeWrapper
    • findByKv

      public Iterable<NodeWrapper> findByKv(int kv)
      Retrieves all node wrappers associated with the specified encryption key version.
      Specified by:
      findByKv in interface NodeService
      Parameters:
      kv - the encryption key version to filter by
      Returns:
      iterable collection of NodeWrapper
    • findAll

      public Iterable<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 interface NodeService
      Returns:
      iterable collection of NodeWrapper
    • deleteById

      public void deleteById(String nodeId)
      Deletes the node wrapper identified by the given ID.
      Specified by:
      deleteById in interface NodeService
      Parameters:
      nodeId - the Alfresco node identifier