Examples of addCacheEntry()


Examples of org.apache.marmotta.ldcache.api.LDCachingConnection.addCacheEntry()

                CacheEntry entry = con.getCacheEntry(resource);
                if(entry.getExpiryDate().getTime() > now.getTime()) {
                    entry.setExpiryDate(now);

                    con.removeCacheEntry(entry.getResource());
                    con.addCacheEntry(entry.getResource(),entry);
                }

                con.commit();
            } catch(RepositoryException ex) {
                con.rollback();
View Full Code Here

Examples of org.apache.marmotta.ldcache.api.LDCachingConnection.addCacheEntry()

                            newEntry.setUpdateCount(1);
                        }
                        newEntry.setTripleCount(count);

                        cacheConnection1.removeCacheEntry(resource);
                        cacheConnection1.addCacheEntry(resource, newEntry);
                        cacheConnection1.commit();
                    } catch (RepositoryException e) {
                        log.error("repository error while refreshing the remote resource {} from the Linked Data Cloud", resource, e);
                        cacheConnection1.rollback();
                    } finally {
View Full Code Here

Examples of org.apache.marmotta.ldcache.api.LDCachingConnection.addCacheEntry()

                LDCachingConnection cacheConnection2 = backend.getCacheConnection(resource.stringValue());
                cacheConnection2.begin();
                try {
                    cacheConnection2.removeCacheEntry(resource);
                    cacheConnection2.addCacheEntry(resource, newEntry);

                    cacheConnection2.commit();
                    log.error("refreshing the remote resource {} from the Linked Data Cloud failed ({})",resource,e.getMessage());
                    //log.info("exception was:",e);
                    return;
View Full Code Here

Examples of org.apache.marmotta.ldcache.api.LDCachingConnection.addCacheEntry()

                            LDCachingConnection con = backend.getCacheConnection(next.getResource().stringValue());
                            try {
                                con.begin();

                                con.removeCacheEntry(next.getResource());
                                con.addCacheEntry(next.getResource(), next);

                                con.commit();
                            } catch(RepositoryException ex) {
                                con.rollback();
                            } finally {
View Full Code Here

Examples of org.apache.marmotta.ldcache.api.LDCachingConnection.addCacheEntry()

            entry1.setExpiryDate(new Date(System.currentTimeMillis()+1000*60));
            entry1.setLastRetrieved(new Date());
            entry1.setUpdateCount(1);
            entry1.setResource(subject1);
            entry1.setTripleCount(1);
            con.addCacheEntry(subject1, entry1);
            con.commit();

            Assert.assertTrue(backend.isCached(subject1.stringValue()));
            Assert.assertFalse(backend.isCached(subject2.stringValue()));
            Assert.assertEquals(1,asList(backend.listCacheEntries()).size());
View Full Code Here

Examples of org.apache.marmotta.ldcache.api.LDCachingConnection.addCacheEntry()

            entry2.setExpiryDate(new Date(System.currentTimeMillis() - 1000 * 60));
            entry2.setLastRetrieved(new Date());
            entry2.setUpdateCount(1);
            entry2.setResource(subject2);
            entry2.setTripleCount(1);
            con.addCacheEntry(subject2,entry2);

            con.commit();

            Assert.assertTrue(backend.isCached(subject1.stringValue()));
            Assert.assertTrue(backend.isCached(subject2.stringValue()));
View Full Code Here

Examples of org.apache.marmotta.ldcache.api.LDCachingConnection.addCacheEntry()

            entry1.setExpiryDate(new Date(System.currentTimeMillis()+1000*60));
            entry1.setLastRetrieved(new Date());
            entry1.setUpdateCount(1);
            entry1.setResource(subject1);
            entry1.setTripleCount(1);
            con.addCacheEntry(subject1, entry1);
            con.commit();

            Assert.assertTrue(backend.isCached(subject1.stringValue()));
            Assert.assertFalse(backend.isCached(subject2.stringValue()));
            Assert.assertEquals(1,asList(backend.listCacheEntries()).size());
View Full Code Here

Examples of org.apache.marmotta.ldcache.api.LDCachingConnection.addCacheEntry()

            entry2.setExpiryDate(new Date(System.currentTimeMillis() - 1000 * 60));
            entry2.setLastRetrieved(new Date());
            entry2.setUpdateCount(1);
            entry2.setResource(subject2);
            entry2.setTripleCount(1);
            con.addCacheEntry(subject2,entry2);

            con.commit();

            Assert.assertTrue(backend.isCached(subject1.stringValue()));
            Assert.assertTrue(backend.isCached(subject2.stringValue()));
View Full Code Here

Examples of org.apache.marmotta.ldcache.api.LDCachingConnection.addCacheEntry()

            CacheEntry entry1 = new CacheEntry();
            entry1.setExpiryDate(new Date(System.currentTimeMillis()+1000*60));
            entry1.setLastRetrieved(new Date());
            entry1.setUpdateCount(1);
            entry1.setResource(subject1);
            con.addCacheEntry(subject1, entry1);
            con.commit();

            Assert.assertEquals(1,asList(backend.listCacheEntries()).size());
            Assert.assertEquals(0,asList(backend.listExpiredEntries()).size());

View Full Code Here

Examples of org.apache.marmotta.ldcache.api.LDCachingConnection.addCacheEntry()

            CacheEntry entry2 = new CacheEntry();
            entry2.setExpiryDate(new Date(System.currentTimeMillis() - 1000 * 60));
            entry2.setLastRetrieved(new Date());
            entry2.setUpdateCount(1);
            entry2.setResource(subject2);
            con.addCacheEntry(subject2,entry2);

            con.commit();

            Assert.assertEquals(2,asList(backend.listCacheEntries()).size());
            Assert.assertEquals(1,asList(backend.listExpiredEntries()).size());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.