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 voidclose()WXMClientConfigurationconfiguration()java.lang.StringtoString()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.voidvmDefine(WXMVirtualMachine machine)Define a new virtual machine.voidvmDefineAll(WXMVirtualMachineSet machines)Define a set of new virtual machines.voidvmDelete(java.util.UUID id)Delete the configuration for a virtual machine.WXMVirtualMachinevmFind(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.WXMVirtualMachineSetvmList()List the available virtual machines.voidvmRealize(WXMVirtualMachine machine, WXMDryRun dryRun)Realize a virtual machine.voidvmRun(WXMVirtualMachine machine, WXMBootConfigurationName bootConfigurationName, WXMDryRun dryRun)Start a virtual machine.voidvmUpdate(WXMVirtualMachine machine)Update an existing virtual machine.
-
Constructor Details
-
WXMClient
public WXMClient(WXMClientConfiguration inConfiguration, WXMVirtualMachineDatabaseType inDatabase, WXMProcessesType inProcesses)
-
-
Method Details
-
close
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceWXMClientType- Throws:
WXMException
-
vmList
Description copied from interface:WXMClientTypeList the available virtual machines.- Specified by:
vmListin interfaceWXMClientType- Returns:
- A set of machines
- Throws:
WXMException- On errors
-
vmFind
Description copied from interface:WXMClientTypeFind a virtual machine with the given ID.- Specified by:
vmFindin interfaceWXMClientType- Parameters:
id- The ID of the machine- Returns:
- A virtual machine
- Throws:
WXMException- On errors
-
vmFindOptional
Description copied from interface:WXMClientTypeFind a virtual machine with the given ID.- Specified by:
vmFindOptionalin interfaceWXMClientType- Parameters:
id- The ID of the machine- Returns:
- A virtual machine, if one exists
- Throws:
WXMException- On errors
-
vmDefine
Description copied from interface:WXMClientTypeDefine a new virtual machine.- Specified by:
vmDefinein interfaceWXMClientType- Parameters:
machine- The virtual machine- Throws:
WXMException- On errors
-
vmRun
public void vmRun(WXMVirtualMachine machine, WXMBootConfigurationName bootConfigurationName, WXMDryRun dryRun) throws WXMException, java.lang.InterruptedExceptionDescription copied from interface:WXMClientTypeStart 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:
vmRunin interfaceWXMClientType- Parameters:
machine- The virtual machinebootConfigurationName- The boot configuration useddryRun- Whether or not the operation is a dry run- Throws:
WXMException- On errorsjava.lang.InterruptedException- If the operation was interrupted
-
vmDelete
Description copied from interface:WXMClientTypeDelete the configuration for a virtual machine.- Specified by:
vmDeletein interfaceWXMClientType- Parameters:
id- The machine ID- Throws:
WXMException- On errors
-
vmConsoleGet
Description copied from interface:WXMClientTypeReturn 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:
vmConsoleGetin interfaceWXMClientType- Parameters:
machine- The virtual machine- Returns:
- A process execution
-
vmConsole
Description copied from interface:WXMClientTypeReturn 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:
vmConsolein interfaceWXMClientType- Parameters:
machine- The virtual machine- Returns:
- A process execution
-
vmRealize
Description copied from interface:WXMClientTypeRealize a virtual machine.- Specified by:
vmRealizein interfaceWXMClientType- Parameters:
machine- The virtual machinedryRun- Whether or not the operation is a dry run- Throws:
WXMException- On errors
-
vmUpdate
Description copied from interface:WXMClientTypeUpdate an existing virtual machine.- Specified by:
vmUpdatein interfaceWXMClientType- Parameters:
machine- The virtual machine- Throws:
WXMException- On errors
-
configuration
- Specified by:
configurationin interfaceWXMClientType- Returns:
- The configuration used to open the client
-
vmDefineAll
Description copied from interface:WXMClientTypeDefine a set of new virtual machines.- Specified by:
vmDefineAllin interfaceWXMClientType- Parameters:
machines- The virtual machine- Throws:
WXMException- On errors
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-