com.ibm.websphere.xmlconfig
Class XMLConfig

java.lang.Object
  |
  +--com.ibm.websphere.xmlconfig.BaseConfig
        |
        +--com.ibm.websphere.xmlconfig.XMLConfig

public class XMLConfig
extends BaseConfig

Command-line WebSphere XML Import/Export Tool Usage:

java com.ibm.websphere.xmlconfig.XMLConfig { ( -import <xml data file> ) || [ ( -export <xml output file> [-partial <xml data file>] ) } -adminNodeName <primary node name> [ -nameServiceHost <host name> [ -nameServicePort <port number> ]] [-traceString <trace spec> [-traceFile <file name>]] [-generatePluginCfg <true || false>.] [-substitute <\"key1=value1[;key2=value2;[...]]\">]}


Field Summary
static javax.naming.InitialContext ctx
           
static org.w3c.dom.Document globalDoc
           
static com.ibm.ejs.sm.client.ui.NLS nls
           
static java.lang.String nodeName
           
 
Constructor Summary
XMLConfig(java.util.Hashtable args)
          Constructor to use for command-line access to the XMLConfig functions
XMLConfig(java.lang.String adminNodeName, boolean _advanced)
          Constructor to use for programmatic access to the XMLConfig functions.
XMLConfig(java.lang.String adminNodeName, boolean _advanced, java.lang.String nameServiceHost, int nameServicePort)
          Constructor to use for programmatic access to the XMLConfig functions.
 
Method Summary
 void checkVersion(java.io.File xmlFile)
           
 org.w3c.dom.Document executeFullExport()
          Performs a FULL repository export
 org.w3c.dom.Document executePartialExport(org.w3c.dom.Document inputDocument)
          Performs a partial export using to specified XML document to control the operation
 org.w3c.dom.Document executePartialExport(java.io.File inputFile)
          Performs a partial export using to specified control file
 java.util.Vector getErrors()
          Gets the errors occurred during the last XMLConfig operation.
 int getNoOfErrors()
          Gets the no of errors occurred during last XMLConfig operation.
 int getNoOfWarnings()
          Gets the no of warnings flagged during last XMLConfig operation.
 java.util.Vector getWarnings()
          Gets the warnings occurred during the last XMLConfig operation.
 void importDOM(org.w3c.dom.Element rootElement)
          Imports the specified element into the repository
 void importFromFile(java.io.File xmlFile)
          Imports the data specified file into the repository
static void main(java.lang.String[] args)
           
static java.lang.String qualifyName(java.lang.String name)
          Qualifies the JNDI Name of an object using the admin node name specified.
static void setVariableReplacementPairs(java.util.Hashtable pairs)
          Sets the substitution options for the input file .
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ctx

public static javax.naming.InitialContext ctx

globalDoc

public static org.w3c.dom.Document globalDoc

nodeName

public static java.lang.String nodeName

nls

public static com.ibm.ejs.sm.client.ui.NLS nls
Constructor Detail

XMLConfig

public XMLConfig(java.lang.String adminNodeName,
                 boolean _advanced)
          throws javax.naming.NamingException
Constructor to use for programmatic access to the XMLConfig functions. This version assumes that the InitialContext already exists in the JVM
Parameters:
adminNodeName - name of the adminserver node you are connecting to.
_advanced - true if connection to an advanced edition admin server
nameServiceHost - TCP/IP host name of the Object Name Server (default: localhost)
nameServicePort - TCP/IP port name of the Object Name Server (default: 900)

XMLConfig

public XMLConfig(java.lang.String adminNodeName,
                 boolean _advanced,
                 java.lang.String nameServiceHost,
                 int nameServicePort)
          throws javax.naming.NamingException
Constructor to use for programmatic access to the XMLConfig functions.
Parameters:
adminNodeName - name of the adminserver node you are connecting to.
_advanced - true if connection to an advanced edition admin server
nameServiceHost - TCP/IP host name of the Object Name Server (default: localhost)
nameServicePort - TCP/IP port name of the Object Name Server (default: 900)

XMLConfig

public XMLConfig(java.util.Hashtable args)
          throws InvalidArgumentException,
                 javax.naming.NamingException
Constructor to use for command-line access to the XMLConfig functions
Parameters:
args - command line arguments
Method Detail

executePartialExport

public org.w3c.dom.Document executePartialExport(java.io.File inputFile)
                                          throws InvalidArgumentException,
                                                 java.lang.Exception
Performs a partial export using to specified control file
Parameters:
inputFile - file that controls partial export operation
Returns:
XML Document containing exported data

executePartialExport

public org.w3c.dom.Document executePartialExport(org.w3c.dom.Document inputDocument)
Performs a partial export using to specified XML document to control the operation
Parameters:
inputDocument - XML Document that controls the partial export operation
Returns:
XML Document containing exported data

executeFullExport

public org.w3c.dom.Document executeFullExport()
Performs a FULL repository export
Returns:
an XML Document containing the repository data

importFromFile

public void importFromFile(java.io.File xmlFile)
                    throws InvalidArgumentException,
                           java.lang.Exception
Imports the data specified file into the repository
Parameters:
xmlFile - input XML File name

importDOM

public void importDOM(org.w3c.dom.Element rootElement)
Imports the specified element into the repository
Parameters:
rootElement - the XML Element to import into the repository

qualifyName

public static java.lang.String qualifyName(java.lang.String name)
Qualifies the JNDI Name of an object using the admin node name specified. If connected to a Standard edition server, this does nothing.

main

public static void main(java.lang.String[] args)

checkVersion

public void checkVersion(java.io.File xmlFile)

getErrors

public java.util.Vector getErrors()
Gets the errors occurred during the last XMLConfig operation.
Returns:
Vector containing the error descriptions as elements.

getWarnings

public java.util.Vector getWarnings()
Gets the warnings occurred during the last XMLConfig operation.
Returns:
Vector containing the warning descriptions as elements.

getNoOfErrors

public int getNoOfErrors()
Gets the no of errors occurred during last XMLConfig operation. Additional information on the nature of errors can be obtained from getErrors()
Returns:
no of errors occurred during last XMLConfig operation.

getNoOfWarnings

public int getNoOfWarnings()
Gets the no of warnings flagged during last XMLConfig operation. Additional information on the nature of warnings can be obtained from getWarnings()
Returns:
no of Warnings flagged during last XMLConfig operation.

setVariableReplacementPairs

public static void setVariableReplacementPairs(java.util.Hashtable pairs)
Sets the substitution options for the input file .
Parameters:
Hashtable - with is the "key" "value" pairs for the substitution.