Interface PolicyDefinitionStore
-
public interface PolicyDefinitionStorePersistsPolicy.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description @Nullable org.eclipse.dataspaceconnector.policy.model.PolicyDefinitiondeleteById(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.PolicyDefinitionfindById(java.lang.String policyId)Finds the policy by id.default voidreload()If the store implementation supports caching, this method triggers a cache-reload.voidsave(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:
Policyor 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
StreamofPolicy. 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
Policyor 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.
-
-