Skip to content

Commit

Permalink
use ArchiveRecordingEvent instead of Active
Browse files Browse the repository at this point in the history
  • Loading branch information
aali309 authored and andrewazores committed May 30, 2024
1 parent 72dbe66 commit 91dda27
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/main/java/io/cryostat/recordings/RecordingHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit 91dda27

Please sign in to comment.