Javadoc fixes.
This commit is contained in:
parent
a2f00eb1ec
commit
3e43d02931
23 changed files with 50 additions and 149 deletions
|
|
@ -27,7 +27,6 @@ import org.jdrupes.vmoperator.runner.qemu.commands.QmpOpenTray;
|
|||
import org.jdrupes.vmoperator.runner.qemu.commands.QmpRemoveMedium;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.ConfigureQemu;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.MonitorCommand;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.MonitorResult;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.RunnerStateChange.State;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.TrayMovedEvent;
|
||||
import org.jgrapes.core.Channel;
|
||||
|
|
@ -55,7 +54,6 @@ public class CdMediaController extends Component {
|
|||
* Instantiates a new cdrom controller.
|
||||
*
|
||||
* @param componentChannel the component channel
|
||||
* @param monitor the monitor
|
||||
*/
|
||||
@SuppressWarnings("PMD.AssignmentToNonFinalStatic")
|
||||
public CdMediaController(Channel componentChannel) {
|
||||
|
|
@ -120,29 +118,4 @@ public class CdMediaController extends Component {
|
|||
changeMedium(event.driveId());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* On monitor result.
|
||||
*
|
||||
* @param result the result
|
||||
*/
|
||||
@Handler
|
||||
public void onMonitorResult(MonitorResult result) {
|
||||
if (result.executed() instanceof QmpOpenTray) {
|
||||
// if (!result.executed().equals(changeMedium.get("execute").asText())
|
||||
// && !result.executed()
|
||||
// .equals(removeMedium.get("execute").asText())) {
|
||||
// return;
|
||||
// }
|
||||
// String drive = result.arguments().get("id").asText();
|
||||
// String newFile = pending.get(drive);
|
||||
// if (newFile == null) {
|
||||
// return;
|
||||
// }
|
||||
// if (result.successful()) {
|
||||
// fire(new MonitorCommandCompleted(CHANGE_MEDIUM, drive, newFile));
|
||||
// pending.remove(drive);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import org.jdrupes.vmoperator.runner.qemu.commands.QmpQueryHotpluggableCpus;
|
|||
import org.jdrupes.vmoperator.runner.qemu.events.ConfigureQemu;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.CpuAdded;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.CpuDeleted;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.HotpluggableCpuResult;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.HotpluggableCpuStatus;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.MonitorCommand;
|
||||
import org.jgrapes.core.Channel;
|
||||
import org.jgrapes.core.Component;
|
||||
|
|
@ -50,7 +50,6 @@ public class CpuController extends Component {
|
|||
* Instantiates a new CPU controller.
|
||||
*
|
||||
* @param componentChannel the component channel
|
||||
* @param monitor the monitor
|
||||
*/
|
||||
public CpuController(Channel componentChannel) {
|
||||
super(componentChannel);
|
||||
|
|
@ -81,7 +80,7 @@ public class CpuController extends Component {
|
|||
* @param result the result
|
||||
*/
|
||||
@Handler
|
||||
public void onHotpluggableCpuResult(HotpluggableCpuResult result) {
|
||||
public void onHotpluggableCpuStatus(HotpluggableCpuStatus result) {
|
||||
// Sort
|
||||
List<ObjectNode> used = new ArrayList<>();
|
||||
List<ObjectNode> unused = new ArrayList<>();
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ public class RamController extends Component {
|
|||
* Instantiates a new CPU controller.
|
||||
*
|
||||
* @param componentChannel the component channel
|
||||
* @param monitor the monitor
|
||||
*/
|
||||
@SuppressWarnings("PMD.AssignmentToNonFinalStatic")
|
||||
public RamController(Channel componentChannel) {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import com.fasterxml.jackson.databind.JsonNode;
|
|||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
|
||||
/**
|
||||
* The Class QmpAddCpu.
|
||||
* A {@link QmpCommand} that plugs a CPU into an unused slot.
|
||||
*/
|
||||
public class QmpAddCpu extends QmpCommand {
|
||||
|
||||
|
|
@ -41,11 +41,6 @@ public class QmpAddCpu extends QmpCommand {
|
|||
this.cpuId = cpuId;
|
||||
}
|
||||
|
||||
/**
|
||||
* To Json.
|
||||
*
|
||||
* @return the json node
|
||||
*/
|
||||
@Override
|
||||
public JsonNode toJson() {
|
||||
ObjectNode cmd = mapper.createObjectNode();
|
||||
|
|
@ -58,11 +53,6 @@ public class QmpAddCpu extends QmpCommand {
|
|||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "QmpAddCpu(" + unused.get("type") + ", " + cpuId + ")";
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ package org.jdrupes.vmoperator.runner.qemu.commands;
|
|||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
|
||||
/**
|
||||
* The Class QmpCapabilities.
|
||||
* A {@link QmpCommand} that configures the Qmp capabilities.
|
||||
*/
|
||||
public class QmpCapabilities extends QmpCommand {
|
||||
|
||||
|
|
@ -30,21 +30,11 @@ public class QmpCapabilities extends QmpCommand {
|
|||
private static final JsonNode jsonTemplate
|
||||
= parseJson("{ \"execute\": \"qmp_capabilities\" }");
|
||||
|
||||
/**
|
||||
* To Json.
|
||||
*
|
||||
* @return the json node
|
||||
*/
|
||||
@Override
|
||||
public JsonNode toJson() {
|
||||
return jsonTemplate.deepCopy();
|
||||
}
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "QmpCapabilities()";
|
||||
|
|
|
|||
|
|
@ -21,8 +21,9 @@ package org.jdrupes.vmoperator.runner.qemu.commands;
|
|||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
|
||||
// TODO: Auto-generated Javadoc
|
||||
/**
|
||||
* The Class QmpChangeMedium.
|
||||
* A {@link QmpCommand} that triggers a media change in a CDROM drive.
|
||||
*/
|
||||
public class QmpChangeMedium extends QmpCommand {
|
||||
|
||||
|
|
@ -36,20 +37,16 @@ public class QmpChangeMedium extends QmpCommand {
|
|||
private final String file;
|
||||
|
||||
/**
|
||||
* Instantiates a new sets the current ram.
|
||||
* Instantiates a new qmp change medium.
|
||||
*
|
||||
* @param driveId the drive id
|
||||
* @param file the file
|
||||
*/
|
||||
public QmpChangeMedium(String driveId, String file) {
|
||||
this.driveId = driveId;
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
/**
|
||||
* To Json.
|
||||
*
|
||||
* @return the json node
|
||||
*/
|
||||
@Override
|
||||
public JsonNode toJson() {
|
||||
var cmd = jsonTemplate.deepCopy();
|
||||
|
|
@ -58,11 +55,6 @@ public class QmpChangeMedium extends QmpCommand {
|
|||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "QmpRemoveMedium(" + driveId + ")";
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public abstract class QmpCommand {
|
|||
}
|
||||
|
||||
/**
|
||||
* To json.
|
||||
* Returns the Json to be sent to the Qemu process.
|
||||
*
|
||||
* @return the json node
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ package org.jdrupes.vmoperator.runner.qemu.commands;
|
|||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
|
||||
/**
|
||||
* The Class QmpCont.
|
||||
* A {@link QmpCommand} that causes the Qemu process to continue execution.
|
||||
*/
|
||||
public class QmpCont extends QmpCommand {
|
||||
|
||||
|
|
@ -30,21 +30,11 @@ public class QmpCont extends QmpCommand {
|
|||
private static final JsonNode jsonTemplate
|
||||
= parseJson("{ \"execute\": \"cont\" }");
|
||||
|
||||
/**
|
||||
* To Json.
|
||||
*
|
||||
* @return the json node
|
||||
*/
|
||||
@Override
|
||||
public JsonNode toJson() {
|
||||
return jsonTemplate.deepCopy();
|
||||
}
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "QmpCont()";
|
||||
|
|
|
|||
|
|
@ -21,8 +21,9 @@ package org.jdrupes.vmoperator.runner.qemu.commands;
|
|||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
|
||||
// TODO: Auto-generated Javadoc
|
||||
/**
|
||||
* The Class QmpDelCpu.
|
||||
* A {@link QmpCommand} that removes a CPU with the given id.
|
||||
*/
|
||||
public class QmpDelCpu extends QmpCommand {
|
||||
|
||||
|
|
@ -34,19 +35,14 @@ public class QmpDelCpu extends QmpCommand {
|
|||
private final String cpuId;
|
||||
|
||||
/**
|
||||
* Instantiates a new sets the current ram.
|
||||
* Instantiates a new qmp del cpu.
|
||||
*
|
||||
* @param size the size
|
||||
* @param cpuId the cpu id
|
||||
*/
|
||||
public QmpDelCpu(String cpuId) {
|
||||
this.cpuId = cpuId;
|
||||
}
|
||||
|
||||
/**
|
||||
* To Json.
|
||||
*
|
||||
* @return the json node
|
||||
*/
|
||||
@Override
|
||||
public JsonNode toJson() {
|
||||
var cmd = jsonTemplate.deepCopy();
|
||||
|
|
@ -54,11 +50,6 @@ public class QmpDelCpu extends QmpCommand {
|
|||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "QmpDelCpu(" + cpuId + ")";
|
||||
|
|
|
|||
|
|
@ -21,8 +21,9 @@ package org.jdrupes.vmoperator.runner.qemu.commands;
|
|||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
|
||||
// TODO: Auto-generated Javadoc
|
||||
/**
|
||||
* The Class QmpOpenTray.
|
||||
* A {@link QmpCommand} that causes a CDROM drive's tray to be opened.
|
||||
*/
|
||||
public class QmpOpenTray extends QmpCommand {
|
||||
|
||||
|
|
@ -34,7 +35,7 @@ public class QmpOpenTray extends QmpCommand {
|
|||
private final String driveId;
|
||||
|
||||
/**
|
||||
* Instantiates a new sets the current ram.
|
||||
* Instantiates a new qmp open tray.
|
||||
*
|
||||
* @param driveId the drive id
|
||||
*/
|
||||
|
|
@ -42,11 +43,6 @@ public class QmpOpenTray extends QmpCommand {
|
|||
this.driveId = driveId;
|
||||
}
|
||||
|
||||
/**
|
||||
* To Json.
|
||||
*
|
||||
* @return the json node
|
||||
*/
|
||||
@Override
|
||||
public JsonNode toJson() {
|
||||
var cmd = jsonTemplate.deepCopy();
|
||||
|
|
@ -54,11 +50,6 @@ public class QmpOpenTray extends QmpCommand {
|
|||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "QmpOpenTray(" + driveId + ")";
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ package org.jdrupes.vmoperator.runner.qemu.commands;
|
|||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
|
||||
/**
|
||||
* The Class QmpSetBalloon.
|
||||
* A {@link QmpCommand} that send a powerdown to the VM.
|
||||
*/
|
||||
public class QmpPowerdown extends QmpCommand {
|
||||
|
||||
|
|
@ -30,11 +30,6 @@ public class QmpPowerdown extends QmpCommand {
|
|||
private static final JsonNode jsonTemplate
|
||||
= parseJson("{ \"execute\": \"system_powerdown\" }");
|
||||
|
||||
/**
|
||||
* To Json.
|
||||
*
|
||||
* @return the json node
|
||||
*/
|
||||
@Override
|
||||
public JsonNode toJson() {
|
||||
return jsonTemplate.deepCopy();
|
||||
|
|
|
|||
|
|
@ -20,9 +20,8 @@ package org.jdrupes.vmoperator.runner.qemu.commands;
|
|||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
|
||||
// TODO: Auto-generated Javadoc
|
||||
/**
|
||||
* The Class QmpQueryHotpluggableCpus.
|
||||
* A {@link QmpCommand} that queries the hotpluggable CPUs.
|
||||
*/
|
||||
public class QmpQueryHotpluggableCpus extends QmpCommand {
|
||||
|
||||
|
|
@ -31,21 +30,11 @@ public class QmpQueryHotpluggableCpus extends QmpCommand {
|
|||
private static final JsonNode jsonTemplate = parseJson(
|
||||
"{\"execute\":\"query-hotpluggable-cpus\",\"arguments\":{}}");
|
||||
|
||||
/**
|
||||
* To Json.
|
||||
*
|
||||
* @return the json node
|
||||
*/
|
||||
@Override
|
||||
public JsonNode toJson() {
|
||||
return jsonTemplate.deepCopy();
|
||||
}
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "QmpQueryHotpluggableCpus()";
|
||||
|
|
|
|||
|
|
@ -21,8 +21,9 @@ package org.jdrupes.vmoperator.runner.qemu.commands;
|
|||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
|
||||
// TODO: Auto-generated Javadoc
|
||||
/**
|
||||
* The Class QmpRemoveMedium.
|
||||
* A {@link QmpCommand} that removes the medium from a CDROM drive.
|
||||
*/
|
||||
public class QmpRemoveMedium extends QmpCommand {
|
||||
|
||||
|
|
@ -34,7 +35,7 @@ public class QmpRemoveMedium extends QmpCommand {
|
|||
private final String driveId;
|
||||
|
||||
/**
|
||||
* Instantiates a new sets the current ram.
|
||||
* Instantiates a new qmp remove medium.
|
||||
*
|
||||
* @param driveId the drive id
|
||||
*/
|
||||
|
|
@ -42,11 +43,6 @@ public class QmpRemoveMedium extends QmpCommand {
|
|||
this.driveId = driveId;
|
||||
}
|
||||
|
||||
/**
|
||||
* To Json.
|
||||
*
|
||||
* @return the json node
|
||||
*/
|
||||
@Override
|
||||
public JsonNode toJson() {
|
||||
var cmd = jsonTemplate.deepCopy();
|
||||
|
|
|
|||
|
|
@ -22,8 +22,9 @@ import com.fasterxml.jackson.databind.JsonNode;
|
|||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import java.math.BigInteger;
|
||||
|
||||
// TODO: Auto-generated Javadoc
|
||||
/**
|
||||
* The Class QmpSetBalloon.
|
||||
* A {@link QmpCommand} that sets the balloon value.
|
||||
*/
|
||||
public class QmpSetBalloon extends QmpCommand {
|
||||
|
||||
|
|
@ -35,17 +36,14 @@ public class QmpSetBalloon extends QmpCommand {
|
|||
private final BigInteger size;
|
||||
|
||||
/**
|
||||
* Instantiates a new sets the current ram.
|
||||
* Instantiates a new qmp set balloon.
|
||||
*
|
||||
* @param size the size
|
||||
*/
|
||||
public QmpSetBalloon(BigInteger size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
/**
|
||||
* To Json.
|
||||
*
|
||||
* @return the json node
|
||||
*/
|
||||
@Override
|
||||
public JsonNode toJson() {
|
||||
var cmd = jsonTemplate.deepCopy();
|
||||
|
|
|
|||
|
|
@ -24,7 +24,12 @@ import org.jgrapes.core.Channel;
|
|||
import org.jgrapes.core.Event;
|
||||
|
||||
/**
|
||||
* The Class ConfigureQemu.
|
||||
* An {@link Event} that notifies controllers about an updated
|
||||
* configuration. Controllers should adapt the resource that they
|
||||
* manage to the new configuration. If the adaption cannot be
|
||||
* made by the handler alone, it should call {@link Event#suspendHandling()}
|
||||
* on the event and only {@link Event#resumeHandling() resume handling}
|
||||
* when the adaption has completed.
|
||||
*/
|
||||
public class ConfigureQemu extends Event<Void> {
|
||||
|
||||
|
|
@ -32,7 +37,7 @@ public class ConfigureQemu extends Event<Void> {
|
|||
private final State state;
|
||||
|
||||
/**
|
||||
* Instantiates a new configure qemu.
|
||||
* Instantiates a new configuration event.
|
||||
*
|
||||
* @param channels the channels
|
||||
*/
|
||||
|
|
@ -53,7 +58,7 @@ public class ConfigureQemu extends Event<Void> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the runner's state.
|
||||
* Returns the runner's state when the event was fired.
|
||||
*
|
||||
* @return the state
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import com.fasterxml.jackson.databind.JsonNode;
|
|||
import org.jdrupes.vmoperator.runner.qemu.commands.QmpCommand;
|
||||
|
||||
/**
|
||||
* The Class CpuAdded.
|
||||
* A {@link MonitorResult} that indicates that a CPU has been added.
|
||||
*/
|
||||
public class CpuAdded extends MonitorResult {
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import com.fasterxml.jackson.databind.JsonNode;
|
|||
import org.jdrupes.vmoperator.runner.qemu.commands.QmpCommand;
|
||||
|
||||
/**
|
||||
* The Class CpuDeleted.
|
||||
* A {@link MonitorResult} that indicates that a CPU has been deleted.
|
||||
*/
|
||||
public class CpuDeleted extends MonitorResult {
|
||||
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ import com.fasterxml.jackson.databind.JsonNode;
|
|||
import org.jdrupes.vmoperator.runner.qemu.commands.QmpCommand;
|
||||
|
||||
/**
|
||||
* The Class HotpluggableCpuResult.
|
||||
* A {@link MonitorResult} that reports the hot pluggable CPU status.
|
||||
*/
|
||||
public class HotpluggableCpuResult extends MonitorResult {
|
||||
public class HotpluggableCpuStatus extends MonitorResult {
|
||||
|
||||
/**
|
||||
* Instantiates a new hotpluggable cpu result.
|
||||
|
|
@ -32,7 +32,7 @@ public class HotpluggableCpuResult extends MonitorResult {
|
|||
* @param command the command
|
||||
* @param response the response
|
||||
*/
|
||||
public HotpluggableCpuResult(QmpCommand command, JsonNode response) {
|
||||
public HotpluggableCpuStatus(QmpCommand command, JsonNode response) {
|
||||
super(command, response);
|
||||
}
|
||||
|
||||
|
|
@ -24,7 +24,8 @@ import org.jgrapes.core.Components;
|
|||
import org.jgrapes.core.Event;
|
||||
|
||||
/**
|
||||
* A command to be executed by the monitor.
|
||||
* An {@link Event} that causes some component to send a QMP
|
||||
* command to the Qemu process.
|
||||
*/
|
||||
public class MonitorCommand extends Event<Void> {
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@ import java.util.Optional;
|
|||
import org.jgrapes.core.Event;
|
||||
|
||||
/**
|
||||
* Signals the reception of an event from the monitor.
|
||||
* An {@link Event} that signals the reception of a QMP event from
|
||||
* the Qemu process.
|
||||
*/
|
||||
public class MonitorEvent extends Event<Void> {
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import org.jgrapes.core.Components;
|
|||
import org.jgrapes.core.Event;
|
||||
|
||||
/**
|
||||
* Signals the reception of a result from the monitor.
|
||||
* Signals the reception of a result from executing a QMP command.
|
||||
*/
|
||||
public class MonitorResult extends Event<Void> {
|
||||
|
||||
|
|
@ -44,7 +44,7 @@ public class MonitorResult extends Event<Void> {
|
|||
*/
|
||||
public static MonitorResult from(QmpCommand command, JsonNode response) {
|
||||
if (command instanceof QmpQueryHotpluggableCpus) {
|
||||
return new HotpluggableCpuResult(command, response);
|
||||
return new HotpluggableCpuStatus(command, response);
|
||||
}
|
||||
if (command instanceof QmpAddCpu) {
|
||||
return new CpuAdded(command, response);
|
||||
|
|
@ -58,7 +58,7 @@ public class MonitorResult extends Event<Void> {
|
|||
/**
|
||||
* Instantiates a new monitor result.
|
||||
*
|
||||
* @param executed the executed
|
||||
* @param command the command
|
||||
* @param response the response
|
||||
*/
|
||||
protected MonitorResult(QmpCommand command, JsonNode response) {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import com.fasterxml.jackson.databind.JsonNode;
|
|||
import org.jdrupes.vmoperator.runner.qemu.CdMediaController.TrayState;
|
||||
|
||||
/**
|
||||
* The Class TrayMovedEvent.
|
||||
* Signals a change of tray state of one of the VM's CDROM drives.
|
||||
*/
|
||||
public class TrayMovedEvent extends MonitorEvent {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue