use of com.adobe.acs.commons.httpcache.store.jcr.impl.writer.EntryNodeWriter in project acs-aem-commons by Adobe-Consulting-Services.
the class JCRHttpCacheStoreImpl method put.
@Override
public void put(final CacheKey key, final CacheContent content) throws HttpCacheDataStreamException {
final long currentTime = System.currentTimeMillis();
incrementLoadCount();
withSession(new Consumer<Session>() {
@Override
public void accept(Session session) throws Exception {
final BucketNodeFactory factory = new BucketNodeFactory(session, cacheRootPath, key, bucketTreeDepth);
final Node bucketNode = factory.getBucketNode();
final Node entryNode = new BucketNodeHandler(bucketNode, dclm).createOrRetrieveEntryNode(key);
new EntryNodeWriter(session, entryNode, key, content, expireTimeInSeconds).write();
session.save();
incrementLoadSuccessCount();
incrementTotalLoadTime(System.currentTimeMillis() - currentTime);
}
}, new Consumer<Exception>() {
@Override
public void accept(Exception e) throws Exception {
incrementLoadExceptionCount();
}
});
}
Aggregations