org.glassfish.virtualization.libvirt.jna
Class Domain

java.lang.Object
  extended by org.glassfish.virtualization.libvirt.jna.LibVirtObject
      extended by org.glassfish.virtualization.libvirt.jna.Domain

public class Domain
extends LibVirtObject

Virtual Machine (Domain) interface

Author:
Jerome Dochez

Field Summary
 
Fields inherited from class org.glassfish.virtualization.libvirt.jna.LibVirtObject
libvirt
 
Constructor Summary
Domain(DomainPointer handle)
           
 
Method Summary
 int create()
          Launches this defined domain.
 void destroy()
          Destroys this domain object.
 int getID()
          Gets the hypervisor ID number for the domain
 DomainInfo getInfo()
          Returns the domain information object
 String getName()
          Gets the public name for this domain
 String getOSType()
          Gets the type of domain operation system.
 void reboot(int flags)
          Reboot this domain, the domain object is still usable there after but the domain OS is being stopped for a restart.
 void resume()
          Resume this suspended domain, the process is restarted from the state where it was frozen by calling virSuspendDomain().
 void suspend()
          Suspends this active domain, the process is frozen without further access to CPU resources and I/O but the memory used by the domain at the hypervisor level will stay allocated.
 void undefine()
          undefines this domain but does not stop it if it is running
 
Methods inherited from class org.glassfish.virtualization.libvirt.jna.LibVirtObject
checkForError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Domain

public Domain(DomainPointer handle)
Method Detail

getName

public String getName()
               throws VirtException
Gets the public name for this domain

Returns:
the name
Throws:
VirtException - if an error occurs

getOSType

public String getOSType()
                 throws VirtException
Gets the type of domain operation system.

Returns:
the type
Throws:
VirtException - if an error occurs

getID

public int getID()
          throws VirtException
Gets the hypervisor ID number for the domain

Returns:
the hypervisor ID
Throws:
VirtException - if an error occurs

create

public int create()
           throws VirtException
Launches this defined domain. If the call succeed the domain moves from the defined to the running domains pools.

Returns:
0 in case of success, -1 in case of error
Throws:
VirtException - if an error occurs.

destroy

public void destroy()
             throws VirtException
Destroys this domain object. The running instance is shutdown if not down already and all resources used by it are given back to the hypervisor. The data structure is freed and should not be used thereafter if the call does not return an error. This function may requires priviledged access

Throws:
VirtException - if an error occurs

suspend

public void suspend()
             throws VirtException
Suspends this active domain, the process is frozen without further access to CPU resources and I/O but the memory used by the domain at the hypervisor level will stay allocated. Use Domain.resume() to reactivate the domain. This function requires priviledged access.

Throws:
VirtException - if a error occurs

undefine

public void undefine()
              throws VirtException
undefines this domain but does not stop it if it is running

Throws:
VirtException - if an error occurs

reboot

public void reboot(int flags)
            throws VirtException
Reboot this domain, the domain object is still usable there after but the domain OS is being stopped for a restart. Note that the guest OS may ignore the request.

Parameters:
flags - extra flags for the reboot operation, not used yet
Throws:
VirtException - if an error occurs

resume

public void resume()
            throws VirtException
Resume this suspended domain, the process is restarted from the state where it was frozen by calling virSuspendDomain(). This function may requires privileged access

Throws:
VirtException - if an error occurs

getInfo

public DomainInfo getInfo()
                   throws VirtException
Returns the domain information object

Returns:
this domain information object
Throws:
VirtException - if an error occurs.


Copyright © 2012. All Rights Reserved.