1 16 package org.apache.juddi.datatype.response; 17 18 import java.util.Vector ; 19 20 import org.apache.juddi.datatype.RegistryObject; 21 22 30 public class DispositionReport implements RegistryObject 31 { 32 String generic; 33 String operator; 34 Vector resultVector; 35 36 39 public DispositionReport() 40 { 41 } 42 43 47 public void setGeneric(String genericValue) 48 { 49 this.generic = genericValue; 50 } 51 52 56 public String getGeneric() 57 { 58 return this.generic; 59 } 60 61 64 public void setOperator(String operator) 65 { 66 this.operator = operator; 67 } 68 69 72 public String getOperator() 73 { 74 return this.operator; 75 } 76 77 80 public void addResult(Result result) 81 { 82 if (this.resultVector == null) 83 this.resultVector = new Vector (); 84 this.resultVector.add(result); 85 } 86 87 90 public void setResultVector(Vector results) 91 { 92 this.resultVector = results; 93 } 94 95 98 public Vector getResultVector() 99 { 100 return this.resultVector; 101 } 102 103 106 public String toString() 107 { 108 StringBuffer buffer = new StringBuffer (); 109 buffer.append("org.apache.juddi.datatype.response.DispositionReport.operator="); 110 buffer.append(this.operator); 111 buffer.append("\n"); 112 113 if (this.resultVector != null) 114 for (int i=0; i<this.resultVector.size(); i++) 115 buffer.append(this.resultVector.elementAt(i)); 116 117 return buffer.toString(); 118 } 119 120 public static void main(String [] args) 122 { 123 DispositionReport obj = new DispositionReport(); 124 obj.setGeneric("2.0"); 125 obj.setOperator("jUDDI.org"); 126 127 ErrInfo errInfo = new ErrInfo(); 128 errInfo.setErrCode("abc"); 129 errInfo.setErrMsg("def"); 130 131 Result result = new Result(); 132 result.setErrInfo(errInfo); 133 result.setErrno(123); 134 135 obj.addResult(result); 136 137 errInfo = new ErrInfo(); 138 errInfo.setErrCode("ghi"); 139 errInfo.setErrMsg("jkl"); 140 141 result = new Result(); 142 result.setErrInfo(errInfo); 143 result.setErrno(456); 144 145 obj.addResult(result); 146 147 errInfo = new ErrInfo(); 148 errInfo.setErrCode("mno"); 149 errInfo.setErrMsg("pqr"); 150 151 result = new Result(); 152 result.setErrInfo(errInfo); 153 result.setErrno(789); 154 155 obj.addResult(result); 156 157 System.out.println(obj); 158 } 159 } | Popular Tags |