public class Connect
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Connect.OpenFlags |
Modifier and Type | Field and Description |
---|---|
protected ConnectionPointer |
vcp
The native virConnectPtr.
|
Constructor and Description |
---|
Connect(java.lang.String uri)
Constructs a read-write Connect object from the supplied URI.
|
Connect(java.lang.String uri,
boolean readOnly)
Constructs a Connect object from the supplied URI.
|
Connect(java.lang.String uri,
ConnectAuth auth,
int flags)
Constructs a Connect object from the supplied URI, using the supplied
authentication callback
|
Connect(java.net.URI uri,
Connect.OpenFlags... flags)
Constructs a read-write Connect object from the supplied URI.
|
Connect(java.net.URI uri,
ConnectAuth auth)
Constructs a Connect object from the supplied URI, using the supplied
authentication callback
|
Connect(java.net.URI uri,
ConnectAuth auth,
Connect.OpenFlags... flags)
Constructs a Connect object from the supplied URI, using the supplied
authentication callback
|
Modifier and Type | Method and Description |
---|---|
void |
addAgentLifecycleListener(AgentLifecycleListener cb)
Adds the specified listener to receive agent lifecycle events.
|
void |
addIOErrorListener(IOErrorListener l)
Adds the specified I/O error listener to receive I/O error events
for domains of this connection.
|
void |
addLifecycleListener(LifecycleListener l)
Adds the specified listener to receive lifecycle events for
domains of this connection.
|
void |
addPMSuspendListener(PMSuspendListener l)
Adds the specified listener to receive PMSuspend events for
domains of this connection.
|
void |
addPMWakeupListener(PMWakeupListener l)
Adds the specified listener to receive PMWakeup events for
domains of this connection.
|
void |
addRebootListener(RebootListener l)
Adds the specified reboot listener to receive reboot events for
domains of this connection.
|
java.lang.String |
baselineCPU(java.lang.String[] xmlCPUs)
Computes the most feature-rich CPU which is compatible with all given
host CPUs.
|
int |
close()
Closes the connection to the hypervisor/driver.
|
CPUCompareResult |
compareCPU(java.lang.String xmlDesc)
Compares the given CPU description with the host CPU
|
static long |
connectionVersion(Connect conn)
Deprecated.
Use
getLibVersion() instead. |
static int[] |
convertUUIDBytes(byte[] bytes)
Helper function to convert bytes into ints for the UUID calls
|
static byte[] |
createUUIDBytes(int[] uuid)
Helper function to convert UUIDs into a stirng for the uuid calls
|
Device |
deviceCreateXML(java.lang.String xmlDesc)
Create a new device on the VM host machine, for example, virtual HBAs
created using vport_create.
|
Device |
deviceLookupByName(java.lang.String name)
Fetch a device based on its unique name
|
Domain |
domainCreateLinux(java.lang.String xmlDesc,
int flags)
Launches a new Linux guest domain.
|
Domain |
domainCreateXML(java.lang.String xmlDesc,
int flags)
Launch a new guest domain, based on an XML description
|
Domain |
domainDefineXML(java.lang.String xmlDesc)
Defines a domain, but does not start it
|
Domain |
domainLookupByID(int id)
Finds a domain based on the hypervisor ID number.
|
Domain |
domainLookupByName(java.lang.String name)
Looks up a domain based on its name.
|
Domain |
domainLookupByUUID(int[] uuid)
Looks up a domain based on its UUID in array form.
|
Domain |
domainLookupByUUID(java.util.UUID uuid)
Fetch a domain based on its globally unique id
|
Domain |
domainLookupByUUIDString(java.lang.String uuid)
Looks up a domain based on its uuid in String form.
|
java.lang.String |
domainXMLFromNative(java.lang.String nativeFormat,
java.lang.String nativeConfig,
int flags)
Reads a native XML configuration document, and generates generates a
domain configuration file describing the domain.
|
java.lang.String |
domainXMLToNative(java.lang.String nativeFormat,
java.lang.String domainXML,
int flags)
Reads a domain XML configuration document, and generates generates a
native configuration file describing the domain.
|
boolean |
equals(java.lang.Object obj) |
protected void |
finalize() |
java.lang.String |
findStoragePoolSources(java.lang.String type,
java.lang.String srcSpecs,
int flags)
Talks to a storage backend and attempts to auto-discover the set of
available storage pool sources.
|
java.lang.String |
getCapabilities()
Provides capabilities of the hypervisor / driver.
|
long |
getCellsFreeMemory(int startCells,
int maxCells)
NUMA Support
|
long |
getFreeMemory()
Returns the free memory for the connection
|
java.lang.String |
getHostName()
Returns the system hostname on which the hypervisor is running.
|
long |
getHypervisorVersion(java.lang.String type)
Deprecated.
To get the version of the running hypervisor use
getVersion() instead. |
long |
getLibVersion()
Get the libvirt library version of this connection.
|
long |
getLibVirVersion()
Deprecated.
use
Library.getVersion() instead |
int |
getMaxVcpus(java.lang.String type)
Provides the maximum number of virtual CPUs supported for a guest VM of a
specific type.
|
SecurityModel |
getSecurityModel()
Returns the security model of the connected node.
|
java.lang.String |
getSysinfo()
Returns the XML description of the sysinfo details for the host
on which the hypervisor is running.
|
java.lang.String |
getType()
Gets the name of the Hypervisor software used.
|
java.lang.String |
getURI()
Returns the URI (name) of the hypervisor connection.
|
long |
getVersion()
Gets the version level of the Hypervisor running.
|
int |
hashCode() |
Interface |
interfaceDefineXML(java.lang.String xmlDesc)
Define an interface (or modify existing interface configuration)
|
Interface |
interfaceLookupByMACString(java.lang.String mac)
Try to lookup an interface on the given hypervisor based on its MAC.
|
Interface |
interfaceLookupByName(java.lang.String name)
Try to lookup an interface on the given hypervisor based on its name.
|
boolean |
isAlive()
Determine if the connection to the hypervisor is still alive.
|
boolean |
isConnected()
Verify the connect is active.
|
int |
isEncrypted()
Determine if the connection is encrypted
|
int |
isSecure()
Determine if the connection is secure
|
java.lang.String[] |
listDefinedDomains()
Lists the names of the defined but inactive domains
|
java.lang.String[] |
listDefinedInterfaces()
Provides the list of names of defined interfaces on this host
|
java.lang.String[] |
listDefinedNetworks()
Lists the inactive networks
|
java.lang.String[] |
listDefinedStoragePools()
Provides the list of names of inactive storage pools.
|
java.lang.String[] |
listDevices(java.lang.String capabilityName)
List the names of the devices on this node
|
int[] |
listDomains()
Lists the active domains.
|
java.lang.String[] |
listInterfaces()
Provides the list of names of interfaces on this host
|
java.lang.String[] |
listNetworkFilters()
Lists the names of the network filters
|
java.lang.String[] |
listNetworks()
Lists the active networks.
|
java.lang.String[] |
listSecrets()
Retrieve the List UUIDs of defined secrets
|
java.lang.String[] |
listStoragePools()
Provides the list of names of active storage pools.
|
Network |
networkCreateXML(java.lang.String xmlDesc)
Creates and starts a new virtual network.
|
Network |
networkDefineXML(java.lang.String xmlDesc)
Defines a network, but does not create it.
|
NetworkFilter |
networkFilterDefineXML(java.lang.String xmlDesc)
Defines a networkFilter
|
NetworkFilter |
networkFilterLookupByName(java.lang.String name)
Fetch a network filter based on its unique name
|
NetworkFilter |
networkFilterLookupByUUID(int[] uuid)
Looks up a network filter based on its UUID in array form.
|
NetworkFilter |
networkFilterLookupByUUID(java.util.UUID uuid)
Fetch a network filter based on its globally unique id
|
NetworkFilter |
networkFilterLookupByUUIDString(java.lang.String uuid)
Looks up a network filter based on its uuid in String form.
|
Network |
networkLookupByName(java.lang.String name)
Looks up a network on the based on its name.
|
Network |
networkLookupByUUID(int[] uuid)
Deprecated.
use the UUIDString or UUID API.
|
Network |
networkLookupByUUID(java.util.UUID uuid)
Fetch a network based on its globally unique id
|
Network |
networkLookupByUUIDString(java.lang.String uuid)
Looks up a network based on its uuid represented as a String.
|
NodeInfo |
nodeInfo()
Returns a NodeInfo object describing the hardware configuration of the
node.
|
int |
numOfDefinedDomains()
Provides the number of inactive domains.
|
int |
numOfDefinedInterfaces()
Provides the number of defined interfaces.
|
int |
numOfDefinedNetworks()
Provides the number of inactive networks.
|
int |
numOfDefinedStoragePools()
Provides the number of inactive storage pools
|
int |
numOfDevices(java.lang.String capabilityName)
Provides the number of node devices.
|
int |
numOfDomains()
Provides the number of active domains.
|
int |
numOfInterfaces()
Provides the number of interfaces.
|
int |
numOfNetworkFilters()
Provides the number of network filters
|
int |
numOfNetworks()
Provides the number of active networks.
|
int |
numOfSecrets()
Fetch number of currently defined secrets.
|
int |
numOfStoragePools()
Provides the number of active storage pools
|
void |
registerCloseListener(ConnectionCloseListener l)
Register the specified connection close listener to receive notifications
when this connection is closed.
|
void |
removeAgentLifecycleListener(AgentLifecycleListener l)
Removes the specified agent lifecycle event listener so that it no longer
receives agent lifecycle events.
|
void |
removeBlockJobListener(BlockJobListener l)
Removes the specified Block Job listener so that it no longer
receives events
|
void |
removeIOErrorListener(IOErrorListener l)
Removes the specified I/O error listener so that it no longer
receives I/O error events.
|
void |
removeLifecycleListener(LifecycleListener l)
Removes the specified lifecycle event listener so that it no longer
receives lifecycle events.
|
void |
removePMSuspendListener(PMSuspendListener l)
Removes the specified PMSuspend listener so that it no longer
receives PMSuspend events.
|
void |
removePMWakeupListener(PMWakeupListener l)
Removes the specified PMWakeup listener so that it no longer
receives PMWakeup events.
|
void |
restore(java.lang.String from)
Restores a domain saved to disk by Domain.save().
|
Secret |
secretDefineXML(java.lang.String xmlDesc)
If XML specifies a UUID, locates the specified secret and replaces all
attributes of the secret specified by UUID by attributes specified in xml
(any attributes not specified in xml are discarded).
|
Secret |
secretLookupByUUID(int[] uuid)
Looks up a secret based on its UUID in array form.
|
Secret |
secretLookupByUUID(java.util.UUID uuid)
Fetch a secret based on its globally unique id
|
Secret |
secretLookupByUUIDString(java.lang.String uuid)
Looks up a secret based on its uuid in String form.
|
void |
setConnectionErrorCallback(Libvirt.VirErrorCallback callback) |
void |
setDom0Memory(long memory)
change the amount of memory reserved to Domain0.
|
static void |
setErrorCallback(Libvirt.VirErrorCallback callback)
Sets the error function to a user defined callback
|
boolean |
setKeepAlive(int interval,
int count)
Start sending keepalive messages.
|
StoragePool |
storagePoolCreateXML(java.lang.String xmlDesc,
int flags)
Create a new storage based on its XML description.
|
StoragePool |
storagePoolDefineXML(java.lang.String xml,
int flags)
Define a new inactive storage pool based on its XML description.
|
StoragePool |
storagePoolLookupByName(java.lang.String name)
Fetch a storage pool based on its unique name
|
StoragePool |
storagePoolLookupByUUID(int[] uuid)
Deprecated.
Use the UUIDString or UUID APIs.
|
StoragePool |
storagePoolLookupByUUID(java.util.UUID uuid)
Fetch a storage pool based on its globally unique id
|
StoragePool |
storagePoolLookupByUUIDString(java.lang.String uuid)
Fetch a storage pool based on its globally unique id
|
StorageVol |
storageVolLookupByKey(java.lang.String key)
Fetch a a storage volume based on its globally unique key
|
StorageVol |
storageVolLookupByPath(java.lang.String path)
Fetch a storage volume based on its locally (host) unique path
|
Stream |
streamNew(int flags)
Creates a new stream object which can be used to perform streamed I/O
with other public API function.
|
void |
unregisterCloseListener()
Unregister the previously registered close listener.
|
protected ConnectionPointer vcp
public Connect(java.lang.String uri) throws LibvirtException
uri
- The connection URILibvirtException
public Connect(java.net.URI uri, Connect.OpenFlags... flags) throws LibvirtException
uri
- The connection URILibvirtException
public Connect(java.lang.String uri, boolean readOnly) throws LibvirtException
uri
- The connection URIreadOnly
- Whether the connection is read-onlyLibvirtException
public Connect(java.lang.String uri, ConnectAuth auth, int flags) throws LibvirtException
uri
- The connection URIauth
- a ConnectAuth objectflags
- LibvirtException
public Connect(java.net.URI uri, ConnectAuth auth, Connect.OpenFlags... flags) throws LibvirtException
uri
- The connection URIauth
- a ConnectAuth objectflags
- LibvirtException
public Connect(java.net.URI uri, ConnectAuth auth) throws LibvirtException
uri
- The connection URIauth
- a ConnectAuth objectLibvirtException
@Deprecated public static long connectionVersion(Connect conn)
getLibVersion()
instead.conn
- the connection to use.public static int[] convertUUIDBytes(byte[] bytes)
public static byte[] createUUIDBytes(int[] uuid)
public long getLibVersion() throws LibvirtException
major *
1,000,000 + minor * 1,000 + release
.LibvirtException
public static void setErrorCallback(Libvirt.VirErrorCallback callback) throws LibvirtException
callback
- a Class to perform the callbackLibvirtException
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String baselineCPU(java.lang.String[] xmlCPUs) throws LibvirtException
xmlCPUs
- array of XML descriptions of host CPUsLibvirtException
public int close() throws LibvirtException
LibvirtException
public void registerCloseListener(ConnectionCloseListener l) throws LibvirtException
Note: There can only be at most one registered listener at a time.
l
- the connection close listenerLibvirtException
- on failureunregisterCloseListener()
public void unregisterCloseListener() throws LibvirtException
public CPUCompareResult compareCPU(java.lang.String xmlDesc) throws LibvirtException
xmlDesc
- LibvirtException
public Device deviceCreateXML(java.lang.String xmlDesc) throws LibvirtException
xmlDesc
- the device to createLibvirtException
public Device deviceLookupByName(java.lang.String name) throws LibvirtException
name
- name of device to fetchLibvirtException
public Domain domainCreateLinux(java.lang.String xmlDesc, int flags) throws LibvirtException
xmlDesc
- the Domain description in XMLflags
- an optional set of flags (unused)LibvirtException
public Domain domainCreateXML(java.lang.String xmlDesc, int flags) throws LibvirtException
xmlDesc
- LibvirtException
public Domain domainDefineXML(java.lang.String xmlDesc) throws LibvirtException
xmlDesc
- LibvirtException
public void addIOErrorListener(IOErrorListener l) throws LibvirtException
l
- the I/O error listenerLibvirtException
- on failurepublic void addAgentLifecycleListener(AgentLifecycleListener cb) throws LibvirtException
cb
- the agent lifecycle listenerLibvirtException
- on failureremoveAgentLifecycleListener(org.libvirt.event.AgentLifecycleListener)
,
Domain.addAgentLifecycleListener(org.libvirt.event.AgentLifecycleListener)
,
virConnectDomainEventRegisterAnypublic void addLifecycleListener(LifecycleListener l) throws LibvirtException
l
- the lifecycle listenerLibvirtException
- on failureremoveLifecycleListener(org.libvirt.event.LifecycleListener)
,
Domain.addLifecycleListener(org.libvirt.event.LifecycleListener)
,
virConnectDomainEventRegisterAnypublic void addPMSuspendListener(PMSuspendListener l) throws LibvirtException
l
- the PMSuspend listenerLibvirtException
- on failureremovePMSuspendListener(org.libvirt.event.PMSuspendListener)
,
Domain.addPMSuspendListener(org.libvirt.event.PMSuspendListener)
,
virConnectDomainEventRegisterAnypublic void removePMSuspendListener(PMSuspendListener l) throws LibvirtException
l
- the PMSuspend listenerLibvirtException
public void addPMWakeupListener(PMWakeupListener l) throws LibvirtException
l
- the PMWakeup listenerLibvirtException
- on failureremovePMWakeupListener(org.libvirt.event.PMWakeupListener)
,
Domain.addPMWakeupListener(org.libvirt.event.PMWakeupListener)
,
virConnectDomainEventRegisterAnypublic void removePMWakeupListener(PMWakeupListener l) throws LibvirtException
l
- the PMWakeup listenerLibvirtException
public void removeLifecycleListener(LifecycleListener l) throws LibvirtException
l
- the lifecycle event listenerLibvirtException
public void removeAgentLifecycleListener(AgentLifecycleListener l) throws LibvirtException
l
- the agent lifecycle event listenerLibvirtException
public void addRebootListener(RebootListener l) throws LibvirtException
l
- the reboot listenerLibvirtException
- on failureDomain.addRebootListener(org.libvirt.event.RebootListener)
,
virConnectDomainEventRegisterAnypublic void removeBlockJobListener(BlockJobListener l) throws LibvirtException
l
- LibvirtException
public void removeIOErrorListener(IOErrorListener l) throws LibvirtException
l
- the I/O error listenerLibvirtException
public Domain domainLookupByID(int id) throws LibvirtException
id
- the hypervisor idLibvirtException
public Domain domainLookupByName(java.lang.String name) throws LibvirtException
name
- the name of the domainLibvirtException
public Domain domainLookupByUUID(int[] uuid) throws LibvirtException
uuid
- the uuid as an unpacked int arrayLibvirtException
public Domain domainLookupByUUID(java.util.UUID uuid) throws LibvirtException
uuid
- a java UUIDLibvirtException
public Domain domainLookupByUUIDString(java.lang.String uuid) throws LibvirtException
uuid
- the uuid in canonical String representationLibvirtException
public java.lang.String domainXMLFromNative(java.lang.String nativeFormat, java.lang.String nativeConfig, int flags) throws LibvirtException
null
on errorLibvirtException
public java.lang.String domainXMLToNative(java.lang.String nativeFormat, java.lang.String domainXML, int flags) throws LibvirtException
null
on errorLibvirtException
protected void finalize() throws LibvirtException
finalize
in class java.lang.Object
LibvirtException
public java.lang.String findStoragePoolSources(java.lang.String type, java.lang.String srcSpecs, int flags) throws LibvirtException
type
- type of storage pool to discoversrcSpecs
- XML document specifying discovery sourcflags
- unusedLibvirtException
public java.lang.String getCapabilities() throws LibvirtException
LibvirtException
public long getCellsFreeMemory(int startCells, int maxCells) throws LibvirtException
LibvirtException
public long getFreeMemory() throws LibvirtException
LibvirtException
public java.lang.String getHostName() throws LibvirtException
LibvirtException
@Deprecated public long getHypervisorVersion(java.lang.String type) throws LibvirtException
getVersion()
instead.Library.getVersion()
.type
- The type of connection/driver to look at. See
getType()
. May be null
.LibvirtException
@Deprecated public long getLibVirVersion() throws LibvirtException
Library.getVersion()
insteadLibvirtException
public int getMaxVcpus(java.lang.String type) throws LibvirtException
type
- LibvirtException
public SecurityModel getSecurityModel() throws LibvirtException
LibvirtException
public java.lang.String getSysinfo() throws LibvirtException
This information is generally available only for hypervisors running with root privileges.
<sysinfo>
element of a domain XML.LibvirtException
public java.lang.String getType() throws LibvirtException
LibvirtException
public java.lang.String getURI() throws LibvirtException
LibvirtException
public long getVersion() throws LibvirtException
LibvirtException
public Interface interfaceDefineXML(java.lang.String xmlDesc) throws LibvirtException
xmlDesc
- the interface to createLibvirtException
public Interface interfaceLookupByMACString(java.lang.String mac) throws LibvirtException
LibvirtException
public Interface interfaceLookupByName(java.lang.String name) throws LibvirtException
LibvirtException
public int isEncrypted() throws LibvirtException
LibvirtException
public int isSecure() throws LibvirtException
LibvirtException
public java.lang.String[] listDefinedDomains() throws LibvirtException
LibvirtException
public java.lang.String[] listDefinedInterfaces() throws LibvirtException
LibvirtException
public java.lang.String[] listDefinedNetworks() throws LibvirtException
LibvirtException
public java.lang.String[] listDefinedStoragePools() throws LibvirtException
LibvirtException
public java.lang.String[] listDevices(java.lang.String capabilityName) throws LibvirtException
capabilityName
- optional capability nameLibvirtException
public int[] listDomains() throws LibvirtException
LibvirtException
public java.lang.String[] listInterfaces() throws LibvirtException
LibvirtException
public java.lang.String[] listNetworkFilters() throws LibvirtException
LibvirtException
public java.lang.String[] listNetworks() throws LibvirtException
LibvirtException
public java.lang.String[] listSecrets() throws LibvirtException
LibvirtException
public java.lang.String[] listStoragePools() throws LibvirtException
LibvirtException
public Network networkCreateXML(java.lang.String xmlDesc) throws LibvirtException
xmlDesc
- the Network DescriptionLibvirtException
public Network networkDefineXML(java.lang.String xmlDesc) throws LibvirtException
xmlDesc
- LibvirtException
public NetworkFilter networkFilterDefineXML(java.lang.String xmlDesc) throws LibvirtException
xmlDesc
- the descirption of the filterLibvirtException
public NetworkFilter networkFilterLookupByName(java.lang.String name) throws LibvirtException
name
- name of network filter to fetchLibvirtException
public NetworkFilter networkFilterLookupByUUID(int[] uuid) throws LibvirtException
uuid
- the uuid as an unpacked int arrayLibvirtException
public NetworkFilter networkFilterLookupByUUID(java.util.UUID uuid) throws LibvirtException
uuid
- a java UUIDLibvirtException
public NetworkFilter networkFilterLookupByUUIDString(java.lang.String uuid) throws LibvirtException
uuid
- the uuid in canonical String representationLibvirtException
public Network networkLookupByName(java.lang.String name) throws LibvirtException
name
- name of the networkLibvirtException
@Deprecated public Network networkLookupByUUID(int[] uuid) throws LibvirtException
uuid
- the uuid as an unpacked int arrayLibvirtException
public Network networkLookupByUUID(java.util.UUID uuid) throws LibvirtException
uuid
- a java UUIDLibvirtException
public Network networkLookupByUUIDString(java.lang.String uuid) throws LibvirtException
uuid
- the uuid in canonical String representationLibvirtException
public NodeInfo nodeInfo() throws LibvirtException
LibvirtException
public int numOfDefinedDomains() throws LibvirtException
LibvirtException
public int numOfDefinedInterfaces() throws LibvirtException
LibvirtException
public int numOfDefinedNetworks() throws LibvirtException
LibvirtException
public int numOfDefinedStoragePools() throws LibvirtException
LibvirtException
public int numOfDevices(java.lang.String capabilityName) throws LibvirtException
LibvirtException
public int numOfDomains() throws LibvirtException
LibvirtException
public int numOfInterfaces() throws LibvirtException
LibvirtException
public int numOfNetworkFilters() throws LibvirtException
LibvirtException
public int numOfNetworks() throws LibvirtException
LibvirtException
public int numOfSecrets() throws LibvirtException
LibvirtException
public int numOfStoragePools() throws LibvirtException
LibvirtException
public void restore(java.lang.String from) throws LibvirtException
from
- the path of the saved file on the remote hostLibvirtException
public Secret secretDefineXML(java.lang.String xmlDesc) throws LibvirtException
xmlDesc
- the secret to createLibvirtException
public Secret secretLookupByUUID(int[] uuid) throws LibvirtException
uuid
- the uuid as an unpacked int arrayLibvirtException
public Secret secretLookupByUUID(java.util.UUID uuid) throws LibvirtException
uuid
- a java UUIDLibvirtException
public Secret secretLookupByUUIDString(java.lang.String uuid) throws LibvirtException
uuid
- the uuid in canonical String representationLibvirtException
public void setConnectionErrorCallback(Libvirt.VirErrorCallback callback) throws LibvirtException
LibvirtException
public void setDom0Memory(long memory) throws LibvirtException
memory
- in kilobytesLibvirtException
public StoragePool storagePoolCreateXML(java.lang.String xmlDesc, int flags) throws LibvirtException
xmlDesc
- XML description for new poolflags
- future flags, use 0 for nowLibvirtException
public StoragePool storagePoolDefineXML(java.lang.String xml, int flags) throws LibvirtException
xml
- XML description for new poolflags
- flags future flags, use 0 for nowLibvirtException
public StoragePool storagePoolLookupByName(java.lang.String name) throws LibvirtException
name
- name of pool to fetchLibvirtException
@Deprecated public StoragePool storagePoolLookupByUUID(int[] uuid) throws LibvirtException
uuid
- globally unique id of pool to fetchLibvirtException
public StoragePool storagePoolLookupByUUID(java.util.UUID uuid) throws LibvirtException
uuid
- a java UUIDLibvirtException
public StoragePool storagePoolLookupByUUIDString(java.lang.String uuid) throws LibvirtException
uuid
- globally unique id of pool to fetchLibvirtException
public StorageVol storageVolLookupByKey(java.lang.String key) throws LibvirtException
key
- globally unique keyLibvirtException
public StorageVol storageVolLookupByPath(java.lang.String path) throws LibvirtException
path
- locally unique pathLibvirtException
public Stream streamNew(int flags) throws LibvirtException
flags
- use Stream.VIR_STREAM_NONBLOCK if non-blocking is requiredLibvirtException
public boolean isConnected() throws LibvirtException
LibvirtException
public boolean isAlive() throws LibvirtException
A connection will be classed as alive if it is either local, or running over a channel (TCP or UNIX socket) which is not closed.
true
if alive, false
otherwise.LibvirtException
public boolean setKeepAlive(int interval, int count) throws LibvirtException
interval
seconds of inactivity, consider the
connection to be broken when no response is received after
count
keepalive messages sent in a row.
In other words, sending count + 1
keepalive message
results in closing the connection.
When interval is <= 0, no keepalive messages will be sent.
When count is 0, the connection will be automatically closed after interval seconds of inactivity without sending any keepalive messages.
Note: client has to implement and run event loop to be able to use keepalive messages. Failure to do so may result in connections being closed unexpectedly.
Note: This API function controls only keepalive messages sent by the client. If the server is configured to use keepalive you still need to run the event loop to respond to them, even if you disable keepalives by this function.
interval
- number of seconds of inactivity before a keepalive
message is sentcount
- number of messages that can be sent in a rowtrue
when successful, false
otherwise.LibvirtException