Top-level abstract class for all RTK classes that deal with XML data.
auth_type_string_to_type_hash_
protected static Hashtable auth_type_string_to_type_hash_
Hashtable to allow for conversion from String auth id type to
epp_AuthInfoType.
EPP IDL epp.idl for the definition of the epp_AuthInfoType enum
auth_type_to_string_array_
public static String[] auth_type_to_string_array_
Array to allow for conversion from epp_AuthInfoType to
a String representation of the auth id type.
The epp_AuthInfoType static classes have a value() member
function which returns their integer position in the enum.
EPP IDL epp.idl for the definition of the epp_AuthInfoType enum
transfer_op_to_string_array_
protected static String[] transfer_op_to_string_array_
Array to allow for conversion from epp_TransferStatusType to
a String representation of the transfer status.
The epp_TransferStatusType static classes have a value() member
function which returns their integer position in the enum.
EPP IDL epp.idl for the definition of the epp_TransferStatusType enum
transfer_status_to_string_array_
protected static String[] transfer_status_to_string_array_
transfer_status_to_type_hash_
protected static Hashtable transfer_status_to_type_hash_
Hashtable to allow for conversion from String transfer status to
epp_TransferStatusType.
EPP IDL epp.idl for the definition of the epp_TransferStatusType enum
xml_
protected String xml_
Holder of the response XML String
addXMLElement
protected Element addXMLElement(Document doc,
Element containing_element,
String tag_name,
String value)
Creates an Element for the given tag name and appends it to the given
containing Element.
- Element the newly created Element which was added to the containing Element
convertListToArray
public static Object convertListToArray(Class the_class,
List the_list)
Converts a List of any size to a Java Object array
that can be cast into an array of any class.
All of the objects in the List must be of the same class otherwise a
run-time exception will be throws.
Example:
List integer_list = (List)ArrayList();
integer_list.add(new Integer(1));
integer_list.add(new Integer(2));
Integer[] string_array = (Integer[]) EPPXMLBase.convertListToArray((new Integer()).getClass(), string_list)
- Object the newly created array.
convertListToStringArray
public static String[] convertListToStringArray(List the_list)
Converts a List of any size of Strings to a Java Object array.
A convenience version of the convertListToArray() method.
Example:
List string_list = (List)ArrayList();
string_list.add("Hello");
string_list.add("Goodbye");
// Note that no casting is required here.
String[] string_array = EPPXMLBase.convertListToStringArray(string_list)
- String[] the resulting String array
createDocRoot
protected Element createDocRoot(Document doc)
Given a Document, this method create the root epp tag and populates
its attributes with xmlns, xmlns:xsi, and xsi:schemaLocation values.
- Element The newly created epp Element
createXMLFromDoc
protected String createXMLFromDoc(Document doc)
throws IOException
Given a Document with all of its children elements appended, converts
this document to an XML String.
createXMLSnippetFromDoc
protected String createXMLSnippetFromDoc(Document doc)
throws IOException
Given a Document with all of its children elements appended, converts
this document to an XML Snippet.
The difference between this and createXMLFromDoc() is that the XML
headers are not included.
getCheckResultFor
public static Boolean getCheckResultFor(epp_CheckResult[] check_results,
String check_value)
Given an array of epp_CheckResult's, finds the matching value
and returns it's exists value in a Boolean object.
This method works for Check Results on any object.
- Boolean the exists boolean in a Boolean object. Will return
null if the array is null or if the value was not found.
getDocumentElement
protected Element getDocumentElement()
throws IOException,
SAXException
Using pre-set response XML, returns the document's Element.
Please see the Xerces documentation for more information regarding
Parsers, Documents and Elements.
getElement
protected Element getElement(NodeList node_list,
String node_name)
Given the node list, it finds the Element for the given name. Actually
calls getNode() and casts the result into an Element.
Please see the Xerces documentation for more information regarding
Elements and Nodelists.
- Element for the given element name, or null if not found
getNode
protected Node getNode(NodeList node_list,
String node_name)
Given the node list, it finds the node for the given name
Please see the Xerces documentation for more information regarding
Nodes and Nodelists
- Node for the given node name, or null if not found
getUnspecNode
protected Node getUnspecNode(String unspec_string)
throws IOException,
SAXException
Gets the Node representing the unspec xml tag.
- Element for the unspec XML
getXML
public String getXML()
Accessor method for the response XML String
initAuthInfoStringToTypeHash
public static void initAuthInfoStringToTypeHash()
initHashes
public static void initHashes()
initTransferStatusToTypeHash
public static void initTransferStatusToTypeHash()
parseGenericResult
protected epp_Response parseGenericResult(Node response_node)
throws epp_XMLException
Given the response XML node, it extracts the result code and result text.
Please see the Xerces documentation for more information regarding
Nodes.
- epp_Response the generic response structure
prepareAuthInfo
protected Element prepareAuthInfo(Document doc,
String tag_name,
epp_AuthInfo auth_info)
Creates an EPP
Element using the given epp_TransID.
The epp_TransID cannot be null.
- Element the resulting EPP Element
prepareCreds
protected Element prepareCreds(Document doc,
epp_Credentials creds)
Creates an EPP Element using the given epp_Credentials.
The epp_Credentials cannot be null. If the new password in the creds
is null, it is not added to the resulting Element.
- Element the resulting EPP Element
prepareUnspecElement
protected Element prepareUnspecElement(Document doc,
epp_Unspec unspec)
throws epp_XMLException
Method to change an epp_Unspec instance to XML elements.
stringListToXML
protected void stringListToXML(Document doc,
Element wrapper,
String tag_name,
List list)
Given a list of String values, create Elements all with the same
tag name and all going under the same Element wrapper.
transferStatusToString
public static String transferStatusToString(epp_TransferStatusType status_type)
Convenience method to get a transfer status string from an
epp_TransferStatusType object.