Changeset 689 for MDService2/trunk/MDService2/src/eu
- Timestamp:
- 09/12/10 20:47:10 (14 years ago)
- Location:
- MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/Cache.java
r676 r689 48 48 public class Cache { 49 49 public static String PREFIX = "xc_"; 50 51 public static String USE = "use"; 52 public static String REFRESH = "refresh"; 53 public static String SKIP= "skip"; 50 54 51 55 private static Cache singleton; -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/GenericProxyAction.java
r656 r689 30 30 private String actionkey; 31 31 private String q; 32 private String cache = Cache.USE; 32 33 private String collection; 33 34 private int maxdepth; … … 43 44 public void setQ(String q) { 44 45 this.q = q; 46 } 47 48 public String getCache() { 49 return cache; 50 } 51 52 public void setCache(String cache) { 53 this.cache = cache; 45 54 } 46 55 … … 177 186 String xcid; 178 187 Admin.notifyUser("GPA.prepareSourceStream"); 179 sourceStream = Cache.getCache().getFromCache(getRequestKey()); 180 if (sourceStream == null) { 181 //sourceStream = getTargetRequest().openStream(); 188 if (getCache().equals(Cache.SKIP)) { 189 182 190 sourceStream = getSourceStream(); 183 xcid = Cache.getCache().putInCache(getRequestKey(),sourceStream); 184 Admin.notifyUser("putting in cache: " + getRequestKey()); 185 sourceStream = Cache.getCache().getFromCache(getRequestKey()); 186 } else { 187 Admin.notifyUser("reading from cache: " + getRequestKey()); 188 } 189 191 192 } else { 193 if (getCache().equals(Cache.USE)) { 194 sourceStream = Cache.getCache().getFromCache(getRequestKey()); 195 } 196 197 if (sourceStream == null) { // either not in cache or cache_flag=refresh 198 //sourceStream = getTargetRequest().openStream(); 199 sourceStream = getSourceStream(); 200 xcid = Cache.getCache().putInCache(getRequestKey(),sourceStream); 201 Admin.notifyUser("putting in cache: " + getRequestKey()); 202 sourceStream = Cache.getCache().getFromCache(getRequestKey()); 203 } else { 204 Admin.notifyUser("reading from cache: " + getRequestKey()); 205 } 206 } 207 190 208 if (format.equals("xml")) { 191 209 resultStream = sourceStream; -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/model/Query.java
r685 r689 176 176 } else if (type.equals(RECORD)) { 177 177 // 2010-07-11 this is just a hack, because url-encoding the handle acted strange 178 String corrid = getQueryString().replace('_', '/'); 178 //String corrid = getQueryString().replace('_', '/'); 179 String corrid = getQueryString(); 179 180 targetRequest = "//MdSelfLink[.='" + corrid + "']"; 180 181 } else {
Note: See TracChangeset
for help on using the changeset viewer.