diff --git a/src/main/java/io/cryostat/core/net/CryostatFlightRecorderService.java b/src/main/java/io/cryostat/core/net/CryostatFlightRecorderService.java index 25ef2327..2215c296 100644 --- a/src/main/java/io/cryostat/core/net/CryostatFlightRecorderService.java +++ b/src/main/java/io/cryostat/core/net/CryostatFlightRecorderService.java @@ -32,33 +32,20 @@ import io.cryostat.core.EventOptionsBuilder.EventOptionException; import io.cryostat.core.EventOptionsBuilder.EventTypeException; import io.cryostat.core.templates.Template; -import io.cryostat.core.templates.TemplateType; - -import org.jsoup.nodes.Document; public interface CryostatFlightRecorderService extends IFlightRecorderService { - IRecordingDescriptor start( - IConstrainedMap recordingOptions, - String templateName, - TemplateType preferredTemplateType) + IRecordingDescriptor start(IConstrainedMap recordingOptions, Template eventTemplate) throws io.cryostat.core.FlightRecorderException, FlightRecorderException, - ConnectionException, IOException, FlightRecorderException, + ConnectionException, ParseException, IOException, FlightRecorderException, ServiceNotAvailableException, QuantityConversionException, EventOptionException, EventTypeException; - default IRecordingDescriptor start( - IConstrainedMap recordingOptions, Template eventTemplate) + default IRecordingDescriptor start(IConstrainedMap recordingOptions, String template) throws io.cryostat.core.FlightRecorderException, FlightRecorderException, - ConnectionException, IOException, FlightRecorderException, - ServiceNotAvailableException, QuantityConversionException, EventOptionException, - EventTypeException { - return start(recordingOptions, eventTemplate.getName(), eventTemplate.getType()); - } - - default IRecordingDescriptor start(IConstrainedMap recordingOptions, Document template) - throws FlightRecorderException, ParseException, IOException { - XMLModel model = EventConfiguration.createModel(template.toString()); + ConnectionException, ParseException, IOException, ServiceNotAvailableException, + QuantityConversionException, EventOptionException, EventTypeException { + XMLModel model = EventConfiguration.createModel(template); IConstrainedMap eventOptions = new EventConfiguration(model) .getEventOptions(getDefaultEventOptions().emptyWithSameConstraints()); diff --git a/src/main/java/io/cryostat/core/net/JmxFlightRecorderService.java b/src/main/java/io/cryostat/core/net/JmxFlightRecorderService.java index c4237200..1023e1b9 100644 --- a/src/main/java/io/cryostat/core/net/JmxFlightRecorderService.java +++ b/src/main/java/io/cryostat/core/net/JmxFlightRecorderService.java @@ -229,16 +229,13 @@ public IDescribedMap getDefaultEventOptions() { } @Override - public IRecordingDescriptor start( - IConstrainedMap recordingOptions, - String templateName, - TemplateType preferredTemplateType) + public IRecordingDescriptor start(IConstrainedMap recordingOptions, Template template) throws io.cryostat.core.FlightRecorderException, FlightRecorderException, ConnectionException, IOException, FlightRecorderException, ServiceNotAvailableException, QuantityConversionException, EventOptionException, EventTypeException { return tryConnect() - .start(recordingOptions, enableEvents(templateName, preferredTemplateType)); + .start(recordingOptions, enableEvents(template.getName(), template.getType())); } private IConstrainedMap enableEvents(