summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openslx/libvirt/domain/device/GraphicsSpice.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/openslx/libvirt/domain/device/GraphicsSpice.java')
-rw-r--r--src/main/java/org/openslx/libvirt/domain/device/GraphicsSpice.java74
1 files changed, 74 insertions, 0 deletions
diff --git a/src/main/java/org/openslx/libvirt/domain/device/GraphicsSpice.java b/src/main/java/org/openslx/libvirt/domain/device/GraphicsSpice.java
new file mode 100644
index 0000000..f087296
--- /dev/null
+++ b/src/main/java/org/openslx/libvirt/domain/device/GraphicsSpice.java
@@ -0,0 +1,74 @@
+package org.openslx.libvirt.domain.device;
+
+import org.openslx.libvirt.xml.LibvirtXmlNode;
+
+/**
+ * A graphics SPICE device node in a Libvirt domain XML document.
+ *
+ * @author Manuel Bentele
+ * @version 1.0
+ */
+public class GraphicsSpice extends Graphics
+{
+ /**
+ * Creates an empty graphics SPICE device.
+ */
+ public GraphicsSpice()
+ {
+ super();
+ }
+
+ /**
+ * Creates a graphics SPICE device representing an existing Libvirt XML graphics SPICE device
+ * element.
+ *
+ * @param xmlNode existing Libvirt XML graphics SPCIE device element.
+ */
+ public GraphicsSpice( LibvirtXmlNode xmlNode )
+ {
+ super( xmlNode );
+ }
+
+ /**
+ * Returns the state whether OpenGL hardware acceleration is enabled or not.
+ *
+ * @return tate whether OpenGL hardware acceleration is enabled or not.
+ */
+ public boolean isOpenGlEnabled()
+ {
+ return this.getXmlElementAttributeValueAsBool( "gl", "enable" );
+ }
+
+ /**
+ * Sets the state whether OpenGL hardware acceleration is enabled or not.
+ *
+ * @param enabled state whether OpenGL hardware acceleration is enabled or not.
+ */
+ public void setOpenGl( boolean enabled )
+ {
+ this.setXmlElementAttributeValue( "gl", "enable", enabled );
+ }
+
+ /**
+ * Creates a non-existent graphics SPICE device as Libvirt XML device element.
+ *
+ * @param xmlNode Libvirt XML node of the Libvirt XML device that is created.
+ * @return created graphics SPICE device instance.
+ */
+ public static GraphicsSpice createInstance( LibvirtXmlNode xmlNode )
+ {
+ return GraphicsSpice.newInstance( xmlNode );
+ }
+
+ /**
+ * Creates a graphics SPICE device representing an existing Libvirt XML graphics SPICE device
+ * element.
+ *
+ * @param xmlNode existing Libvirt XML graphics SPICE device element.
+ * @return graphics SPICE device instance.
+ */
+ public static GraphicsSpice newInstance( LibvirtXmlNode xmlNode )
+ {
+ return new GraphicsSpice( xmlNode );
+ }
+}