1 16 package org.apache.juddi.datatype.request; 17 18 import java.util.Vector ; 19 20 import org.apache.juddi.datatype.RegistryObject; 21 22 39 public class FindQualifiers implements RegistryObject 40 { 41 Vector findQualifierVector; 42 43 public boolean exactNameMatch; 44 public boolean caseSensitiveMatch; 45 public boolean orAllKeys; 46 public boolean orLikeKeys; 47 public boolean andAllKeys; 48 public boolean sortByNameAsc; 49 public boolean sortByNameDesc; 50 public boolean sortByDateAsc; 51 public boolean sortByDateDesc; 52 public boolean serviceSubset; 53 public boolean combineCategoryBags; 54 55 58 public FindQualifiers() 59 { 60 } 61 62 65 public FindQualifiers(int size) 66 { 67 this.findQualifierVector = new Vector (size); 68 } 69 70 73 public void addFindQualifier(FindQualifier findQualifier) 74 { 75 if (findQualifier == null) 77 return; 78 79 String qValue = findQualifier.getValue(); 81 if ((qValue == null) || (qValue.trim().length() == 0)) 82 return; 83 84 if (this.findQualifierVector == null) 85 this.findQualifierVector = new Vector (); 86 this.findQualifierVector.add(findQualifier); 87 88 if (qValue.equals(FindQualifier.EXACT_NAME_MATCH)) 89 exactNameMatch = true; 90 else if (qValue.equals(FindQualifier.CASE_SENSITIVE_MATCH)) 91 caseSensitiveMatch = true; 92 else if (qValue.equals(FindQualifier.OR_ALL_KEYS)) 93 orAllKeys = true; 94 else if (qValue.equals(FindQualifier.OR_LIKE_KEYS)) 95 orLikeKeys = true; 96 else if (qValue.equals(FindQualifier.AND_ALL_KEYS)) 97 andAllKeys = true; 98 else if (qValue.equals(FindQualifier.SORT_BY_NAME_ASC)) 99 sortByNameAsc = true; 100 else if (qValue.equals(FindQualifier.SORT_BY_NAME_DESC)) 101 sortByNameDesc = true; 102 else if (qValue.equals(FindQualifier.SORT_BY_DATE_ASC)) 103 sortByDateAsc = true; 104 else if (qValue.equals(FindQualifier.SORT_BY_DATE_DESC)) 105 sortByDateDesc = true; 106 else if (qValue.equals(FindQualifier.SERVICE_SUBSET)) 107 serviceSubset = true; 108 else if (qValue.equals(FindQualifier.COMBINE_CATEGORY_BAGS)) 109 combineCategoryBags = true; 110 } 111 112 115 public void setFindQualifierVector(Vector qualifierVector) 116 { 117 this.exactNameMatch = false; 118 this.caseSensitiveMatch = false; 119 this.orAllKeys = false; 120 this.orLikeKeys = false; 121 this.andAllKeys = false; 122 this.sortByNameAsc = false; 123 this.sortByNameDesc = false; 124 this.sortByDateAsc = false; 125 this.sortByDateDesc = false; 126 this.serviceSubset = false; 127 this.combineCategoryBags = false; 128 129 if ((qualifierVector != null) && (qualifierVector.size() > 0)) 130 { 131 for (int i=0; i<qualifierVector.size(); i++) 132 addFindQualifier((FindQualifier)qualifierVector.elementAt(i)); 133 } 134 } 135 136 139 public Vector getFindQualifierVector() 140 { 141 return this.findQualifierVector; 142 } 143 144 147 public int size() 148 { 149 if (this.findQualifierVector != null) 150 return this.findQualifierVector.size(); 151 else 152 return 0; 153 } 154 155 public static void main(String [] args) 157 { 158 FindQualifiers fq = new FindQualifiers(); 159 fq.addFindQualifier(new FindQualifier(FindQualifier.CASE_SENSITIVE_MATCH)); 160 fq.addFindQualifier(new FindQualifier("")); 161 fq.addFindQualifier(null); 162 } 163 } | Popular Tags |