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.datatype.assertion.PublisherAssertion; 16 import org.uddi4j.util.AuthInfo; 17 import org.w3c.dom.Element ; 18 import org.w3c.dom.NodeList ; 19 20 46 public class DeletePublisherAssertions extends UDDIElement { 47 public static final String UDDI_TAG = "delete_publisherAssertions"; 48 49 protected Element base = null; 50 51 AuthInfo authInfo = null; 52 53 Vector publisherAssertionVector = new Vector (); 54 55 56 62 public DeletePublisherAssertions() { 63 } 64 65 75 public DeletePublisherAssertions(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 nl = getChildElementsByTagName(base, PublisherAssertion.UDDI_TAG); 84 for (int i=0; i < nl.getLength(); i++) { 85 publisherAssertionVector.addElement(new PublisherAssertion((Element)nl.item(i))); 86 } 87 } 88 89 95 public DeletePublisherAssertions(String authInfo, 96 Vector pubAssertVector) throws UDDIException { 97 this.authInfo = new AuthInfo( authInfo ); 98 Vector objects; 99 objects = new Vector (); 100 for (int i = 0; i < pubAssertVector.size(); i++) { 101 objects.addElement( new PublisherAssertion((Element)pubAssertVector.elementAt(i))); 102 } 103 104 this.publisherAssertionVector = objects; 105 106 } 107 108 113 public void setPublisherAssertionVector(Vector pubAssertVector ) { 114 publisherAssertionVector = pubAssertVector; 115 } 116 117 122 public Vector getPublisherAssertionVector() { 123 return publisherAssertionVector; 124 } 125 126 public AuthInfo getAuthInfo() { 127 return authInfo; 128 } 129 130 public void setAuthInfo(AuthInfo s) { 131 authInfo = s; 132 } 133 134 public String getAuthInfoString() { 135 if(authInfo!=null) 136 return authInfo.getText(); 137 else 138 return null; 139 } 140 141 public void setAuthInfo(String s) { 142 authInfo = new AuthInfo(); 143 authInfo.setText(s); 144 } 145 146 155 public void saveToXML(Element parent) { 156 base = parent.getOwnerDocument().createElement(UDDI_TAG); 157 base.setAttribute("generic", UDDIElement.GENERIC); 159 base.setAttribute("xmlns", UDDIElement.XMLNS); 160 if (authInfo!=null) { 161 authInfo.saveToXML(base); 162 } 163 if (publisherAssertionVector!=null) { 164 for (int i=0; i < publisherAssertionVector.size(); i++) { 165 ((PublisherAssertion)(publisherAssertionVector.elementAt(i))).saveToXML(base); 166 } 167 } 168 parent.appendChild(base); 169 } 170 } 171 | Popular Tags |