From: Daniel M. <tub...@us...> - 2004-07-08 14:10:37
|
Update of /cvsroot/epp-rtk/name-rtk-addon/java/src/com/gnr/rtk/addon/extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27208 Added Files: EPPPersRegInfo.java EPPPersRegRenew.java EPPPersRegTransfer.java Removed Files: EPPPersRegConsentID.java Log Message: renamed the ConsentID class to Info and added first draft of Renew and Transfer persReg extensions --- NEW FILE: EPPPersRegInfo.java --- /************************************************************************ * dotName Java EPP RTK addon * Copyright (C) 2004 Global Name Registry * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: ep...@gn... * * EPP RTK * GNR Ltd. * 125 High Holborn * London WC1V 6QA * United Kingdom ************************************************************************/ /* * $Header: /cvsroot/epp-rtk/name-rtk-addon/java/src/com/gnr/rtk/addon/extensions/EPPPersRegInfo.java,v 1.1 2004/07/08 14:10:22 tubadanm Exp $ * $Revision: 1.1 $ * $Date: 2004/07/08 14:10:22 $ */ package com.gnr.rtk.addon.extensions; import java.io.*; import java.util.*; import java.text.*; import com.tucows.oxrs.epp.rtk.*; import com.tucows.oxrs.epp.rtk.xml.*; import org.openrtk.idl.epp.*; import com.gnr.rtk.addon.idl.persreg.*; import org.w3c.dom.*; import org.w3c.dom.traversal.*; import org.apache.xerces.parsers.*; import org.xml.sax.*; import org.apache.xerces.dom.*; import org.apache.xml.serialize.*; /** * This extension is the .org domain's protocol in which it was registered: RRP or EPP. * The .org EPP server will optionally return the extension XML for this class in the <domain:info> * response. If the extension is not present and this handler is called, no exception will be * thrown and the protocol will be set to "epp". The .org registry specifies that the default * protocol value is "epp". * @see com.liberty.rtk.extension.epp0705.example.DomainProtocolExample */ public class EPPPersRegInfo extends EPPXMLBase implements epp_PersRegInfo { private epp_PersRegInfoRsp extension_response_; /** * Default constructor */ public EPPPersRegInfo () {} /** * Constructor with Protocol Version Extension XML string (from .org's <domain:info>) * to automatically parse. * @param xml The Protocol Version Extension response XML String * @throws org.openrtk.idl.epp.epp_XMLException if the response XML is not parsable or does not contain the expected data * @see #fromXML(String) */ public EPPPersRegInfo (String xml) throws epp_XMLException, epp_Exception { String method_name = "OxrsTransfer(String)"; debug(DEBUG_LEVEL_TWO,method_name,"xml is ["+xml+"]"); fromXML(xml); } /** * Accessor method for the PersReg info response data. * @return value com.gnr.rtk.addon.idl.persreg.epp_PersRegInfoRsp */ public epp_PersRegInfoRsp getResponseData() { return extension_response_; } /** * Implemented method to satisfy org.openrtk.idl.epp.epp_Extension interface, * but does nothing because this is a server response extension only. * @throws org.openrtk.idl.epp.epp_XMLException if required data is missing * @see org.openrtk.idl.epp.epp_Extension */ public String toXML() throws epp_XMLException { String method_name = "toXML()"; debug(DEBUG_LEVEL_THREE,method_name,"Entered"); debug(DEBUG_LEVEL_THREE,method_name,"Nothing to do"); debug(DEBUG_LEVEL_THREE,method_name,"Leaving"); // It would be impolite to return for this, // so let's just return an empty string. return ""; } /** * Parses the persReg:consentID from the domain and email Info response. * Implemented method from org.openrtk.idl.epp.epp_Extension interface. * @param A new persReg:infData Extension XML String to parse * @throws org.openrtk.idl.epp.epp_XMLException if the response XML is not parsable or does not contain the expected data * @see org.openrtk.idl.epp.epp_Action */ public void fromXML(String xml) throws epp_XMLException { String method_name = "fromXML()"; debug(DEBUG_LEVEL_THREE,method_name,"Entered"); xml_ = xml; try { extension_response_ = new epp_PersRegInfoRsp(); extension_response_.m_consent_id = null; if ( xml_ == null || xml_.length() == 0 ) { // no xml string to parse debug(DEBUG_LEVEL_THREE,method_name,"No XML to parse"); debug(DEBUG_LEVEL_THREE,method_name,"Leaving"); return; } Element persreg_node = getDocumentElement(); if ( persreg_node == null ) { // XXX should we throw an exception at this point??? return; } NodeList persreg_node_list = persreg_node.getChildNodes(); if ( persreg_node_list.getLength() == 0 ) { // XXX should we throw an exception at this point??? return; } debug(DEBUG_LEVEL_TWO,method_name,"persreg_node_list's node count ["+persreg_node_list.getLength()+"]"); for (int count = 0; count < persreg_node_list.getLength(); count++) { Node a_node = persreg_node_list.item(count); if ( a_node.getNodeName().equals("persReg:consentID") ) { extension_response_.m_consent_id = a_node.getFirstChild().getNodeValue(); } } } catch (SAXException xcp) { debug(DEBUG_LEVEL_ONE,method_name,xcp); throw new epp_XMLException("unable to parse xml ["+xcp.getClass().getName()+"] ["+xcp.getMessage()+"]"); } catch (IOException xcp) { debug(DEBUG_LEVEL_ONE,method_name,xcp); throw new epp_XMLException("unable to parse xml ["+xcp.getClass().getName()+"] ["+xcp.getMessage()+"]"); } debug(DEBUG_LEVEL_THREE,method_name,"Leaving"); } } --- NEW FILE: EPPPersRegRenew.java --- /************************************************************************ * dotName Java EPP RTK addon * Copyright (C) 2004 Global Name Registry * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: ep...@gn... * * EPP RTK * GNR Ltd. * 125 High Holborn * London WC1V 6QA * United Kingdom ************************************************************************/ /* * $Header: /cvsroot/epp-rtk/name-rtk-addon/java/src/com/gnr/rtk/addon/extensions/EPPPersRegRenew.java,v 1.1 2004/07/08 14:10:22 tubadanm Exp $ * $Revision: 1.1 $ * $Date: 2004/07/08 14:10:22 $ */ package com.gnr.rtk.addon.extensions; import java.io.*; import java.util.*; import java.text.*; import com.tucows.oxrs.epp.rtk.*; import com.tucows.oxrs.epp.rtk.xml.*; import org.openrtk.idl.epp.*; import com.gnr.rtk.addon.idl.persreg.*; import org.w3c.dom.*; import org.w3c.dom.traversal.*; import org.apache.xerces.parsers.*; import org.xml.sax.*; import org.apache.xerces.dom.*; import org.apache.xml.serialize.*; /** * This extension is the .org domain's protocol in which it was registered: RRP or EPP. * The .org EPP server will optionally return the extension XML for this class in the <domain:info> * response. If the extension is not present and this handler is called, no exception will be * thrown and the protocol will be set to "epp". The .org registry specifies that the default * protocol value is "epp". * @see com.liberty.rtk.extension.epp0705.example.DomainProtocolExample */ public class EPPPersRegRenew extends EPPXMLBase implements epp_PersRegRenew { private epp_PersRegRenewRsp extension_response_; /** * Default constructor */ public EPPPersRegRenew () {} /** * Constructor with Protocol Version Extension XML string (from .org's <domain:info>) * to automatically parse. * @param xml The Protocol Version Extension response XML String * @throws org.openrtk.idl.epp.epp_XMLException if the response XML is not parsable or does not contain the expected data * @see #fromXML(String) */ public EPPPersRegRenew (String xml) throws epp_XMLException, epp_Exception { String method_name = "OxrsTransfer(String)"; debug(DEBUG_LEVEL_TWO,method_name,"xml is ["+xml+"]"); fromXML(xml); } /** * Accessor method for the PersReg info response data. * @return value com.gnr.rtk.addon.idl.persreg.epp_PersRegInfoRsp */ public epp_PersRegRenewRsp getResponseData() { return extension_response_; } /** * Implemented method to satisfy org.openrtk.idl.epp.epp_Extension interface, * but does nothing because this is a server response extension only. * @throws org.openrtk.idl.epp.epp_XMLException if required data is missing * @see org.openrtk.idl.epp.epp_Extension */ public String toXML() throws epp_XMLException { String method_name = "toXML()"; debug(DEBUG_LEVEL_THREE,method_name,"Entered"); debug(DEBUG_LEVEL_THREE,method_name,"Nothing to do"); debug(DEBUG_LEVEL_THREE,method_name,"Leaving"); // It would be impolite to return for this, // so let's just return an empty string. return ""; } /** * Parses the persReg:bundleRate from the domain and email Info response. * Implemented method from org.openrtk.idl.epp.epp_Extension interface. * @param A new persReg:infData Extension XML String to parse * @throws org.openrtk.idl.epp.epp_XMLException if the response XML is not parsable or does not contain the expected data * @see org.openrtk.idl.epp.epp_Action */ public void fromXML(String xml) throws epp_XMLException { String method_name = "fromXML()"; debug(DEBUG_LEVEL_THREE,method_name,"Entered"); xml_ = xml; try { extension_response_ = new epp_PersRegRenewRsp(); extension_response_.m_bundled_rate = false; if ( xml_ == null || xml_.length() == 0 ) { // no xml string to parse debug(DEBUG_LEVEL_THREE,method_name,"No XML to parse"); debug(DEBUG_LEVEL_THREE,method_name,"Leaving"); return; } Element persreg_node = getDocumentElement(); if ( persreg_node == null ) { // XXX should we throw an exception at this point??? return; } NodeList persreg_node_list = persreg_node.getChildNodes(); if ( persreg_node_list.getLength() == 0 ) { // XXX should we throw an exception at this point??? return; } debug(DEBUG_LEVEL_TWO,method_name,"persreg_node_list's node count ["+persreg_node_list.getLength()+"]"); for (int count = 0; count < persreg_node_list.getLength(); count++) { Node a_node = persreg_node_list.item(count); if ( a_node.getNodeName().equals("persReg:bundledRate") ) { String bundled_rate = a_node.getFirstChild().getNodeValue(); if ( bundled_rate.equals("1") ) { extension_response_.m_bundled_rate = true; } else if ( ! bundled_rate.equals("0") ) { throw new epp_XMLException("unknown persReg:bundledRate value ["+bundled_rate+"]"); } } } } catch (SAXException xcp) { debug(DEBUG_LEVEL_ONE,method_name,xcp); throw new epp_XMLException("unable to parse xml ["+xcp.getClass().getName()+"] ["+xcp.getMessage()+"]"); } catch (IOException xcp) { debug(DEBUG_LEVEL_ONE,method_name,xcp); throw new epp_XMLException("unable to parse xml ["+xcp.getClass().getName()+"] ["+xcp.getMessage()+"]"); } debug(DEBUG_LEVEL_THREE,method_name,"Leaving"); } } --- NEW FILE: EPPPersRegTransfer.java --- /************************************************************************ * dotName Java EPP RTK addon * Copyright (C) 2004 Global Name Registry * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: ep...@gn... * * EPP RTK * GNR Ltd. * 125 High Holborn * London WC1V 6QA * United Kingdom ************************************************************************/ /* * $Header: /cvsroot/epp-rtk/name-rtk-addon/java/src/com/gnr/rtk/addon/extensions/EPPPersRegTransfer.java,v 1.1 2004/07/08 14:10:22 tubadanm Exp $ * $Revision: 1.1 $ * $Date: 2004/07/08 14:10:22 $ */ package com.gnr.rtk.addon.extensions; import java.io.*; import java.util.*; import java.text.*; import com.tucows.oxrs.epp.rtk.*; import com.tucows.oxrs.epp.rtk.xml.*; import org.openrtk.idl.epp.*; import com.gnr.rtk.addon.idl.persreg.*; import org.w3c.dom.*; import org.w3c.dom.traversal.*; import org.apache.xerces.parsers.*; import org.xml.sax.*; import org.apache.xerces.dom.*; import org.apache.xml.serialize.*; /** * This extension is the .org domain's protocol in which it was registered: RRP or EPP. * The .org EPP server will optionally return the extension XML for this class in the <domain:info> * response. If the extension is not present and this handler is called, no exception will be * thrown and the protocol will be set to "epp". The .org registry specifies that the default * protocol value is "epp". * @see com.liberty.rtk.extension.epp0705.example.DomainProtocolExample */ public class EPPPersRegTransfer extends EPPXMLBase implements epp_PersRegTransfer { private epp_PersRegTransferRsp extension_response_; /** * Default constructor */ public EPPPersRegTransfer () {} /** * Constructor with Protocol Version Extension XML string (from .org's <domain:info>) * to automatically parse. * @param xml The Protocol Version Extension response XML String * @throws org.openrtk.idl.epp.epp_XMLException if the response XML is not parsable or does not contain the expected data * @see #fromXML(String) */ public EPPPersRegTransfer (String xml) throws epp_XMLException, epp_Exception { String method_name = "OxrsTransfer(String)"; debug(DEBUG_LEVEL_TWO,method_name,"xml is ["+xml+"]"); fromXML(xml); } /** * Accessor method for the PersReg info response data. * @return value com.gnr.rtk.addon.idl.persreg.epp_PersRegInfoRsp */ public epp_PersRegTransferRsp getResponseData() { return extension_response_; } /** * Implemented method to satisfy org.openrtk.idl.epp.epp_Extension interface, * but does nothing because this is a server response extension only. * @throws org.openrtk.idl.epp.epp_XMLException if required data is missing * @see org.openrtk.idl.epp.epp_Extension */ public String toXML() throws epp_XMLException { String method_name = "toXML()"; debug(DEBUG_LEVEL_THREE,method_name,"Entered"); debug(DEBUG_LEVEL_THREE,method_name,"Nothing to do"); debug(DEBUG_LEVEL_THREE,method_name,"Leaving"); // It would be impolite to return for this, // so let's just return an empty string. return ""; } /** * Parses the persReg:bundleRate from the domain and email Info response. * Implemented method from org.openrtk.idl.epp.epp_Extension interface. * @param A new persReg:infData Extension XML String to parse * @throws org.openrtk.idl.epp.epp_XMLException if the response XML is not parsable or does not contain the expected data * @see org.openrtk.idl.epp.epp_Action */ public void fromXML(String xml) throws epp_XMLException { String method_name = "fromXML()"; debug(DEBUG_LEVEL_THREE,method_name,"Entered"); xml_ = xml; try { extension_response_ = new epp_PersRegTransferRsp(); extension_response_.m_bundled_rate = false; if ( xml_ == null || xml_.length() == 0 ) { // no xml string to parse debug(DEBUG_LEVEL_THREE,method_name,"No XML to parse"); debug(DEBUG_LEVEL_THREE,method_name,"Leaving"); return; } Element persreg_node = getDocumentElement(); if ( persreg_node == null ) { // XXX should we throw an exception at this point??? return; } NodeList persreg_node_list = persreg_node.getChildNodes(); if ( persreg_node_list.getLength() == 0 ) { // XXX should we throw an exception at this point??? return; } debug(DEBUG_LEVEL_TWO,method_name,"persreg_node_list's node count ["+persreg_node_list.getLength()+"]"); for (int count = 0; count < persreg_node_list.getLength(); count++) { Node a_node = persreg_node_list.item(count); if ( a_node.getNodeName().equals("persReg:bundledRate") ) { String bundled_rate = a_node.getFirstChild().getNodeValue(); if ( bundled_rate.equals("1") ) { extension_response_.m_bundled_rate = true; } else if ( ! bundled_rate.equals("0") ) { throw new epp_XMLException("unknown persReg:bundledRate value ["+bundled_rate+"]"); } } } } catch (SAXException xcp) { debug(DEBUG_LEVEL_ONE,method_name,xcp); throw new epp_XMLException("unable to parse xml ["+xcp.getClass().getName()+"] ["+xcp.getMessage()+"]"); } catch (IOException xcp) { debug(DEBUG_LEVEL_ONE,method_name,xcp); throw new epp_XMLException("unable to parse xml ["+xcp.getClass().getName()+"] ["+xcp.getMessage()+"]"); } debug(DEBUG_LEVEL_THREE,method_name,"Leaving"); } } --- EPPPersRegConsentID.java DELETED --- |