1 8 9 package org.uddi4j.response; 10 11 import org.uddi4j.UDDIElement; 12 import org.uddi4j.UDDIException; 13 import org.uddi4j.util.FromKey; 14 import org.uddi4j.util.KeyedReference; 15 import org.uddi4j.util.ToKey; 16 import org.w3c.dom.Element ; 17 import org.w3c.dom.NodeList ; 18 19 46 public class AssertionStatusItem extends UDDIElement { 47 public static final String UDDI_TAG = "assertionStatusItem"; 48 49 protected Element base = null; 50 51 FromKey fromKey = null; 52 ToKey toKey = null; 53 KeyedReference keyedReference = null; 54 KeysOwned keysOwned = null; 55 CompletionStatus completionStatus = null; 56 57 58 64 65 public AssertionStatusItem() { 66 } 67 68 69 79 80 public AssertionStatusItem(Element base) throws UDDIException { 81 super(base); 83 completionStatus = new CompletionStatus(); 84 completionStatus.setText(base.getAttribute("completionStatus")); 85 NodeList nl = null; 86 nl = getChildElementsByTagName(base, FromKey.UDDI_TAG); 87 if (nl.getLength() > 0) { 88 fromKey = new FromKey((Element)nl.item(0)); 89 } 90 nl = getChildElementsByTagName(base, ToKey.UDDI_TAG); 91 if (nl.getLength() > 0) { 92 toKey = new ToKey((Element)nl.item(0)); 93 } 94 nl = getChildElementsByTagName(base, KeyedReference.UDDI_TAG); 95 if (nl.getLength() > 0) { 96 keyedReference = new KeyedReference((Element)nl.item(0)); 97 } 98 nl = getChildElementsByTagName(base, KeysOwned.UDDI_TAG); 99 if (nl.getLength() > 0) { 100 keysOwned = new KeysOwned((Element)nl.item(0)); 101 } 102 } 103 104 112 public AssertionStatusItem(String fromKey, String toKey, 113 KeyedReference ref, KeysOwned keys) { 114 this.fromKey = new FromKey(fromKey); 115 this.toKey = new ToKey(toKey); 116 this.keyedReference = ref; 117 this.keysOwned = keys; 118 } 119 120 public String getFromKeyString() { 121 return fromKey.getText(); 122 } 123 124 public void setFromKeyString(String s) { 125 fromKey = new FromKey(); 126 fromKey.setText(s); 127 } 128 129 public String getToKeyString() { 130 return toKey.getText(); 131 } 132 133 public void setToKeyString(String s) { 134 toKey = new ToKey(); 135 toKey.setText(s); 136 } 137 138 public FromKey getFromKey() { 139 return fromKey; 140 } 141 142 public void setFromKey(FromKey key) { 143 fromKey = key; 144 } 145 146 public ToKey getToKey() { 147 return toKey; 148 } 149 150 public void setToKey(ToKey key) { 151 toKey = key; 152 } 153 154 public KeyedReference getKeyedReference() { 155 return keyedReference; 156 } 157 158 public void setKeyedReference(KeyedReference r) { 159 keyedReference = r; 160 } 161 162 public KeysOwned getKeysOwned() { 163 return keysOwned; 164 } 165 166 public void setKeysOwned(KeysOwned k) { 167 keysOwned = k; 168 } 169 170 public CompletionStatus getCompletionStatus() { 171 return completionStatus; 172 } 173 174 public void setCompletionStatus(CompletionStatus status) { 175 completionStatus = status; 176 } 177 178 179 188 189 public void saveToXML(Element parent) { 190 base = parent.getOwnerDocument().createElement(UDDI_TAG); 191 if (completionStatus!=null) { 193 base.setAttribute("completionStatus", completionStatus.getText()); 194 } 195 if (fromKey!=null) { 196 fromKey.saveToXML(base); 197 } 198 if (toKey!=null) { 199 toKey.saveToXML(base); 200 } 201 if (keyedReference!=null) { 202 keyedReference.saveToXML(base); 203 } 204 if (keysOwned!=null) { 205 keysOwned.saveToXML(base); 206 } 207 208 parent.appendChild(base); 209 } 210 } 211 | Popular Tags |