Spaces:
Build error
Build error
File size: 2,991 Bytes
9373c61 5cfe5c4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
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;
}
@Override
public String toString() {
return "PolicyActionEvent{" +
"eventId=" + eventId +
", policyId='" + policyId + '\'' +
", policyName='" + policyName + '\'' +
", targetAssetId='" + targetAssetId + '\'' +
", actionType='" + actionType + '\'' +
", actionParameters=" + actionParameters +
", timestamp=" + timestamp +
", triggeredByEvaluationId=" + triggeredByEvaluationId +
'}';
}
} |