1 8 9 package org.uddi4j.request; 10 11 import org.uddi4j.UDDIElement; 12 import org.uddi4j.UDDIException; 13 import org.uddi4j.util.AuthInfo; 14 import org.w3c.dom.Element ; 15 import org.w3c.dom.NodeList ; 16 17 44 public class GetRegisteredInfo extends UDDIElement { 45 public static final String UDDI_TAG = "get_registeredInfo"; 46 47 protected Element base = null; 48 49 AuthInfo authInfo = null; 50 51 57 public GetRegisteredInfo() { 58 } 59 60 65 public GetRegisteredInfo(String authInfo) { 66 this.authInfo = new AuthInfo( authInfo ); 67 } 68 69 79 public GetRegisteredInfo(Element base) throws UDDIException { 80 super(base); 82 NodeList nl = null; 83 nl = getChildElementsByTagName(base, AuthInfo.UDDI_TAG); 84 if (nl.getLength() > 0) { 85 authInfo = new AuthInfo((Element)nl.item(0)); 86 } 87 } 88 89 public void setAuthInfo(AuthInfo s) { 90 authInfo = s; 91 } 92 public void setAuthInfo(String s) { 93 authInfo = new AuthInfo(); 94 authInfo.setText(s); 95 } 96 97 public AuthInfo getAuthInfo() { 98 return authInfo; 99 } 100 101 public String getAuthInfoString() { 102 if(authInfo!=null) 103 return authInfo.getText(); 104 else 105 return null; 106 } 107 108 117 public void saveToXML(Element parent) { 118 base = parent.getOwnerDocument().createElement(UDDI_TAG); 119 base.setAttribute("generic", UDDIElement.GENERIC); 121 base.setAttribute("xmlns", UDDIElement.XMLNS); 122 if (authInfo!=null) { 123 authInfo.saveToXML(base); 124 } 125 parent.appendChild(base); 126 } 127 } 128 | Popular Tags |