1 64 65 package com.jcorporate.expresso.core.dbobj; 66 67 import java.util.ArrayList ; 68 import java.util.HashMap ; 69 import java.util.Hashtable ; 70 import java.util.Iterator ; 71 import java.util.Map ; 72 import java.util.Set ; 73 import java.util.TreeSet ; 74 75 80 class SchemaDefinition { 81 82 private Set memberSet = new TreeSet (); 83 private Set controllerSet = new TreeSet (); 84 private Set reportSet = new TreeSet (); 85 private Set jobSet = new TreeSet (); 86 private Set servletSet = new TreeSet (); 87 private Set configValueSet = new TreeSet (); 88 private Hashtable dbobjMap = new Hashtable (10); 89 92 private Map testSet = new HashMap (); 93 94 95 public SchemaDefinition() { 96 98 } 99 100 103 synchronized public Iterator getMembers() { 104 return new TreeSet (memberSet).iterator(); 105 } 106 107 110 synchronized public void addMember(String newMember) { 111 memberSet.add(newMember); 112 } 113 114 117 synchronized public Iterator getControllers() { 118 return new TreeSet (controllerSet).iterator(); 119 } 120 121 124 synchronized public void addController(String newController) { 125 controllerSet.add(newController); 126 } 127 128 131 synchronized public Iterator getReports() { 132 return new TreeSet (reportSet).iterator(); 133 } 134 135 synchronized public void addReport(String newValue) { 136 reportSet.add(newValue); 137 } 138 139 140 143 synchronized public Iterator getJobs() { 144 return new TreeSet (jobSet).iterator(); 145 } 146 147 150 synchronized public void addJob(String newValue) { 151 jobSet.add(newValue); 152 } 153 154 157 synchronized public Iterator getServlets() { 158 return new TreeSet (servletSet).iterator(); 159 } 160 161 164 synchronized public void addServlet(String newValue) { 165 servletSet.add(newValue); 166 } 167 168 171 synchronized public Iterator getConfigValues() { 172 return new TreeSet (configValueSet).iterator(); 173 } 174 175 176 synchronized public void addConfigValue(String newValue) { 177 configValueSet.add(newValue); 178 } 179 180 181 184 synchronized public Hashtable getDbobjMap() { 185 return dbobjMap; 186 } 187 188 synchronized public void addDBObjectMap(String className, String dataContext) { 189 dbobjMap.put(className, dataContext); 190 } 191 192 195 synchronized public Iterator getTests() { 196 return new ArrayList (testSet.values()).iterator(); 197 } 198 199 202 synchronized public void addTest(junit.framework.Test newValue) { 203 testSet.put(((Object ) newValue).getClass().getName(), newValue); 204 } 205 206 209 public boolean contains(DBObject dbObject) { 210 return memberSet.contains(dbObject.getClass().getName()); 211 } 212 213 } | Popular Tags |