blob: 34cf33cf61b471d141ac51fd417ef2da0a82627f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
package org.openslx.runvirt.plugin.qemu.virtualization;
import org.openslx.runvirt.virtualization.LibvirtHypervisor;
import org.openslx.runvirt.virtualization.LibvirtHypervisorException;
/**
* Representation of the Libvirt QEMU hypervisor backend.
*
* @author Manuel Bentele
* @version 1.0
*/
public class LibvirtHypervisorQemu extends LibvirtHypervisor
{
/**
* Creates a new Libvirt QEMU hypervisor backend and connects to the specified backend.
*
* @param type session type of the connection to the Libvirt QEMU hypervisor backend.
* @throws LibvirtHypervisorException failed to connect to the Libvirt QEMU hypervisor backend.
*/
public LibvirtHypervisorQemu( QemuSessionType type ) throws LibvirtHypervisorException
{
super( type.getConnectionUri() );
}
/**
* Type of Libvirt QEMU hypervisor backend session.
*
* @author Manuel Bentele
* @version 1.0
*/
public enum QemuSessionType
{
// @formatter:off
LOCAL_SYSTEM_SESSION( "qemu:///system" ),
LOCAL_USER_SESSION ( "qemu:///session" );
// @formatter:on
/**
* Connection URI of the QEMU session type.
*/
private final String connectionUri;
/**
* Creates a new QEMU session type.
*
* @param connectionUri URI for the connection of the session.
*/
QemuSessionType( String connectionUri )
{
this.connectionUri = connectionUri;
}
/**
* Returns the URI of the connection for the session.
*
* @return URI of the connection for the session.
*/
public String getConnectionUri()
{
return this.connectionUri;
}
}
}
|