diff --git a/org.jdrupes.vmoperator.manager/src/org/jdrupes/vmoperator/manager/VmMonitor.java b/org.jdrupes.vmoperator.manager/src/org/jdrupes/vmoperator/manager/VmMonitor.java index f729240..7470f4e 100644 --- a/org.jdrupes.vmoperator.manager/src/org/jdrupes/vmoperator/manager/VmMonitor.java +++ b/org.jdrupes.vmoperator.manager/src/org/jdrupes/vmoperator/manager/VmMonitor.java @@ -310,8 +310,7 @@ public class VmMonitor extends event.setResult(new VmData(vmDef, chosenVm)); // Make sure that a newly assigned VM is running. - chosenVm.pipeline().fire(new ModifyVm(vmDef.name(), - "state", "Running", chosenVm)); + chosenVm.fire(new ModifyVm(vmDef.name(), "state", "Running")); return; } } diff --git a/org.jdrupes.vmoperator.vmaccess/src/org/jdrupes/vmoperator/vmaccess/VmAccess.java b/org.jdrupes.vmoperator.vmaccess/src/org/jdrupes/vmoperator/vmaccess/VmAccess.java index 91642f1..d3de96e 100644 --- a/org.jdrupes.vmoperator.vmaccess/src/org/jdrupes/vmoperator/vmaccess/VmAccess.java +++ b/org.jdrupes.vmoperator.vmaccess/src/org/jdrupes/vmoperator/vmaccess/VmAccess.java @@ -129,6 +129,7 @@ public class VmAccess extends FreeMarkerConlet { private EventPipeline appPipeline; private static ObjectMapper objectMapper = new ObjectMapper().registerModule(new JavaTimeModule()); + private Class preferredIpVersion = Inet4Address.class; private Set syncUsers = Collections.emptySet(); private Set syncRoles = Collections.emptySet(); @@ -785,12 +786,12 @@ public class VmAccess extends FreeMarkerConlet { switch (event.method()) { case "start": if (perms.contains(VmDefinition.Permission.START)) { - fire(new ModifyVm(vmName, "state", "Running", vmChannel)); + vmChannel.fire(new ModifyVm(vmName, "state", "Running")); } break; case "stop": if (perms.contains(VmDefinition.Permission.STOP)) { - fire(new ModifyVm(vmName, "state", "Stopped", vmChannel)); + vmChannel.fire(new ModifyVm(vmName, "state", "Stopped")); } break; case "reset": @@ -800,7 +801,7 @@ public class VmAccess extends FreeMarkerConlet { break; case "resetConfirmed": if (perms.contains(VmDefinition.Permission.RESET)) { - fire(new ResetVm(vmName), vmChannel); + vmChannel.fire(new ResetVm(vmName)); } break; case "openConsole": @@ -838,7 +839,7 @@ public class VmAccess extends FreeMarkerConlet { } var pwQuery = Event.onCompletion(new GetDisplaySecret(vmDef, user), e -> gotPassword(channel, model, vmDef, e)); - fire(pwQuery, vmChannel); + vmChannel.fire(pwQuery); } private void gotPassword(ConsoleConnection channel, ResourceModel model, diff --git a/org.jdrupes.vmoperator.vmmgmt/src/org/jdrupes/vmoperator/vmmgmt/VmMgmt.java b/org.jdrupes.vmoperator.vmmgmt/src/org/jdrupes/vmoperator/vmmgmt/VmMgmt.java index 3d58d09..f1c5d70 100644 --- a/org.jdrupes.vmoperator.vmmgmt/src/org/jdrupes/vmoperator/vmmgmt/VmMgmt.java +++ b/org.jdrupes.vmoperator.vmmgmt/src/org/jdrupes/vmoperator/vmmgmt/VmMgmt.java @@ -423,12 +423,12 @@ public class VmMgmt extends FreeMarkerConlet { switch (event.method()) { case "start": if (perms.contains(VmDefinition.Permission.START)) { - fire(new ModifyVm(vmName, "state", "Running", vmChannel)); + vmChannel.fire(new ModifyVm(vmName, "state", "Running")); } break; case "stop": if (perms.contains(VmDefinition.Permission.STOP)) { - fire(new ModifyVm(vmName, "state", "Stopped", vmChannel)); + vmChannel.fire(new ModifyVm(vmName, "state", "Stopped")); } break; case "reset": @@ -438,22 +438,20 @@ public class VmMgmt extends FreeMarkerConlet { break; case "resetConfirmed": if (perms.contains(VmDefinition.Permission.RESET)) { - fire(new ResetVm(vmName), vmChannel); + vmChannel.fire(new ResetVm(vmName)); } break; case "openConsole": openConsole(channel, model, vmChannel, vmDef, user, perms); break; case "cpus": - fire(new ModifyVm(vmName, "currentCpus", - new BigDecimal(event.param(1).toString()).toBigInteger(), - vmChannel)); + vmChannel.fire(new ModifyVm(vmName, "currentCpus", + new BigDecimal(event.param(1).toString()).toBigInteger())); break; case "ram": - fire(new ModifyVm(vmName, "currentRam", + vmChannel.fire(new ModifyVm(vmName, "currentRam", new Quantity(new BigDecimal(event.param(1).toString()), - Format.BINARY_SI).toSuffixedString(), - vmChannel)); + Format.BINARY_SI).toSuffixedString())); break; default:// ignore break; @@ -488,7 +486,7 @@ public class VmMgmt extends FreeMarkerConlet { } var pwQuery = Event.onCompletion(new GetDisplaySecret(vmDef, user), e -> gotPassword(channel, model, vmDef, e)); - fire(pwQuery, vmChannel); + vmChannel.fire(pwQuery); } private void gotPassword(ConsoleConnection channel, VmsModel model,