| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
package com.xpn.xwiki.store; |
| 21 |
|
|
| 22 |
|
import java.util.Arrays; |
| 23 |
|
import java.util.List; |
| 24 |
|
|
| 25 |
|
import org.slf4j.Logger; |
| 26 |
|
import org.slf4j.LoggerFactory; |
| 27 |
|
import org.xwiki.bridge.event.DocumentCreatedEvent; |
| 28 |
|
import org.xwiki.bridge.event.DocumentDeletedEvent; |
| 29 |
|
import org.xwiki.bridge.event.DocumentUpdatedEvent; |
| 30 |
|
import org.xwiki.bridge.event.WikiDeletedEvent; |
| 31 |
|
import org.xwiki.cache.Cache; |
| 32 |
|
import org.xwiki.cache.CacheException; |
| 33 |
|
import org.xwiki.cache.CacheManager; |
| 34 |
|
import org.xwiki.cache.config.LRUCacheConfiguration; |
| 35 |
|
import org.xwiki.model.reference.DocumentReference; |
| 36 |
|
import org.xwiki.model.reference.EntityReferenceSerializer; |
| 37 |
|
import org.xwiki.observation.EventListener; |
| 38 |
|
import org.xwiki.observation.ObservationManager; |
| 39 |
|
import org.xwiki.observation.event.Event; |
| 40 |
|
import org.xwiki.observation.remote.RemoteObservationManagerContext; |
| 41 |
|
import org.xwiki.query.QueryManager; |
| 42 |
|
|
| 43 |
|
import com.xpn.xwiki.XWikiContext; |
| 44 |
|
import com.xpn.xwiki.XWikiException; |
| 45 |
|
import com.xpn.xwiki.doc.XWikiDocument; |
| 46 |
|
import com.xpn.xwiki.doc.XWikiLink; |
| 47 |
|
import com.xpn.xwiki.doc.XWikiLock; |
| 48 |
|
import com.xpn.xwiki.objects.classes.BaseClass; |
| 49 |
|
import com.xpn.xwiki.web.Utils; |
| 50 |
|
|
| 51 |
|
|
| 52 |
|
|
| 53 |
|
|
| 54 |
|
|
| 55 |
|
@version |
| 56 |
|
|
| |
|
| 66.2% |
Uncovered Elements: 78 (231) |
Complexity: 83 |
Complexity Density: 0.58 |
|
| 57 |
|
public class XWikiCacheStore implements XWikiCacheStoreInterface, EventListener |
| 58 |
|
{ |
| 59 |
|
private static final Logger LOGGER = LoggerFactory.getLogger(XWikiCacheStore.class); |
| 60 |
|
|
| 61 |
|
private XWikiStoreInterface store; |
| 62 |
|
|
| 63 |
|
private Cache<XWikiDocument> cache; |
| 64 |
|
|
| 65 |
|
private Cache<Boolean> pageExistCache; |
| 66 |
|
|
| 67 |
|
|
| 68 |
|
|
| 69 |
|
|
| 70 |
|
private RemoteObservationManagerContext remoteObservationManagerContext; |
| 71 |
|
|
| 72 |
|
private EntityReferenceSerializer<String> uidStringEntityReferenceSerializer; |
| 73 |
|
|
| 74 |
|
|
| 75 |
|
|
| 76 |
|
|
| 77 |
|
private ObservationManager observationManager; |
| 78 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
| 79 |
88 |
public XWikiCacheStore(XWikiStoreInterface store, XWikiContext context) throws XWikiException... |
| 80 |
|
{ |
| 81 |
88 |
setStore(store); |
| 82 |
88 |
initCache(context); |
| 83 |
|
|
| 84 |
|
|
| 85 |
88 |
this.remoteObservationManagerContext = Utils.getComponent(RemoteObservationManagerContext.class); |
| 86 |
88 |
this.observationManager = Utils.getComponent(ObservationManager.class); |
| 87 |
88 |
this.observationManager.addListener(this); |
| 88 |
88 |
this.uidStringEntityReferenceSerializer = Utils.getComponent(EntityReferenceSerializer.TYPE_STRING, "uid"); |
| 89 |
|
} |
| 90 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 91 |
870 |
@Override... |
| 92 |
|
public String getName() |
| 93 |
|
{ |
| 94 |
870 |
return "XWikiCacheStore"; |
| 95 |
|
} |
| 96 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 97 |
87 |
@Override... |
| 98 |
|
public List<Event> getEvents() |
| 99 |
|
{ |
| 100 |
87 |
return Arrays.<Event>asList(new DocumentCreatedEvent(), new DocumentUpdatedEvent(), new DocumentDeletedEvent(), |
| 101 |
|
new WikiDeletedEvent()); |
| 102 |
|
} |
| 103 |
|
|
| |
|
| 85.7% |
Uncovered Elements: 1 (7) |
Complexity: 2 |
Complexity Density: 0.29 |
|
| 104 |
88 |
public void initCache(XWikiContext context) throws XWikiException... |
| 105 |
|
{ |
| 106 |
88 |
CacheManager cacheManager = Utils.getComponent(CacheManager.class); |
| 107 |
|
|
| 108 |
88 |
try { |
| 109 |
88 |
int pageCacheCapacity = (int) context.getWiki().ParamAsLong("xwiki.store.cache.capacity", 500); |
| 110 |
88 |
this.cache = |
| 111 |
|
cacheManager.createNewCache(new LRUCacheConfiguration("xwiki.store.pagecache", pageCacheCapacity)); |
| 112 |
|
|
| 113 |
88 |
int pageExistCacheCapacity = |
| 114 |
|
(int) context.getWiki().ParamAsLong("xwiki.store.cache.pageexistcapacity", 10000); |
| 115 |
88 |
this.pageExistCache = cacheManager |
| 116 |
|
.createNewCache(new LRUCacheConfiguration("xwiki.store.pageexistcache", pageExistCacheCapacity)); |
| 117 |
|
} catch (CacheException e) { |
| 118 |
0 |
throw new XWikiException(XWikiException.MODULE_XWIKI_CACHE, XWikiException.ERROR_CACHE_INITIALIZING, |
| 119 |
|
"Failed to initialize cache", e); |
| 120 |
|
} |
| 121 |
|
} |
| 122 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 123 |
0 |
@Deprecated... |
| 124 |
|
@Override |
| 125 |
|
public void initCache(int capacity, int pageExistCacheCapacity, XWikiContext context) throws XWikiException |
| 126 |
|
{ |
| 127 |
|
|
| 128 |
|
} |
| 129 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 130 |
11680 |
@Override... |
| 131 |
|
public XWikiStoreInterface getStore() |
| 132 |
|
{ |
| 133 |
11683 |
return this.store; |
| 134 |
|
} |
| 135 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 136 |
88 |
@Override... |
| 137 |
|
public void setStore(XWikiStoreInterface store) |
| 138 |
|
{ |
| 139 |
88 |
this.store = store; |
| 140 |
|
} |
| 141 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 142 |
3805 |
@Override... |
| 143 |
|
public void saveXWikiDoc(XWikiDocument doc, XWikiContext context) throws XWikiException |
| 144 |
|
{ |
| 145 |
3805 |
saveXWikiDoc(doc, context, true); |
| 146 |
|
} |
| 147 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
| 148 |
3805 |
@Override... |
| 149 |
|
public void saveXWikiDoc(XWikiDocument doc, XWikiContext context, boolean bTransaction) throws XWikiException |
| 150 |
|
{ |
| 151 |
3805 |
this.store.saveXWikiDoc(doc, context, bTransaction); |
| 152 |
|
|
| 153 |
3805 |
doc.setStore(this.store); |
| 154 |
|
|
| 155 |
|
|
| 156 |
|
|
| 157 |
3805 |
String key = getKey(doc, context); |
| 158 |
3805 |
getCache().remove(key); |
| 159 |
3805 |
getPageExistCache().remove(key); |
| 160 |
|
|
| 161 |
|
|
| 162 |
|
|
| 163 |
|
|
| 164 |
|
|
| 165 |
|
|
| 166 |
|
|
| 167 |
|
} |
| 168 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 169 |
3 |
@Override... |
| 170 |
|
public void flushCache() |
| 171 |
|
{ |
| 172 |
3 |
getCache().removeAll(); |
| 173 |
3 |
getPageExistCache().removeAll(); |
| 174 |
|
} |
| 175 |
|
|
| |
|
| 76.5% |
Uncovered Elements: 4 (17) |
Complexity: 5 |
Complexity Density: 0.56 |
|
| 176 |
4039 |
@Override... |
| 177 |
|
public void onEvent(Event event, Object source, Object data) |
| 178 |
|
{ |
| 179 |
|
|
| 180 |
4039 |
if (this.remoteObservationManagerContext.isRemoteState()) { |
| 181 |
8 |
if (event instanceof WikiDeletedEvent) { |
| 182 |
0 |
flushCache(); |
| 183 |
|
} else { |
| 184 |
8 |
XWikiDocument doc = (XWikiDocument) source; |
| 185 |
|
|
| 186 |
8 |
String key = doc.getKey(); |
| 187 |
|
|
| 188 |
8 |
if (getCache() != null) { |
| 189 |
8 |
getCache().remove(key); |
| 190 |
|
} |
| 191 |
8 |
if (getPageExistCache() != null) { |
| 192 |
8 |
getPageExistCache().remove(key); |
| 193 |
|
} |
| 194 |
|
} |
| 195 |
|
} |
| 196 |
|
} |
| 197 |
|
|
| 198 |
|
|
| 199 |
|
@deprecated@link |
| 200 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 201 |
0 |
@Deprecated... |
| 202 |
|
public String getKey(XWikiDocument doc) |
| 203 |
|
{ |
| 204 |
0 |
return doc.getKey(); |
| 205 |
|
} |
| 206 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
| 207 |
644385 |
public String getKey(XWikiDocument doc, XWikiContext context)... |
| 208 |
|
{ |
| 209 |
644360 |
DocumentReference reference = doc.getDocumentReferenceWithLocale(); |
| 210 |
|
|
| 211 |
|
|
| 212 |
644355 |
if (!reference.getWikiReference().equals(context.getWikiReference())) { |
| 213 |
2 |
reference = reference.setWikiReference(context.getWikiReference()); |
| 214 |
|
} |
| 215 |
|
|
| 216 |
|
|
| 217 |
644349 |
return this.uidStringEntityReferenceSerializer.serialize(reference, reference); |
| 218 |
|
} |
| 219 |
|
|
| 220 |
|
|
| 221 |
|
@deprecated@link |
| 222 |
|
|
| |
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 223 |
0 |
@Deprecated... |
| 224 |
|
public String getKey(String fullName, String language, XWikiContext context) |
| 225 |
|
{ |
| 226 |
0 |
XWikiDocument doc = new XWikiDocument(null, fullName); |
| 227 |
0 |
doc.setLanguage(language); |
| 228 |
|
|
| 229 |
0 |
return getKey(doc, context); |
| 230 |
|
} |
| 231 |
|
|
| 232 |
|
|
| 233 |
|
@deprecated@link |
| 234 |
|
|
| |
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 235 |
0 |
@Deprecated... |
| 236 |
|
public String getKey(final String wiki, final String fullName, final String language) |
| 237 |
|
{ |
| 238 |
0 |
XWikiDocument doc = new XWikiDocument(wiki, null, fullName); |
| 239 |
0 |
doc.setLanguage(language); |
| 240 |
|
|
| 241 |
0 |
return getKey(doc); |
| 242 |
|
} |
| 243 |
|
|
| |
|
| 93.9% |
Uncovered Elements: 2 (33) |
Complexity: 5 |
Complexity Density: 0.19 |
|
| 244 |
585722 |
@Override... |
| 245 |
|
public XWikiDocument loadXWikiDoc(XWikiDocument doc, XWikiContext context) throws XWikiException |
| 246 |
|
{ |
| 247 |
|
|
| 248 |
585701 |
String key = getKey(doc, context); |
| 249 |
|
|
| 250 |
585688 |
LOGGER.debug("Cache: Trying to get doc {} from cache", key); |
| 251 |
|
|
| 252 |
585681 |
XWikiDocument cachedoc; |
| 253 |
585687 |
try { |
| 254 |
585661 |
cachedoc = getCache().get(key); |
| 255 |
|
} catch (Exception e) { |
| 256 |
0 |
LOGGER.error("Failed to get document from the cache", e); |
| 257 |
|
|
| 258 |
0 |
cachedoc = null; |
| 259 |
|
} |
| 260 |
|
|
| 261 |
585687 |
if (cachedoc != null) { |
| 262 |
147992 |
cachedoc.setFromCache(true); |
| 263 |
|
|
| 264 |
147990 |
LOGGER.debug("Cache: got doc {} from cache", key); |
| 265 |
|
} else { |
| 266 |
437691 |
Boolean result = getPageExistCache().get(key); |
| 267 |
|
|
| 268 |
437734 |
if (result == Boolean.FALSE) { |
| 269 |
426660 |
LOGGER.debug("Cache: The document {} does not exist, return an empty one", key); |
| 270 |
|
|
| 271 |
426661 |
cachedoc = doc; |
| 272 |
426664 |
cachedoc.setNew(true); |
| 273 |
|
|
| 274 |
|
|
| 275 |
|
|
| 276 |
426656 |
cachedoc.setOriginalDocument(new XWikiDocument(cachedoc.getDocumentReference(), cachedoc.getLocale())); |
| 277 |
|
} else { |
| 278 |
11062 |
LOGGER.debug("Cache: Trying to get doc {} from persistent storage", key); |
| 279 |
|
|
| 280 |
11063 |
cachedoc = this.store.loadXWikiDoc(doc, context); |
| 281 |
|
|
| 282 |
11059 |
LOGGER.debug("Cache: Got doc {} from storage", key); |
| 283 |
|
|
| 284 |
11059 |
if (cachedoc.isNew()) { |
| 285 |
7458 |
getPageExistCache().set(key, Boolean.FALSE); |
| 286 |
|
} else { |
| 287 |
3603 |
getCache().set(key, cachedoc); |
| 288 |
|
|
| 289 |
|
|
| 290 |
3603 |
getPageExistCache().set(key, Boolean.TRUE); |
| 291 |
|
} |
| 292 |
|
|
| 293 |
11068 |
LOGGER.debug("Cache: put doc {} in cache", key); |
| 294 |
|
} |
| 295 |
|
|
| 296 |
437729 |
cachedoc.setStore(this.store); |
| 297 |
|
} |
| 298 |
|
|
| 299 |
585710 |
LOGGER.debug("Cache: end for doc {} in cache", key); |
| 300 |
|
|
| 301 |
585708 |
return cachedoc; |
| 302 |
|
} |
| 303 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
| 304 |
153 |
@Override... |
| 305 |
|
public void deleteXWikiDoc(XWikiDocument doc, XWikiContext context) throws XWikiException |
| 306 |
|
{ |
| 307 |
|
|
| 308 |
153 |
String key = getKey(doc, context); |
| 309 |
|
|
| 310 |
153 |
this.store.deleteXWikiDoc(doc, context); |
| 311 |
|
|
| 312 |
153 |
getCache().remove(key); |
| 313 |
153 |
getPageExistCache().remove(key); |
| 314 |
153 |
getPageExistCache().set(key, Boolean.FALSE); |
| 315 |
|
} |
| 316 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 317 |
28 |
@Override... |
| 318 |
|
public List<String> getClassList(XWikiContext context) throws XWikiException |
| 319 |
|
{ |
| 320 |
28 |
return this.store.getClassList(context); |
| 321 |
|
} |
| 322 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 323 |
0 |
@Override... |
| 324 |
|
public int countDocuments(String wheresql, XWikiContext context) throws XWikiException |
| 325 |
|
{ |
| 326 |
0 |
return this.store.countDocuments(wheresql, context); |
| 327 |
|
} |
| 328 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 329 |
78 |
@Override... |
| 330 |
|
public List<DocumentReference> searchDocumentReferences(String wheresql, XWikiContext context) throws XWikiException |
| 331 |
|
{ |
| 332 |
78 |
return this.store.searchDocumentReferences(wheresql, context); |
| 333 |
|
} |
| 334 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 335 |
0 |
@Override... |
| 336 |
|
public List<String> searchDocumentsNames(String wheresql, XWikiContext context) throws XWikiException |
| 337 |
|
{ |
| 338 |
0 |
return this.store.searchDocumentsNames(wheresql, context); |
| 339 |
|
} |
| 340 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 341 |
0 |
@Override... |
| 342 |
|
public List<DocumentReference> searchDocumentReferences(String wheresql, int nb, int start, XWikiContext context) |
| 343 |
|
throws XWikiException |
| 344 |
|
{ |
| 345 |
0 |
return this.store.searchDocumentReferences(wheresql, nb, start, context); |
| 346 |
|
} |
| 347 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 348 |
14 |
@Override... |
| 349 |
|
public List<String> searchDocumentsNames(String wheresql, int nb, int start, XWikiContext context) |
| 350 |
|
throws XWikiException |
| 351 |
|
{ |
| 352 |
14 |
return this.store.searchDocumentsNames(wheresql, nb, start, context); |
| 353 |
|
} |
| 354 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 355 |
0 |
@Override... |
| 356 |
|
public List<DocumentReference> searchDocumentReferences(String wheresql, int nb, int start, String selectColumns, |
| 357 |
|
XWikiContext context) throws XWikiException |
| 358 |
|
{ |
| 359 |
0 |
return this.store.searchDocumentReferences(wheresql, nb, start, selectColumns, context); |
| 360 |
|
} |
| 361 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 362 |
0 |
@Override... |
| 363 |
|
public List<String> searchDocumentsNames(String wheresql, int nb, int start, String selectColumns, |
| 364 |
|
XWikiContext context) throws XWikiException |
| 365 |
|
{ |
| 366 |
0 |
return this.store.searchDocumentsNames(wheresql, nb, start, selectColumns, context); |
| 367 |
|
} |
| 368 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 369 |
0 |
@Override... |
| 370 |
|
public List<DocumentReference> searchDocumentReferences(String parametrizedSqlClause, int nb, int start, |
| 371 |
|
List<?> parameterValues, XWikiContext context) throws XWikiException |
| 372 |
|
{ |
| 373 |
0 |
return this.store.searchDocumentReferences(parametrizedSqlClause, nb, start, parameterValues, context); |
| 374 |
|
} |
| 375 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 376 |
2 |
@Override... |
| 377 |
|
public List<String> searchDocumentsNames(String parametrizedSqlClause, int nb, int start, List<?> parameterValues, |
| 378 |
|
XWikiContext context) throws XWikiException |
| 379 |
|
{ |
| 380 |
2 |
return this.store.searchDocumentsNames(parametrizedSqlClause, nb, start, parameterValues, context); |
| 381 |
|
} |
| 382 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 383 |
7823 |
@Override... |
| 384 |
|
public List<DocumentReference> searchDocumentReferences(String parametrizedSqlClause, List<?> parameterValues, |
| 385 |
|
XWikiContext context) throws XWikiException |
| 386 |
|
{ |
| 387 |
7823 |
return this.store.searchDocumentReferences(parametrizedSqlClause, parameterValues, context); |
| 388 |
|
} |
| 389 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 390 |
0 |
@Override... |
| 391 |
|
public List<String> searchDocumentsNames(String parametrizedSqlClause, List<?> parameterValues, |
| 392 |
|
XWikiContext context) throws XWikiException |
| 393 |
|
{ |
| 394 |
0 |
return this.store.searchDocumentsNames(parametrizedSqlClause, parameterValues, context); |
| 395 |
|
} |
| 396 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 397 |
0 |
@Override... |
| 398 |
|
public boolean isCustomMappingValid(BaseClass bclass, String custommapping1, XWikiContext context) |
| 399 |
|
throws XWikiException |
| 400 |
|
{ |
| 401 |
0 |
return this.store.isCustomMappingValid(bclass, custommapping1, context); |
| 402 |
|
} |
| 403 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 404 |
1967 |
@Override... |
| 405 |
|
public boolean injectCustomMapping(BaseClass doc1class, XWikiContext context) throws XWikiException |
| 406 |
|
{ |
| 407 |
1967 |
return this.store.injectCustomMapping(doc1class, context); |
| 408 |
|
} |
| 409 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 410 |
0 |
@Override... |
| 411 |
|
public boolean injectCustomMappings(XWikiDocument doc, XWikiContext context) throws XWikiException |
| 412 |
|
{ |
| 413 |
0 |
return this.store.injectCustomMappings(doc, context); |
| 414 |
|
} |
| 415 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 416 |
0 |
@Override... |
| 417 |
|
public List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbyname, XWikiContext context) |
| 418 |
|
throws XWikiException |
| 419 |
|
{ |
| 420 |
0 |
return this.store.searchDocuments(wheresql, distinctbyname, context); |
| 421 |
|
} |
| 422 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 423 |
0 |
@Override... |
| 424 |
|
public List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbyname, boolean customMapping, |
| 425 |
|
XWikiContext context) throws XWikiException |
| 426 |
|
{ |
| 427 |
0 |
return this.store.searchDocuments(wheresql, distinctbyname, customMapping, context); |
| 428 |
|
} |
| 429 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 430 |
0 |
@Override... |
| 431 |
|
public List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbyname, int nb, int start, |
| 432 |
|
XWikiContext context) throws XWikiException |
| 433 |
|
{ |
| 434 |
0 |
return this.store.searchDocuments(wheresql, distinctbyname, nb, start, context); |
| 435 |
|
} |
| 436 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 437 |
0 |
@Override... |
| 438 |
|
public List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbyname, boolean customMapping, int nb, |
| 439 |
|
int start, XWikiContext context) throws XWikiException |
| 440 |
|
{ |
| 441 |
0 |
return this.store.searchDocuments(wheresql, distinctbyname, customMapping, nb, start, context); |
| 442 |
|
} |
| 443 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 444 |
0 |
@Override... |
| 445 |
|
public List<XWikiDocument> searchDocuments(String wheresql, XWikiContext context) throws XWikiException |
| 446 |
|
{ |
| 447 |
0 |
return this.store.searchDocuments(wheresql, context); |
| 448 |
|
} |
| 449 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 450 |
0 |
@Override... |
| 451 |
|
public List<XWikiDocument> searchDocuments(String wheresql, int nb, int start, XWikiContext context) |
| 452 |
|
throws XWikiException |
| 453 |
|
{ |
| 454 |
0 |
return this.store.searchDocuments(wheresql, nb, start, context); |
| 455 |
|
} |
| 456 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 457 |
0 |
@Override... |
| 458 |
|
public List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbyname, boolean customMapping, |
| 459 |
|
boolean checkRight, int nb, int start, XWikiContext context) throws XWikiException |
| 460 |
|
{ |
| 461 |
0 |
return this.store.searchDocuments(wheresql, distinctbyname, customMapping, checkRight, nb, start, context); |
| 462 |
|
} |
| 463 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 464 |
5 |
@Override... |
| 465 |
|
public List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbylanguage, int nb, int start, |
| 466 |
|
List<?> parameterValues, XWikiContext context) throws XWikiException |
| 467 |
|
{ |
| 468 |
5 |
return this.store.searchDocuments(wheresql, distinctbylanguage, nb, start, parameterValues, context); |
| 469 |
|
} |
| 470 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 471 |
0 |
@Override... |
| 472 |
|
public List<XWikiDocument> searchDocuments(String wheresql, List<?> parameterValues, XWikiContext context) |
| 473 |
|
throws XWikiException |
| 474 |
|
{ |
| 475 |
0 |
return this.store.searchDocuments(wheresql, parameterValues, context); |
| 476 |
|
} |
| 477 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 478 |
0 |
@Override... |
| 479 |
|
public List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbylanguage, boolean customMapping, |
| 480 |
|
int nb, int start, List<?> parameterValues, XWikiContext context) throws XWikiException |
| 481 |
|
{ |
| 482 |
0 |
return this.store.searchDocuments(wheresql, distinctbylanguage, customMapping, nb, start, parameterValues, |
| 483 |
|
context); |
| 484 |
|
} |
| 485 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 486 |
0 |
@Override... |
| 487 |
|
public List<XWikiDocument> searchDocuments(String wheresql, int nb, int start, List<?> parameterValues, |
| 488 |
|
XWikiContext context) throws XWikiException |
| 489 |
|
{ |
| 490 |
0 |
return this.store.searchDocuments(wheresql, nb, start, parameterValues, context); |
| 491 |
|
} |
| 492 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 493 |
0 |
@Override... |
| 494 |
|
public List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbylanguage, boolean customMapping, |
| 495 |
|
boolean checkRight, int nb, int start, List<?> parameterValues, XWikiContext context) throws XWikiException |
| 496 |
|
{ |
| 497 |
0 |
return this.store.searchDocuments(wheresql, distinctbylanguage, customMapping, checkRight, nb, start, |
| 498 |
|
parameterValues, context); |
| 499 |
|
} |
| 500 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 501 |
0 |
@Override... |
| 502 |
|
public int countDocuments(String parametrizedSqlClause, List<?> parameterValues, XWikiContext context) |
| 503 |
|
throws XWikiException |
| 504 |
|
{ |
| 505 |
0 |
return this.store.countDocuments(parametrizedSqlClause, parameterValues, context); |
| 506 |
|
} |
| 507 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 508 |
1794 |
@Override... |
| 509 |
|
public XWikiLock loadLock(long docId, XWikiContext context, boolean bTransaction) throws XWikiException |
| 510 |
|
{ |
| 511 |
1794 |
return this.store.loadLock(docId, context, bTransaction); |
| 512 |
|
} |
| 513 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 514 |
559 |
@Override... |
| 515 |
|
public void saveLock(XWikiLock lock, XWikiContext context, boolean bTransaction) throws XWikiException |
| 516 |
|
{ |
| 517 |
561 |
this.store.saveLock(lock, context, bTransaction); |
| 518 |
|
} |
| 519 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 520 |
263 |
@Override... |
| 521 |
|
public void deleteLock(XWikiLock lock, XWikiContext context, boolean bTransaction) throws XWikiException |
| 522 |
|
{ |
| 523 |
263 |
this.store.deleteLock(lock, context, bTransaction); |
| 524 |
|
} |
| 525 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 526 |
3 |
@Override... |
| 527 |
|
public List<XWikiLink> loadLinks(long docId, XWikiContext context, boolean bTransaction) throws XWikiException |
| 528 |
|
{ |
| 529 |
3 |
return this.store.loadLinks(docId, context, bTransaction); |
| 530 |
|
} |
| 531 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 532 |
5 |
@Override... |
| 533 |
|
public List<DocumentReference> loadBacklinks(DocumentReference documentReference, boolean bTransaction, |
| 534 |
|
XWikiContext context) throws XWikiException |
| 535 |
|
{ |
| 536 |
5 |
return this.store.loadBacklinks(documentReference, bTransaction, context); |
| 537 |
|
} |
| 538 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 539 |
14 |
@Override... |
| 540 |
|
public List<String> loadBacklinks(String fullName, XWikiContext context, boolean bTransaction) throws XWikiException |
| 541 |
|
{ |
| 542 |
14 |
return this.store.loadBacklinks(fullName, context, bTransaction); |
| 543 |
|
} |
| 544 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 545 |
0 |
@Override... |
| 546 |
|
public void saveLinks(XWikiDocument doc, XWikiContext context, boolean bTransaction) throws XWikiException |
| 547 |
|
{ |
| 548 |
0 |
this.store.saveLinks(doc, context, bTransaction); |
| 549 |
|
} |
| 550 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 551 |
0 |
@Override... |
| 552 |
|
public void deleteLinks(long docId, XWikiContext context, boolean bTransaction) throws XWikiException |
| 553 |
|
{ |
| 554 |
0 |
this.store.deleteLinks(docId, context, bTransaction); |
| 555 |
|
} |
| 556 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 557 |
0 |
@Override... |
| 558 |
|
public <T> List<T> search(String sql, int nb, int start, XWikiContext context) throws XWikiException |
| 559 |
|
{ |
| 560 |
0 |
return this.store.search(sql, nb, start, context); |
| 561 |
|
} |
| 562 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 563 |
1 |
@Override... |
| 564 |
|
public <T> List<T> search(String sql, int nb, int start, Object[][] whereParams, XWikiContext context) |
| 565 |
|
throws XWikiException |
| 566 |
|
{ |
| 567 |
1 |
return this.store.search(sql, nb, start, whereParams, context); |
| 568 |
|
} |
| 569 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 570 |
120 |
@Override... |
| 571 |
|
public <T> List<T> search(String sql, int nb, int start, List<?> parameterValues, XWikiContext context) |
| 572 |
|
throws XWikiException |
| 573 |
|
{ |
| 574 |
120 |
return this.store.search(sql, nb, start, parameterValues, context); |
| 575 |
|
} |
| 576 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 577 |
0 |
@Override... |
| 578 |
|
public <T> List<T> search(String sql, int nb, int start, Object[][] whereParams, List<?> parameterValues, |
| 579 |
|
XWikiContext context) throws XWikiException |
| 580 |
|
{ |
| 581 |
0 |
return this.store.search(sql, nb, start, whereParams, parameterValues, context); |
| 582 |
|
} |
| 583 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 584 |
9620 |
@Override... |
| 585 |
|
public synchronized void cleanUp(XWikiContext context) |
| 586 |
|
{ |
| 587 |
9620 |
this.store.cleanUp(context); |
| 588 |
|
} |
| 589 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 590 |
35 |
@Override... |
| 591 |
|
public boolean isWikiNameAvailable(String wikiName, XWikiContext context) throws XWikiException |
| 592 |
|
{ |
| 593 |
35 |
synchronized (wikiName) { |
| 594 |
35 |
return this.store.isWikiNameAvailable(wikiName, context); |
| 595 |
|
} |
| 596 |
|
} |
| 597 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 598 |
4 |
@Override... |
| 599 |
|
public void createWiki(String wikiName, XWikiContext context) throws XWikiException |
| 600 |
|
{ |
| 601 |
4 |
synchronized (wikiName) { |
| 602 |
4 |
this.store.createWiki(wikiName, context); |
| 603 |
|
} |
| 604 |
|
} |
| 605 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 606 |
3 |
@Override... |
| 607 |
|
public void deleteWiki(String wikiName, XWikiContext context) throws XWikiException |
| 608 |
|
{ |
| 609 |
3 |
synchronized (wikiName) { |
| 610 |
3 |
this.store.deleteWiki(wikiName, context); |
| 611 |
3 |
flushCache(); |
| 612 |
|
} |
| 613 |
|
} |
| 614 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 3 |
Complexity Density: 0.38 |
|
| 615 |
54723 |
@Override... |
| 616 |
|
public boolean exists(XWikiDocument doc, XWikiContext context) throws XWikiException |
| 617 |
|
{ |
| 618 |
|
|
| 619 |
54718 |
String key = getKey(doc, context); |
| 620 |
|
|
| 621 |
54723 |
try { |
| 622 |
54723 |
Boolean result = getPageExistCache().get(key); |
| 623 |
|
|
| 624 |
54722 |
if (result != null) { |
| 625 |
53339 |
return result; |
| 626 |
|
} |
| 627 |
|
} catch (Exception e) { |
| 628 |
|
} |
| 629 |
|
|
| 630 |
1383 |
boolean result = this.store.exists(doc, context); |
| 631 |
1383 |
getPageExistCache().set(key, Boolean.valueOf(result)); |
| 632 |
|
|
| 633 |
1383 |
return result; |
| 634 |
|
} |
| 635 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 636 |
593274 |
public Cache<XWikiDocument> getCache()... |
| 637 |
|
{ |
| 638 |
593258 |
return this.cache; |
| 639 |
|
} |
| 640 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 641 |
0 |
public void setCache(Cache<XWikiDocument> cache)... |
| 642 |
|
{ |
| 643 |
0 |
this.cache = cache; |
| 644 |
|
} |
| 645 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 646 |
508985 |
public Cache<Boolean> getPageExistCache()... |
| 647 |
|
{ |
| 648 |
508978 |
return this.pageExistCache; |
| 649 |
|
} |
| 650 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 651 |
0 |
public void setPageExistCache(Cache<Boolean> pageExistCache)... |
| 652 |
|
{ |
| 653 |
0 |
this.pageExistCache = pageExistCache; |
| 654 |
|
} |
| 655 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 656 |
78 |
@Override... |
| 657 |
|
public List<String> getCustomMappingPropertyList(BaseClass bclass) |
| 658 |
|
{ |
| 659 |
78 |
return this.store.getCustomMappingPropertyList(bclass); |
| 660 |
|
} |
| 661 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 662 |
0 |
@Override... |
| 663 |
|
public synchronized void injectCustomMappings(XWikiContext context) throws XWikiException |
| 664 |
|
{ |
| 665 |
0 |
this.store.injectCustomMappings(context); |
| 666 |
|
} |
| 667 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 668 |
0 |
@Override... |
| 669 |
|
public void injectUpdatedCustomMappings(XWikiContext context) throws XWikiException |
| 670 |
|
{ |
| 671 |
0 |
this.store.injectUpdatedCustomMappings(context); |
| 672 |
|
} |
| 673 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 674 |
0 |
@Override... |
| 675 |
|
public List<String> getTranslationList(XWikiDocument doc, XWikiContext context) throws XWikiException |
| 676 |
|
{ |
| 677 |
0 |
return this.store.getTranslationList(doc, context); |
| 678 |
|
} |
| 679 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 680 |
351 |
@Override... |
| 681 |
|
public QueryManager getQueryManager() |
| 682 |
|
{ |
| 683 |
351 |
return getStore().getQueryManager(); |
| 684 |
|
} |
| 685 |
|
} |