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 40 public class DiscardAuthToken extends UDDIElement { 41 public static final String UDDI_TAG = "discard_authToken"; 42 43 protected Element base = null; 44 45 AuthInfo authInfo = null; 46 47 53 public DiscardAuthToken() { 54 } 55 56 61 public DiscardAuthToken(String authInfo) { 62 this.authInfo = new AuthInfo( authInfo ); 63 } 64 65 75 public DiscardAuthToken(Element base) throws UDDIException { 76 super(base); 78 NodeList nl = null; 79 nl = getChildElementsByTagName(base, AuthInfo.UDDI_TAG); 80 if (nl.getLength() > 0) { 81 authInfo = new AuthInfo((Element)nl.item(0)); 82 } 83 } 84 85 public void setAuthInfo(AuthInfo s) { 86 authInfo = s; 87 } 88 public void setAuthInfo(String s) { 89 authInfo = new AuthInfo(); 90 authInfo.setText(s); 91 } 92 93 public AuthInfo getAuthInfo() { 94 return authInfo; 95 } 96 97 public String getAuthInfoString() { 98 return authInfo.getText(); 99 } 100 101 110 public void saveToXML(Element parent) { 111 base = parent.getOwnerDocument().createElement(UDDI_TAG); 112 base.setAttribute("generic", UDDIElement.GENERIC); 114 base.setAttribute("xmlns", UDDIElement.XMLNS); 115 if (authInfo!=null) { 116 authInfo.saveToXML(base); 117 } 118 parent.appendChild(base); 119 } 120 } 121 | Popular Tags |