diff options
Diffstat (limited to 'src')
5 files changed, 233 insertions, 0 deletions
diff --git a/src/main/java/org/openslx/virtualization/virtualizer/Virtualizer.java b/src/main/java/org/openslx/virtualization/virtualizer/Virtualizer.java new file mode 100644 index 0000000..e74d15e --- /dev/null +++ b/src/main/java/org/openslx/virtualization/virtualizer/Virtualizer.java @@ -0,0 +1,60 @@ +package org.openslx.virtualization.virtualizer; + +import java.util.List; + +import org.openslx.vm.disk.DiskImage.ImageFormat; + +/** + * Representation of a virtualization system. + * + * The virtualization system can be for example a virtual machine hypervisor (like VirtualBox), a + * container for operating systems or applications (like LXC or Docker), or a runtime environment + * (like Wine). + * + * @author Manuel Bentele + * @version 1.0 + */ +public abstract class Virtualizer +{ + /** + * Internal data representation for the virtualizer. + */ + protected final org.openslx.bwlp.thrift.iface.Virtualizer internalVirtualizer; + + /** + * Creates a new virtualizer. + * + * @param internalVirtualizer internal data representation for the new virtualizer. + */ + public Virtualizer( org.openslx.bwlp.thrift.iface.Virtualizer internalVirtualizer ) + { + this.internalVirtualizer = internalVirtualizer; + } + + /** + * Returns the identifier of the virtualizer. + * + * @return identifier of the virtualizer. + */ + public String getId() + { + return this.internalVirtualizer.getVirtId(); + } + + /** + * Returns the name of the virtualizer. + * + * @return name of the virtualizer. + */ + public String getName() + { + return this.internalVirtualizer.getVirtName(); + } + + /** + * Returns a list of supported disk image formats by the virtualizer. + * + * @return list of supported disk image formats by the virtualizer. + */ + public abstract List<ImageFormat> getSupportedImageFormats(); +} diff --git a/src/main/java/org/openslx/virtualization/virtualizer/VirtualizerDocker.java b/src/main/java/org/openslx/virtualization/virtualizer/VirtualizerDocker.java new file mode 100644 index 0000000..524209c --- /dev/null +++ b/src/main/java/org/openslx/virtualization/virtualizer/VirtualizerDocker.java @@ -0,0 +1,43 @@ +package org.openslx.virtualization.virtualizer; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.openslx.thrifthelper.TConst; +import org.openslx.vm.disk.DiskImage; +import org.openslx.vm.disk.DiskImage.ImageFormat; + +/** + * Representation of the Docker virtualizer for application containers. + * + * @author Manuel Bentele + * @version 1.0 + */ +public class VirtualizerDocker extends Virtualizer +{ + /** + * Name of the Docker virtualizer. + */ + private static final String VIRTUALIZER_NAME = "Docker"; + + /** + * List of supported image formats by the Docker virtualizer. + */ + private static final List<DiskImage.ImageFormat> VIRTUALIZER_SUPPORTED_IMAGE_FORMATS = Collections + .unmodifiableList( Arrays.asList( ImageFormat.NONE ) ); + + /** + * Creates a new Docker virtualizer. + */ + public VirtualizerDocker() + { + super( new org.openslx.bwlp.thrift.iface.Virtualizer( TConst.VIRT_DOCKER, VirtualizerDocker.VIRTUALIZER_NAME ) ); + } + + @Override + public List<ImageFormat> getSupportedImageFormats() + { + return VirtualizerDocker.VIRTUALIZER_SUPPORTED_IMAGE_FORMATS; + } +} diff --git a/src/main/java/org/openslx/virtualization/virtualizer/VirtualizerQemu.java b/src/main/java/org/openslx/virtualization/virtualizer/VirtualizerQemu.java new file mode 100644 index 0000000..731209b --- /dev/null +++ b/src/main/java/org/openslx/virtualization/virtualizer/VirtualizerQemu.java @@ -0,0 +1,43 @@ +package org.openslx.virtualization.virtualizer; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.openslx.thrifthelper.TConst; +import org.openslx.vm.disk.DiskImage; +import org.openslx.vm.disk.DiskImage.ImageFormat; + +/** + * Representation of the QEMU virtualizer for virtual machines. + * + * @author Manuel Bentele + * @version 1.0 + */ +public class VirtualizerQemu extends Virtualizer +{ + /** + * Name of the QEMU virtualizer. + */ + private static final String VIRTUALIZER_NAME = "QEMU"; + + /** + * List of supported image formats by the QEMU virtualizer. + */ + private static final List<DiskImage.ImageFormat> VIRTUALIZER_SUPPORTED_IMAGE_FORMATS = Collections + .unmodifiableList( Arrays.asList( ImageFormat.QCOW2, ImageFormat.VMDK, ImageFormat.VDI ) ); + + /** + * Creates a new QEMU virtualizer. + */ + public VirtualizerQemu() + { + super( new org.openslx.bwlp.thrift.iface.Virtualizer( TConst.VIRT_QEMU, VirtualizerQemu.VIRTUALIZER_NAME ) ); + } + + @Override + public List<ImageFormat> getSupportedImageFormats() + { + return VirtualizerQemu.VIRTUALIZER_SUPPORTED_IMAGE_FORMATS; + } +} diff --git a/src/main/java/org/openslx/virtualization/virtualizer/VirtualizerVirtualBox.java b/src/main/java/org/openslx/virtualization/virtualizer/VirtualizerVirtualBox.java new file mode 100644 index 0000000..77662ab --- /dev/null +++ b/src/main/java/org/openslx/virtualization/virtualizer/VirtualizerVirtualBox.java @@ -0,0 +1,44 @@ +package org.openslx.virtualization.virtualizer; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.openslx.thrifthelper.TConst; +import org.openslx.vm.disk.DiskImage; +import org.openslx.vm.disk.DiskImage.ImageFormat; + +/** + * Representation of the VirtualBox virtualizer for virtual machines. + * + * @author Manuel Bentele + * @version 1.0 + */ +public class VirtualizerVirtualBox extends Virtualizer +{ + /** + * Name of the VirtualBox virtualizer. + */ + private static final String VIRTUALIZER_NAME = "VirtualBox"; + + /** + * List of supported image formats by the VirtualBox virtualizer. + */ + private static final List<DiskImage.ImageFormat> VIRTUALIZER_SUPPORTED_IMAGE_FORMATS = Collections + .unmodifiableList( Arrays.asList( ImageFormat.VDI ) ); + + /** + * Creates a new VirtualBox virtualizer. + */ + public VirtualizerVirtualBox() + { + super( new org.openslx.bwlp.thrift.iface.Virtualizer( TConst.VIRT_VIRTUALBOX, + VirtualizerVirtualBox.VIRTUALIZER_NAME ) ); + } + + @Override + public List<ImageFormat> getSupportedImageFormats() + { + return VirtualizerVirtualBox.VIRTUALIZER_SUPPORTED_IMAGE_FORMATS; + } +} diff --git a/src/main/java/org/openslx/virtualization/virtualizer/VirtualizerVmware.java b/src/main/java/org/openslx/virtualization/virtualizer/VirtualizerVmware.java new file mode 100644 index 0000000..7b766eb --- /dev/null +++ b/src/main/java/org/openslx/virtualization/virtualizer/VirtualizerVmware.java @@ -0,0 +1,43 @@ +package org.openslx.virtualization.virtualizer; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.openslx.thrifthelper.TConst; +import org.openslx.vm.disk.DiskImage; +import org.openslx.vm.disk.DiskImage.ImageFormat; + +/** + * Representation of the VMware virtualizer for virtual machines. + * + * @author Manuel Bentele + * @version 1.0 + */ +public class VirtualizerVmware extends Virtualizer +{ + /** + * Name of the VMware virtualizer. + */ + private static final String VIRTUALIZER_NAME = "VMware"; + + /** + * List of supported image formats by the VMware virtualizer. + */ + private static final List<DiskImage.ImageFormat> VIRTUALIZER_SUPPORTED_IMAGE_FORMATS = Collections + .unmodifiableList( Arrays.asList( ImageFormat.VMDK ) ); + + /** + * Creates a new VMware virtualizer. + */ + public VirtualizerVmware() + { + super( new org.openslx.bwlp.thrift.iface.Virtualizer( TConst.VIRT_VMWARE, VirtualizerVmware.VIRTUALIZER_NAME ) ); + } + + @Override + public List<ImageFormat> getSupportedImageFormats() + { + return VirtualizerVmware.VIRTUALIZER_SUPPORTED_IMAGE_FORMATS; + } +} |