Package com.io7m.waxmill.client.api
Class WXMClientConfiguration
java.lang.Object
com.io7m.waxmill.client.api.WXMClientConfiguration
- All Implemented Interfaces:
WXMClientConfigurationType
public final class WXMClientConfiguration extends java.lang.Object implements WXMClientConfigurationType
Configuration values passed to the client.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWXMClientConfiguration.BuilderBuilds instances of typeWXMClientConfiguration. -
Method Summary
Modifier and Type Method Description java.nio.file.PathbhyveCtlExecutable()java.nio.file.PathbhyveExecutable()static WXMClientConfiguration.Builderbuilder()Creates a builder forWXMClientConfiguration.static WXMClientConfigurationcopyOf(WXMClientConfigurationType instance)Creates an immutable copy of aWXMClientConfigurationTypevalue.java.nio.file.PathcuExecutable()booleanequals(java.lang.Object another)This instance is equal to all instances ofWXMClientConfigurationthat have equal attribute values.java.nio.file.PathgrubBhyveExecutable()inthashCode()Computes a hash code from attributes:virtualMachineConfigurationDirectory,virtualMachineRuntimeFilesystem,bhyveExecutable,bhyveCtlExecutable,grubBhyveExecutable,zfsExecutable,ifconfigExecutable,cuExecutable.java.nio.file.PathifconfigExecutable()java.lang.StringtoString()Prints the immutable valueWXMClientConfigurationwith attribute values.java.nio.file.PathvirtualMachineConfigurationDirectory()A directory that contains virtual machine configurations.WXMZFSFilesystemvirtualMachineRuntimeFilesystem()A ZFS filesystem that contains virtual machines.WXMClientConfigurationwithBhyveCtlExecutable(java.nio.file.Path value)Copy the current immutable object by setting a value for thebhyveCtlExecutableattribute.WXMClientConfigurationwithBhyveExecutable(java.nio.file.Path value)Copy the current immutable object by setting a value for thebhyveExecutableattribute.WXMClientConfigurationwithCuExecutable(java.nio.file.Path value)Copy the current immutable object by setting a value for thecuExecutableattribute.WXMClientConfigurationwithGrubBhyveExecutable(java.nio.file.Path value)Copy the current immutable object by setting a value for thegrubBhyveExecutableattribute.WXMClientConfigurationwithIfconfigExecutable(java.nio.file.Path value)Copy the current immutable object by setting a value for theifconfigExecutableattribute.WXMClientConfigurationwithVirtualMachineConfigurationDirectory(java.nio.file.Path value)Copy the current immutable object by setting a value for thevirtualMachineConfigurationDirectoryattribute.WXMClientConfigurationwithVirtualMachineRuntimeFilesystem(WXMZFSFilesystem value)Copy the current immutable object by setting a value for thevirtualMachineRuntimeFilesystemattribute.WXMClientConfigurationwithZfsExecutable(java.nio.file.Path value)Copy the current immutable object by setting a value for thezfsExecutableattribute.java.nio.file.PathzfsExecutable()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.io7m.waxmill.client.api.WXMClientConfigurationType
checkPreconditions, virtualMachineRuntimeFilesystemFor
-
Method Details
-
virtualMachineConfigurationDirectory
public java.nio.file.Path virtualMachineConfigurationDirectory()A directory that contains virtual machine configurations.- Specified by:
virtualMachineConfigurationDirectoryin interfaceWXMClientConfigurationType- Returns:
- The virtual machine configuration directory
-
virtualMachineRuntimeFilesystem
A ZFS filesystem that contains virtual machines. This directory will contain one ZFS filesystem per virtual machine. Note that this value is the name of the ZFS filesystem, and this doesn't necessarily match where that filesystem is mounted! For example,zfs create x/y/z && zfs set mountpoint=/a/b/c x/y/zwill create a ZFS filesystemx/y/zand mount it at/a/b/c; the value expected here isx/y/z.- Specified by:
virtualMachineRuntimeFilesystemin interfaceWXMClientConfigurationType- Returns:
- The ZFS filesystem containing virtual machines
-
bhyveExecutable
public java.nio.file.Path bhyveExecutable()- Specified by:
bhyveExecutablein interfaceWXMClientConfigurationType- Returns:
- The "bhyve" executable path, such as
/usr/sbin/bhyve
-
bhyveCtlExecutable
public java.nio.file.Path bhyveCtlExecutable()- Specified by:
bhyveCtlExecutablein interfaceWXMClientConfigurationType- Returns:
- The "bhyvectl" executable path, such as
/usr/sbin/bhyvectl
-
grubBhyveExecutable
public java.nio.file.Path grubBhyveExecutable()- Specified by:
grubBhyveExecutablein interfaceWXMClientConfigurationType- Returns:
- The "grub-bhyve" executable path, such as
/usr/local/sbin/grub-bhyve
-
zfsExecutable
public java.nio.file.Path zfsExecutable()- Specified by:
zfsExecutablein interfaceWXMClientConfigurationType- Returns:
- The "zfs" executable path, such as
/sbin/zfs
-
ifconfigExecutable
public java.nio.file.Path ifconfigExecutable()- Specified by:
ifconfigExecutablein interfaceWXMClientConfigurationType- Returns:
- The "ifconfig" executable path, such as
/sbin/ifconfig
-
cuExecutable
public java.nio.file.Path cuExecutable()- Specified by:
cuExecutablein interfaceWXMClientConfigurationType- Returns:
- The "cu" executable path, such as
/usr/bin/cu
-
withVirtualMachineConfigurationDirectory
public final WXMClientConfiguration withVirtualMachineConfigurationDirectory(java.nio.file.Path value)Copy the current immutable object by setting a value for thevirtualMachineConfigurationDirectoryattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for virtualMachineConfigurationDirectory- Returns:
- A modified copy of the
thisobject
-
withVirtualMachineRuntimeFilesystem
Copy the current immutable object by setting a value for thevirtualMachineRuntimeFilesystemattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for virtualMachineRuntimeFilesystem- Returns:
- A modified copy of the
thisobject
-
withBhyveExecutable
Copy the current immutable object by setting a value for thebhyveExecutableattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for bhyveExecutable- Returns:
- A modified copy of the
thisobject
-
withBhyveCtlExecutable
Copy the current immutable object by setting a value for thebhyveCtlExecutableattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for bhyveCtlExecutable- Returns:
- A modified copy of the
thisobject
-
withGrubBhyveExecutable
Copy the current immutable object by setting a value for thegrubBhyveExecutableattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for grubBhyveExecutable- Returns:
- A modified copy of the
thisobject
-
withZfsExecutable
Copy the current immutable object by setting a value for thezfsExecutableattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for zfsExecutable- Returns:
- A modified copy of the
thisobject
-
withIfconfigExecutable
Copy the current immutable object by setting a value for theifconfigExecutableattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for ifconfigExecutable- Returns:
- A modified copy of the
thisobject
-
withCuExecutable
Copy the current immutable object by setting a value for thecuExecutableattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for cuExecutable- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofWXMClientConfigurationthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:virtualMachineConfigurationDirectory,virtualMachineRuntimeFilesystem,bhyveExecutable,bhyveCtlExecutable,grubBhyveExecutable,zfsExecutable,ifconfigExecutable,cuExecutable.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueWXMClientConfigurationwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
Creates an immutable copy of aWXMClientConfigurationTypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable WXMClientConfiguration instance
-
builder
Creates a builder forWXMClientConfiguration.WXMClientConfiguration.builder() .setVirtualMachineConfigurationDirectory(java.nio.file.Path) // requiredvirtualMachineConfigurationDirectory.setVirtualMachineRuntimeFilesystem(com.io7m.waxmill.machines.WXMZFSFilesystem) // requiredvirtualMachineRuntimeFilesystem.setBhyveExecutable(java.nio.file.Path) // optionalbhyveExecutable.setBhyveCtlExecutable(java.nio.file.Path) // optionalbhyveCtlExecutable.setGrubBhyveExecutable(java.nio.file.Path) // optionalgrubBhyveExecutable.setZfsExecutable(java.nio.file.Path) // optionalzfsExecutable.setIfconfigExecutable(java.nio.file.Path) // optionalifconfigExecutable.setCuExecutable(java.nio.file.Path) // optionalcuExecutable.build();- Returns:
- A new WXMClientConfiguration builder
-