org.glassfish.virtualization.libvirt.jna
Class StoragePool

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

public class StoragePool
extends LibVirtObject

Storage Pool JNA interface

Author:
Jerome Dochez

Field Summary
 
Fields inherited from class org.glassfish.virtualization.libvirt.jna.LibVirtObject
libvirt
 
Constructor Summary
StoragePool(StoragePoolPointer handle)
           
 
Method Summary
 void delete(int flags)
          Delete the underlying pool resources.
 String[] listVolumes()
          Fetch list of storage volume names
 int numOfVolumes()
          Fetch the number of storage volumes within a pool
 StorageVol storageVolCreateXML(String xmlDesc, int flags)
          Create a storage volume within a pool based on an XML description.
 StorageVol storageVolLookupByName(String name)
          Fetch an object representing to a storage volume based on its name within a pool
 
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

StoragePool

public StoragePool(StoragePoolPointer handle)
Method Detail

numOfVolumes

public int numOfVolumes()
                 throws VirtException
Fetch the number of storage volumes within a pool

Returns:
the number of storage pools
Throws:
VirtException - if an error occurs

listVolumes

public String[] listVolumes()
                     throws VirtException
Fetch list of storage volume names

Returns:
an Array of Strings that contains the names of the storage volumes
Throws:
VirtException - if an error occurs

storageVolLookupByName

public StorageVol storageVolLookupByName(String name)
                                  throws VirtException
Fetch an object representing to a storage volume based on its name within a pool

Parameters:
name - name of storage volume
Returns:
The StorageVol object found
Throws:
VirtException - if an error occurs

storageVolCreateXML

public StorageVol storageVolCreateXML(String xmlDesc,
                                      int flags)
                               throws VirtException
Create a storage volume within a pool based on an XML description. Not all pools support creation of volumes

Parameters:
xmlDesc - description of volume to create
flags - flags for creation (unused, pass 0)
Returns:
the storage volume
Throws:
VirtException - if an error occurs

delete

public void delete(int flags)
            throws VirtException
Delete the underlying pool resources. This is a non-recoverable operation. The virStoragePool object itself is not free'd.

Parameters:
flags - flags for obliteration process
Throws:
VirtException - if an error occurs


Copyright © 2012. All Rights Reserved.