Interface DecisionState
- All Known Subinterfaces:
MutableDecisionState
- All Known Implementing Classes:
DbDecisionState
public interface DecisionState
-
Method Summary
Modifier and TypeMethodDescriptionvoidCompletely clears all caches.findDecisionByIdAndDeploymentKey(String tenantId, org.agrona.DirectBuffer decisionId, long deploymentKey) Query decisions by the given decision id and deployment key and return the decision.findDecisionByIdAndVersionTag(String tenantId, org.agrona.DirectBuffer decisionId, String versionTag) Query decisions by the given decision id and version tag and return the decision.findDecisionByTenantAndKey(String tenantId, long decisionKey) Query decisions by the given decision key and return the decision.findDecisionRequirementsByTenantAndKey(String tenantId, long decisionRequirementsKey) Query decision requirements (DRGs) by the given decision requirements key.findDecisionsByTenantAndDecisionRequirementsKey(String tenantId, long decisionRequirementsKey) Query decisions by the given decision requirements (DRG) key.findLatestDecisionByIdAndTenant(org.agrona.DirectBuffer decisionId, String tenantId) Query decisions by the given decision id and return the latest version of the decision.findLatestDecisionRequirementsByTenantAndId(String tenantId, org.agrona.DirectBuffer decisionRequirementsId) Query decision requirements (DRGs) by the given decision requirements id and return the latest version of the DRG.
-
Method Details
-
findLatestDecisionByIdAndTenant
Optional<PersistedDecision> findLatestDecisionByIdAndTenant(org.agrona.DirectBuffer decisionId, String tenantId) Query decisions by the given decision id and return the latest version of the decision.- Parameters:
decisionId- the id of the decisiontenantId- the tenant the decision belongs to- Returns:
- the latest version of the decision, or
Optional.empty()if no decision is deployed with the given id
-
findDecisionByTenantAndKey
Query decisions by the given decision key and return the decision.- Parameters:
tenantId- the tenant the decision belongs todecisionKey- the key of the decision- Returns:
- the decision, or
Optional.empty()if no decision is deployed with the given key
-
findDecisionByIdAndDeploymentKey
Optional<PersistedDecision> findDecisionByIdAndDeploymentKey(String tenantId, org.agrona.DirectBuffer decisionId, long deploymentKey) Query decisions by the given decision id and deployment key and return the decision.- Parameters:
tenantId- the tenant the decision belongs todecisionId- the id of the decisiondeploymentKey- the key of the deployment the decision was deployed with- Returns:
- the decision, or
Optional.empty()if no decision with the given id was deployed with the given deployment
-
findDecisionByIdAndVersionTag
Optional<PersistedDecision> findDecisionByIdAndVersionTag(String tenantId, org.agrona.DirectBuffer decisionId, String versionTag) Query decisions by the given decision id and version tag and return the decision.- Parameters:
tenantId- the tenant the decision belongs todecisionId- the id of the decisionversionTag- the version tag of the decision- Returns:
- the decision, or
Optional.empty()if no decision with the given id and version tag is deployed
-
findLatestDecisionRequirementsByTenantAndId
Optional<DeployedDrg> findLatestDecisionRequirementsByTenantAndId(String tenantId, org.agrona.DirectBuffer decisionRequirementsId) Query decision requirements (DRGs) by the given decision requirements id and return the latest version of the DRG.- Parameters:
tenantId- the tenant the DRG belongs todecisionRequirementsId- the id of the DRG- Returns:
- the latest version of the DRG, or
Optional.empty()if no DRG is deployed with the given id
-
findDecisionRequirementsByTenantAndKey
Optional<DeployedDrg> findDecisionRequirementsByTenantAndKey(String tenantId, long decisionRequirementsKey) Query decision requirements (DRGs) by the given decision requirements key.- Parameters:
tenantId- the tenant the DRG belongs todecisionRequirementsKey- the key of the DRG- Returns:
- the DRG, or
Optional.empty()if no DRG is deployed with the given key
-
findDecisionsByTenantAndDecisionRequirementsKey
List<PersistedDecision> findDecisionsByTenantAndDecisionRequirementsKey(String tenantId, long decisionRequirementsKey) Query decisions by the given decision requirements (DRG) key.- Parameters:
tenantId- the tenant the DRG belongs todecisionRequirementsKey- the key of the DRG- Returns:
- all decisions that belong to the given DRG, or an empty list if no decision belongs to it
-
clearCache
void clearCache()Completely clears all caches.
-