Package com.io7m.waxmill.client.vanilla.internal

# Class WXMClient

java.lang.Object
com.io7m.waxmill.client.vanilla.internal.WXMClient

All Implemented Interfaces:
  `WXMClientType`, `java.lang.AutoCloseable`

    public final class WXMClient
    extends java.lang.Object
    implements WXMClientType

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `WXMClient​(WXMClientConfiguration inConfiguration, WXMVirtualMachineDatabaseType inDatabase, WXMProcessesType inProcesses)` |

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `void` | `close()` |
  `WXMClientConfiguration` | `configuration()` |
  `java.lang.String` | `toString()` |
  `java.util.Optional<WXMProcessDescription>` | `vmConsole​(WXMVirtualMachine machine)` | Return a process description that, when executed, will give access to the primary console of the given virtual machine.
  `java.util.Optional<WXMDeviceType>` | `vmConsoleGet​(WXMVirtualMachine machine)` | Return the primary console device of the given virtual machine.
  `void` | `vmDefine​(WXMVirtualMachine machine)` | Define a new virtual machine.
  `void` | `vmDefineAll​(WXMVirtualMachineSet machines)` | Define a set of new virtual machines.
  `void` | `vmDelete​(java.util.UUID id)` | Delete the configuration for a virtual machine.
  `WXMVirtualMachine` | `vmFind​(java.util.UUID id)` | Find a virtual machine with the given ID.
  `java.util.Optional<WXMVirtualMachine>` | `vmFindOptional​(java.util.UUID id)` | Find a virtual machine with the given ID.
  `void` | `vmKill​(WXMVirtualMachine machine, WXMDryRun dryRun)` | Kill a running virtual machine.
  `WXMVirtualMachineSet` | `vmList()` | List the available virtual machines.
  `void` | `vmRealize​(WXMVirtualMachine machine, WXMDryRun dryRun)` | Realize a virtual machine.
  `void` | `vmRun​(WXMVirtualMachine machine, WXMBootConfigurationName bootConfigurationName, WXMDryRun dryRun)` | Start a virtual machine.
  `void` | `vmUpdate​(WXMVirtualMachine machine)` | Update an existing virtual machine.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### WXMClient

    public WXMClient​(WXMClientConfiguration inConfiguration, WXMVirtualMachineDatabaseType inDatabase, WXMProcessesType inProcesses)

- ## Method Details

  - ### close

    public void close() throws WXMException
    Specified by:
      `close` in interface `java.lang.AutoCloseable`
    Specified by:
      `close` in interface `WXMClientType`
    Throws:
      `WXMException`

  - ### vmList

    public WXMVirtualMachineSet vmList() throws WXMException
    Description copied from interface: `WXMClientType`
    List the available virtual machines.
    Specified by:
      `vmList` in interface `WXMClientType`
    Returns:
      A set of machines
    Throws:
      `WXMException` - On errors

  - ### vmFind

    public WXMVirtualMachine vmFind​(java.util.UUID id) throws WXMException
    Description copied from interface: `WXMClientType`
    Find a virtual machine with the given ID.
    Specified by:
      `vmFind` in interface `WXMClientType`
    Parameters:
      `id` - The ID of the machine
    Returns:
      A virtual machine
    Throws:
      `WXMException` - On errors

  - ### vmFindOptional

    public java.util.Optional<WXMVirtualMachine> vmFindOptional​(java.util.UUID id) throws WXMException
    Description copied from interface: `WXMClientType`
    Find a virtual machine with the given ID.
    Specified by:
      `vmFindOptional` in interface `WXMClientType`
    Parameters:
      `id` - The ID of the machine
    Returns:
      A virtual machine, if one exists
    Throws:
      `WXMException` - On errors

  - ### vmDefine

    public void vmDefine​(WXMVirtualMachine machine) throws WXMException
    Description copied from interface: `WXMClientType`
    Define a new virtual machine.
    Specified by:
      `vmDefine` in interface `WXMClientType`
    Parameters:
      `machine` - The virtual machine
    Throws:
      `WXMException` - On errors

  - ### vmRun

    public void vmRun​(WXMVirtualMachine machine, WXMBootConfigurationName bootConfigurationName, WXMDryRun dryRun) throws WXMException, java.lang.InterruptedException
    Description copied from interface: `WXMClientType`
    Start a virtual machine. If the startup succeeds, this method never returns and the current process is replaced with that of the running virtual machine.
    Specified by:
      `vmRun` in interface `WXMClientType`
    Parameters:
      `machine` - The virtual machine
      `bootConfigurationName` - The boot configuration used
      `dryRun` - Whether or not the operation is a dry run
    Throws:
      `WXMException` - On errors
      `java.lang.InterruptedException` - If the operation was interrupted

  - ### vmKill

    public void vmKill​(WXMVirtualMachine machine, WXMDryRun dryRun) throws WXMException
    Description copied from interface: `WXMClientType`
    Kill a running virtual machine.
    Specified by:
      `vmKill` in interface `WXMClientType`
    Parameters:
      `machine` - The virtual machine
      `dryRun` - Whether or not the operation is a dry run
    Throws:
      `WXMException`

  - ### vmDelete

    public void vmDelete​(java.util.UUID id) throws WXMException
    Description copied from interface: `WXMClientType`
    Delete the configuration for a virtual machine.
    Specified by:
      `vmDelete` in interface `WXMClientType`
    Parameters:
      `id` - The machine ID
    Throws:
      `WXMException` - On errors

  - ### vmConsoleGet

    public java.util.Optional<WXMDeviceType> vmConsoleGet​(WXMVirtualMachine machine)
    Description copied from interface: `WXMClientType`
    Return the primary console device of the given virtual machine. The method will return nothing if the machine has no console device, or if the machine has more than one potential console.
    Specified by:
      `vmConsoleGet` in interface `WXMClientType`
    Parameters:
      `machine` - The virtual machine
    Returns:
      A process execution

  - ### vmConsole

    public java.util.Optional<WXMProcessDescription> vmConsole​(WXMVirtualMachine machine)
    Description copied from interface: `WXMClientType`
    Return a process description that, when executed, will give access to the primary console of the given virtual machine. The method will return nothing if the machine has no console device, or if the machine has more than one potential console.
    Specified by:
      `vmConsole` in interface `WXMClientType`
    Parameters:
      `machine` - The virtual machine
    Returns:
      A process execution

  - ### vmRealize

    public void vmRealize​(WXMVirtualMachine machine, WXMDryRun dryRun) throws WXMException
    Description copied from interface: `WXMClientType`
    Realize a virtual machine.
    Specified by:
      `vmRealize` in interface `WXMClientType`
    Parameters:
      `machine` - The virtual machine
      `dryRun` - Whether or not the operation is a dry run
    Throws:
      `WXMException` - On errors

  - ### vmUpdate

    public void vmUpdate​(WXMVirtualMachine machine) throws WXMException
    Description copied from interface: `WXMClientType`
    Update an existing virtual machine.
    Specified by:
      `vmUpdate` in interface `WXMClientType`
    Parameters:
      `machine` - The virtual machine
    Throws:
      `WXMException` - On errors

  - ### configuration

    public WXMClientConfiguration configuration()
    Specified by:
      `configuration` in interface `WXMClientType`
    Returns:
      The configuration used to open the client

  - ### vmDefineAll

    public void vmDefineAll​(WXMVirtualMachineSet machines) throws WXMException
    Description copied from interface: `WXMClientType`
    Define a set of new virtual machines.
    Specified by:
      `vmDefineAll` in interface `WXMClientType`
    Parameters:
      `machines` - The virtual machine
    Throws:
      `WXMException` - On errors

  - ### toString

    public java.lang.String toString()
    Overrides:
      `toString` in class `java.lang.Object`