1 8 9 package org.uddi4j.request; 10 11 import java.util.Vector ; 12 13 import org.uddi4j.UDDIElement; 14 import org.uddi4j.UDDIException; 15 import org.uddi4j.util.AuthInfo; 16 import org.uddi4j.util.TModelKey; 17 import org.w3c.dom.Element ; 18 import org.w3c.dom.NodeList ; 19 20 44 public class DeleteTModel extends UDDIElement { 45 public static final String UDDI_TAG = "delete_tModel"; 46 47 protected Element base = null; 48 49 AuthInfo authInfo = null; 50 Vector tModelKey = new Vector (); 52 53 59 public DeleteTModel() { 60 } 61 62 68 public DeleteTModel(String authInfo, 69 Vector tModelKeyStrings) { 70 this.authInfo = new AuthInfo( authInfo ); 71 Vector objects; 72 objects = new Vector (); 73 for (int i = 0; i < tModelKeyStrings.size(); i++) { 74 objects.addElement( new TModelKey((String )tModelKeyStrings.elementAt(i)) ); 75 } 76 77 this.tModelKey = objects; 78 } 79 80 90 public DeleteTModel(Element base) throws UDDIException { 91 super(base); 93 NodeList nl = null; 94 nl = getChildElementsByTagName(base, AuthInfo.UDDI_TAG); 95 if (nl.getLength() > 0) { 96 authInfo = new AuthInfo((Element)nl.item(0)); 97 } 98 nl = getChildElementsByTagName(base, TModelKey.UDDI_TAG); 99 for (int i=0; i < nl.getLength(); i++) { 100 tModelKey.addElement(new TModelKey((Element)nl.item(i))); 101 } 102 } 103 104 public void setAuthInfo(AuthInfo s) { 105 authInfo = s; 106 } 107 public void setAuthInfo(String s) { 108 authInfo = new AuthInfo(); 109 authInfo.setText(s); 110 } 111 112 117 public void setTModelKeyVector(Vector s) { 118 tModelKey = s; 119 } 120 121 126 public void setTModelKeyStrings(Vector s) { 127 tModelKey = new Vector (); 128 for (int i = 0; i < s.size(); i++) { 129 tModelKey.addElement( new TModelKey((String )s.elementAt(i)) ); 130 } 131 } 132 133 public AuthInfo getAuthInfo() { 134 return authInfo; 135 } 136 137 public String getAuthInfoString() { 138 if(authInfo!=null) 139 return authInfo.getText(); 140 else 141 return null; 142 } 143 144 149 public Vector getTModelKeyVector() { 150 return tModelKey; 151 } 152 153 158 public Vector getTModelKeyStrings() { 159 Vector strings = new Vector (); 160 for (int i = 0; i < tModelKey.size(); i++) { 161 strings.addElement( ((TModelKey)tModelKey.elementAt(i)).getText()); 162 } 163 return strings; 164 } 165 166 175 public void saveToXML(Element parent) { 176 base = parent.getOwnerDocument().createElement(UDDI_TAG); 177 base.setAttribute("generic", UDDIElement.GENERIC); 179 base.setAttribute("xmlns", UDDIElement.XMLNS); 180 if (authInfo!=null) { 181 authInfo.saveToXML(base); 182 } 183 if (tModelKey!=null) { 184 for (int i=0; i < tModelKey.size(); i++) { 185 ((TModelKey)(tModelKey.elementAt(i))).saveToXML(base); 186 } 187 } 188 parent.appendChild(base); 189 } 190 } 191 | Popular Tags |