package com.dalab.policyengine.dto; import java.time.Instant; import java.util.Map; import java.util.UUID; import com.dalab.policyengine.model.EventSeverity; import com.dalab.policyengine.model.EventType; /** * DTO for streaming events in real-time to the Event Center UI. */ public class EventStreamDTO { private UUID eventId; private EventType eventType; private EventSeverity severity; private String sourceService; private String title; private String description; private UUID assetId; private String assetName; private UUID policyId; private String policyName; private Map eventData; private Map metadata; private Instant timestamp; private UUID userId; private String userAction; // Event processing information private Boolean isProcessed; private Integer matchingSubscriptionsCount; private Boolean notificationSent; private Boolean actionTriggered; // Constructors public EventStreamDTO() {} public EventStreamDTO(UUID eventId, EventType eventType, EventSeverity severity, String sourceService) { this.eventId = eventId; this.eventType = eventType; this.severity = severity; this.sourceService = sourceService; this.timestamp = Instant.now(); } // Getters and Setters public UUID getEventId() { return eventId; } public void setEventId(UUID eventId) { this.eventId = eventId; } public EventType getEventType() { return eventType; } public void setEventType(EventType eventType) { this.eventType = eventType; } public EventSeverity getSeverity() { return severity; } public void setSeverity(EventSeverity severity) { this.severity = severity; } public String getSourceService() { return sourceService; } public void setSourceService(String sourceService) { this.sourceService = sourceService; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public UUID getAssetId() { return assetId; } public void setAssetId(UUID assetId) { this.assetId = assetId; } public String getAssetName() { return assetName; } public void setAssetName(String assetName) { this.assetName = assetName; } public UUID getPolicyId() { return policyId; } public void setPolicyId(UUID policyId) { this.policyId = policyId; } public String getPolicyName() { return policyName; } public void setPolicyName(String policyName) { this.policyName = policyName; } public Map getEventData() { return eventData; } public void setEventData(Map eventData) { this.eventData = eventData; } public Map getMetadata() { return metadata; } public void setMetadata(Map metadata) { this.metadata = metadata; } public Instant getTimestamp() { return timestamp; } public void setTimestamp(Instant timestamp) { this.timestamp = timestamp; } public UUID getUserId() { return userId; } public void setUserId(UUID userId) { this.userId = userId; } public String getUserAction() { return userAction; } public void setUserAction(String userAction) { this.userAction = userAction; } public Boolean getIsProcessed() { return isProcessed; } public void setIsProcessed(Boolean isProcessed) { this.isProcessed = isProcessed; } public Integer getMatchingSubscriptionsCount() { return matchingSubscriptionsCount; } public void setMatchingSubscriptionsCount(Integer matchingSubscriptionsCount) { this.matchingSubscriptionsCount = matchingSubscriptionsCount; } public Boolean getNotificationSent() { return notificationSent; } public void setNotificationSent(Boolean notificationSent) { this.notificationSent = notificationSent; } public Boolean getActionTriggered() { return actionTriggered; } public void setActionTriggered(Boolean actionTriggered) { this.actionTriggered = actionTriggered; } @Override public String toString() { return "EventStreamDTO{" + "eventId=" + eventId + ", eventType=" + eventType + ", severity=" + severity + ", sourceService='" + sourceService + '\'' + ", title='" + title + '\'' + ", assetId=" + assetId + ", policyId=" + policyId + ", timestamp=" + timestamp + ", isProcessed=" + isProcessed + '}'; } }