Interface PolicyDefinitionStore


  • public interface PolicyDefinitionStore
    Persists Policy.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      @Nullable org.eclipse.dataspaceconnector.policy.model.PolicyDefinition deleteById​(java.lang.String policyId)
      Deletes a policy for the given id.
      java.util.stream.Stream<org.eclipse.dataspaceconnector.policy.model.PolicyDefinition> findAll​(org.eclipse.dataspaceconnector.spi.query.QuerySpec spec)
      Find stream of policies in the store based on query spec.
      org.eclipse.dataspaceconnector.policy.model.PolicyDefinition findById​(java.lang.String policyId)
      Finds the policy by id.
      default void reload()
      If the store implementation supports caching, this method triggers a cache-reload.
      void save​(org.eclipse.dataspaceconnector.policy.model.PolicyDefinition policy)
      Persists the policy.
    • Method Detail

      • findById

        org.eclipse.dataspaceconnector.policy.model.PolicyDefinition findById​(java.lang.String policyId)
        Finds the policy by id.
        Parameters:
        policyId - id of the policy.
        Returns:
        Policy or null if not found.
        Throws:
        org.eclipse.dataspaceconnector.spi.persistence.EdcPersistenceException - if something goes wrong.
      • findAll

        java.util.stream.Stream<org.eclipse.dataspaceconnector.policy.model.PolicyDefinition> findAll​(org.eclipse.dataspaceconnector.spi.query.QuerySpec spec)
        Find stream of policies in the store based on query spec.
        Parameters:
        spec - query specification.
        Returns:
        A Stream of Policy. Might be empty, never null.
        Throws:
        org.eclipse.dataspaceconnector.spi.persistence.EdcPersistenceException - if something goes wrong.
      • save

        void save​(org.eclipse.dataspaceconnector.policy.model.PolicyDefinition policy)
        Persists the policy.
        Parameters:
        policy - to be saved.
        Throws:
        org.eclipse.dataspaceconnector.spi.persistence.EdcPersistenceException - if something goes wrong.
      • deleteById

        @Nullable
        @Nullable org.eclipse.dataspaceconnector.policy.model.PolicyDefinition deleteById​(java.lang.String policyId)
        Deletes a policy for the given id.
        Parameters:
        policyId - id of the policy to be removed.
        Returns:
        Deleted Policy or null if policy not found.
        Throws:
        org.eclipse.dataspaceconnector.spi.persistence.EdcPersistenceException - if something goes wrong.
      • reload

        default void reload()
        If the store implementation supports caching, this method triggers a cache-reload.