diff --git a/src/main/java/io/cryostat/recordings/RecordingHelper.java b/src/main/java/io/cryostat/recordings/RecordingHelper.java index 2da0b3c10..04dc82cbd 100644 --- a/src/main/java/io/cryostat/recordings/RecordingHelper.java +++ b/src/main/java/io/cryostat/recordings/RecordingHelper.java @@ -18,6 +18,7 @@ import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; +import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.net.URLDecoder; @@ -875,10 +876,22 @@ public ArchivedRecording archiveRecording( throw e; } if (expiry == null) { + ArchivedRecording archivedRecording = + new ArchivedRecording( + recording.target.jvmId, + filename, + downloadUrl(recording.target.jvmId, filename), + reportUrl(recording.target.jvmId, filename), + recording.metadata, + accum, + now.getEpochSecond()); + + URI connectUrl = recording.target.connectUrl; + var event = - new ActiveRecordingEvent( - Recordings.RecordingEventCategory.ACTIVE_SAVED, - ActiveRecordingEvent.Payload.of(this, recording)); + new ArchivedRecordingEvent( + Recordings.RecordingEventCategory.ARCHIVED_CREATED, + ArchivedRecordingEvent.Payload.of(connectUrl, archivedRecording)); bus.publish(event.category().category(), event.payload().recording()); bus.publish( MessagingServer.class.getName(),