Spaces:
Build error
Build error
| package com.dalab.policyengine.event; | |
| import java.time.Instant; | |
| import java.util.Map; | |
| import java.util.UUID; | |
| // This DTO represents an action triggered by a policy evaluation, | |
| // to be published to a Kafka topic. | |
| public class PolicyActionEvent { | |
| private UUID eventId; | |
| private String policyId; | |
| private String policyName; | |
| private String targetAssetId; | |
| private String actionType; // e.g., "ADD_LABEL", "NOTIFY_EMAIL", "ARCHIVE_ASSET" | |
| private Map<String, Object> actionParameters; // Parameters for the action, e.g., {"labelName": "PII", "confidence": 0.9} or {"to": "user@example.com", "subject": "Alert"} | |
| private Instant timestamp; | |
| private UUID triggeredByEvaluationId; // Link back to the PolicyEvaluation record | |
| public PolicyActionEvent() { | |
| this.eventId = UUID.randomUUID(); | |
| this.timestamp = Instant.now(); | |
| } | |
| // Getters and Setters | |
| public UUID getEventId() { | |
| return eventId; | |
| } | |
| public void setEventId(UUID eventId) { | |
| this.eventId = eventId; | |
| } | |
| public String getPolicyId() { | |
| return policyId; | |
| } | |
| public void setPolicyId(String policyId) { | |
| this.policyId = policyId; | |
| } | |
| public String getPolicyName() { | |
| return policyName; | |
| } | |
| public void setPolicyName(String policyName) { | |
| this.policyName = policyName; | |
| } | |
| public String getTargetAssetId() { | |
| return targetAssetId; | |
| } | |
| public void setTargetAssetId(String targetAssetId) { | |
| this.targetAssetId = targetAssetId; | |
| } | |
| public String getActionType() { | |
| return actionType; | |
| } | |
| public void setActionType(String actionType) { | |
| this.actionType = actionType; | |
| } | |
| public Map<String, Object> getActionParameters() { | |
| return actionParameters; | |
| } | |
| public void setActionParameters(Map<String, Object> actionParameters) { | |
| this.actionParameters = actionParameters; | |
| } | |
| public Instant getTimestamp() { | |
| return timestamp; | |
| } | |
| public void setTimestamp(Instant timestamp) { | |
| this.timestamp = timestamp; | |
| } | |
| public UUID getTriggeredByEvaluationId() { | |
| return triggeredByEvaluationId; | |
| } | |
| public void setTriggeredByEvaluationId(UUID triggeredByEvaluationId) { | |
| this.triggeredByEvaluationId = triggeredByEvaluationId; | |
| } | |
| public String toString() { | |
| return "PolicyActionEvent{" + | |
| "eventId=" + eventId + | |
| ", policyId='" + policyId + '\'' + | |
| ", policyName='" + policyName + '\'' + | |
| ", targetAssetId='" + targetAssetId + '\'' + | |
| ", actionType='" + actionType + '\'' + | |
| ", actionParameters=" + actionParameters + | |
| ", timestamp=" + timestamp + | |
| ", triggeredByEvaluationId=" + triggeredByEvaluationId + | |
| '}'; | |
| } | |
| } |