org.libvirt

Class Network

public class Network extends Object

Method Summary
voidcreate()
Creates and starts this defined network.
voiddestroy()
Destroy this network object.
voidfinalize()
voidfree()
Frees this network object.
booleangetAutostart()
Provides a boolean value indicating whether this network is configured to be automatically started when the host machine boots.
StringgetBridgeName()
Provides a bridge interface name to which a domain may connect a network interface in order to join this network.
ConnectgetConnect()
Provides the connection pointer associated with this network.
StringgetName()
Gets the public name for this network
int[]getUUID()
Gets the UUID for this network
StringgetUUIDString()
Gets the UUID for a network as string.
StringgetXMLDesc(int flags)
Provides an XML description of this network.
voidsetAutostart(boolean autostart)
Configures this network to be automatically started when the host machine boots.
voidundefine()
Undefines this network but does not stop it if it is running

Method Detail

create

public void create()
Creates and starts this defined network. If the call succeeds the network moves from the defined to the running networks pools.

Throws: LibvirtException

destroy

public void destroy()
Destroy this network object. The running instance is shutdown if not down already and all resources used by it are given back to the hypervisor. The object becomes invalid and should not be used thereafter if the call does not return an error. This function may require priviledged access

Throws: LibvirtException

finalize

public void finalize()

free

public void free()
Frees this network object. The running instance is kept alive. The object becomes invalid and should not be used thereafter if the call does not return an error.

Throws: LibvirtException

getAutostart

public boolean getAutostart()
Provides a boolean value indicating whether this network is configured to be automatically started when the host machine boots.

Returns: true if autostarted, false otherwise

Throws: LibvirtException

getBridgeName

public String getBridgeName()
Provides a bridge interface name to which a domain may connect a network interface in order to join this network.

Returns: the interface name

Throws: LibvirtException

getConnect

public Connect getConnect()
Provides the connection pointer associated with this network.

Returns: the Connect object

getName

public String getName()
Gets the public name for this network

Returns: the public name

Throws: LibvirtException

getUUID

public int[] getUUID()
Gets the UUID for this network

Returns: the UUID as an unpacked int array

Throws: LibvirtException

See Also: rfc4122

getUUIDString

public String getUUIDString()
Gets the UUID for a network as string.

Returns: the UUID in canonical String format

Throws: LibvirtException

See Also: rfc4122

getXMLDesc

public String getXMLDesc(int flags)
Provides an XML description of this network. The description may be reused later to relaunch the network with Virconnect.virNetworkCreateXML().

Parameters: flags and OR'ed set of extraction flags, not used yet

Returns: The XML representation of this network

Throws: LibvirtException

setAutostart

public void setAutostart(boolean autostart)
Configures this network to be automatically started when the host machine boots.

Parameters: autostart whether the network should be automatically started 0 or 1

Throws: LibvirtException

undefine

public void undefine()
Undefines this network but does not stop it if it is running

Throws: LibvirtException