org.rhq.plugins.virt
Class XMLEditor

java.lang.Object
  extended by org.rhq.plugins.virt.XMLEditor

public class XMLEditor
extends Object

Handles reading and saving changes to the libVirt xml format for domain and network definitions.

Author:
Greg Hinkle

Constructor Summary
XMLEditor()
           
 
Method Summary
static Configuration getDomainConfiguration(String xml)
          Parse the XML from calling libvirts virDomainGetXMLDesc()
static String getDomainXml(Configuration config)
           
static Configuration getNetworkConfiguration(String xml, boolean autostart)
          Parse the XML for libvirts network definition()
static String getNetworkXml(Configuration config)
           
static String updateDomainXML(Configuration config, String xmlToEdit)
          Only updates simple properties right now TODO GH: update all properties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLEditor

public XMLEditor()
Method Detail

updateDomainXML

public static String updateDomainXML(Configuration config,
                                     String xmlToEdit)
Only updates simple properties right now TODO GH: update all properties

Parameters:
config -
xmlToEdit -
Returns:
Throws:
org.jdom.JDOMException
IOException

getDomainXml

public static String getDomainXml(Configuration config)

getDomainConfiguration

public static Configuration getDomainConfiguration(String xml)
Parse the XML from calling libvirts virDomainGetXMLDesc()

Parameters:
xml - XML String from libvirt
Returns:
The resulting configuration
See Also:
{http://libvirt.org/formatdomain.html}

getNetworkConfiguration

public static Configuration getNetworkConfiguration(String xml,
                                                    boolean autostart)
Parse the XML for libvirts network definition()

Parameters:
xml - XML String from libvirt
Returns:
The resulting configuration
See Also:
{http://www.libvirt.org/formatnetwork.html}

getNetworkXml

public static String getNetworkXml(Configuration config)


Copyright © 2008-2011 Red Hat, Inc.. All Rights Reserved.