1 22 23 package org.cofax; 24 25 import java.util.*; 26 27 54 55 public abstract class DataStore { 56 57 private String lastError; 58 59 private boolean error; 60 61 private boolean connected; 62 63 private static String dataStoreName; 64 65 public final static int PACKAGE_TAG_CACHE = 1; 66 67 public final static int PACKAGE_TAG_PROCESSED = 2; 68 69 public final static int PACKAGE_TAG_RESULTS = 3; 70 71 public final static int CLOB_COLUMNS = 4; 72 73 public final static int PACKAGE_TAG_CACHE_COMMAND = 5; 74 75 78 public static String dataLog = "0"; 79 80 83 public static String dataLogLocation = ""; 84 85 88 public static long dataLogMaxSize = 0; 89 90 93 94 public abstract void init(String configFile); 95 96 100 public abstract void init(Properties dbProps); 101 102 106 public abstract void initPool(); 107 108 111 public abstract void setCache(Object cache, int whichCache); 112 113 116 public abstract void clearCache(int whichCache); 117 118 121 public abstract Object getCacheValue(Object key, int whichCache); 122 123 public abstract String getPoolConnectionStats(String name); 124 125 public abstract String getURL(); 126 127 public abstract String getUser(); 128 129 public abstract String getPassword(); 130 131 public abstract int getMaxConns(); 132 133 public abstract int getInitConns(); 134 135 public abstract int getTimeOut(); 136 137 public abstract int getConUsageLimit(); 138 139 public abstract long getKillTime(); 140 141 public abstract void setURL(String in); 142 143 public abstract void setUser(String in); 144 145 public abstract void setPassword(String in); 146 147 public abstract void setMaxConns(int in); 148 149 public abstract void setInitConns(int in); 150 151 public abstract void setTimeOut(int in); 152 153 public abstract void setConUsageLimit(int in); 154 155 public abstract void setKillTime(long in); 156 157 160 protected void setError(boolean error) { 161 this.error = error; 162 } 163 164 167 public boolean getError() { 168 return error; 169 } 170 171 174 public abstract void destroy(); 175 176 179 public String getLastError() { 180 181 return lastError + ""; 182 183 } 184 185 188 public void setLastError(String lastError) { 189 190 this.lastError = lastError; 191 192 } 193 194 197 public String getDataStoreName() { 198 return dataStoreName; 199 } 200 201 204 public void setDataStoreName(String name) { 205 dataStoreName = name; 206 } 207 208 211 public abstract boolean connect(); 212 213 216 public abstract boolean connectFromPool(); 217 218 227 public abstract String getPackageTag(String tag, HashMap params, String servPage, String servAddr); 228 229 235 public abstract List getPackageData(String tag, String tagStatement, String servPage, String servAddr); 236 237 240 public abstract List getPackageData(HashMap data, String tagName, String tagData, boolean init); 241 242 245 public abstract boolean disConnect(); 246 247 250 public boolean isConnected() { 251 return connected; 252 } 253 254 257 public void setConnected(boolean connected) { 258 this.connected = connected; 259 } 260 261 264 public abstract boolean insertArticle(HashMap article, String approvedBy, String xmlFileType, ArrayList mappings, ArrayList relatedLinks); 265 266 269 public String toString() { 270 return "Instance Of: " + getClass().getName() + "\n" + "dataStoreName: " + dataStoreName; 271 } 272 273 276 public abstract HashMap searchArticles(HashMap htParams); 277 278 281 public abstract String selectPackagetags(); 282 283 public abstract String selectPackagetagsCache(); 284 } 285 | Popular Tags |