Examples of addAuthorization()


Examples of org.geotools.data.Transaction.addAuthorization()

            FeatureLockFactory.generate(tname("ft1"), 60 * 60 * 1000);
       
        Transaction tx = new DefaultTransaction();
        store.setTransaction( tx );
        store.setFeatureLock(lock);
        tx.addAuthorization(lock.getAuthorization());
       
        store.lockFeatures();
       
        // uhnlock features
        FilterFactory ff = dataStore.getFilterFactory();
View Full Code Here

Examples of org.geotools.data.Transaction.addAuthorization()

            FeatureLockFactory.generate(tname("ft1"), 60 * 60 * 1000);
       
        Transaction tx = new DefaultTransaction();
        store.setTransaction( tx );
        store.setFeatureLock(lock);
        tx.addAuthorization(lock.getAuthorization());
       
        FilterFactory ff = dataStore.getFilterFactory();
        Filter f1 = ff.id( Collections.singleton( ff.featureId( tname("ft1")+".1")));
       
        assertEquals( 1, store.lockFeatures(f1) );
View Full Code Here

Examples of org.geotools.data.Transaction.addAuthorization()

            FeatureLockFactory.generate(tname("ft1"), 60 * 60 * 1000);
       
        Transaction tx = new DefaultTransaction();
        store.setTransaction( tx );
        store.setFeatureLock(lock);
        tx.addAuthorization(lock.getAuthorization());
       
        Filter f1 = ff.id( Collections.singleton( ff.featureId( tname("ft1")+".1")));
        store.lockFeatures(f1);
       
        Transaction tx1 = new DefaultTransaction();
View Full Code Here

Examples of org.geotools.data.Transaction.addAuthorization()

            road.unLockFeatures();
            fail("unlock should fail due lack of authorization");
        } catch (IOException expected) {
        }

        t.addAuthorization(lock.getAuthorization());
        road.unLockFeatures();
        t.close();
    }

    public void testLockFeatureInteraction() throws IOException {
View Full Code Here

Examples of org.geotools.data.Transaction.addAuthorization()

        road1.unLockFeatures(td.rd1Filter);
        assertFalse(isLocked(tname("road"), tname("road") + "." + (td.initialFidValue)));
        assertTrue(isLocked(tname("road"), tname("road") + "." + (td.initialFidValue+1)));
        assertFalse(isLocked(tname("road"), tname("road") + "." + (td.initialFidValue+2)));

        t2.addAuthorization(lockB.getAuthorization());
        road2.unLockFeatures(td.rd2Filter);
        assertFalse(isLocked(tname("road"), tname("road") + "." + (td.initialFidValue)));
        assertFalse(isLocked(tname("road"), tname("road") + "." + (td.initialFidValue+1)));
        assertFalse(isLocked(tname("road"), tname("road") + "." + (td.initialFidValue+2)));
View Full Code Here

Examples of org.geotools.data.Transaction.addAuthorization()

        try {
            road.unLockFeatures();
            fail("unlock should fail due lack of authorization");
        } catch (IOException expected) {
        }
        t.addAuthorization(lock.getAuthorization());
        road.unLockFeatures();
    }
    public void testLockFeatureInteraction() throws IOException {
        FeatureLock lockA = new FeatureLock("LockA", 3600);
        FeatureLock lockB = new FeatureLock("LockB", 3600);
View Full Code Here

Examples of org.geotools.data.Transaction.addAuthorization()

        road1.unLockFeatures(rd1Filter);
        assertFalse(isLocked("road", "road.rd1"));
        assertTrue(isLocked("road", "road.rd2"));
        assertFalse(isLocked("road", "road.rd3"));

        t2.addAuthorization(lockB.getAuthorization());
        road2.unLockFeatures(rd2Filter);
        assertFalse(isLocked("road", "road.rd1"));
        assertFalse(isLocked("road", "road.rd2"));
        assertFalse(isLocked("road", "road.rd3"));
    }
View Full Code Here

Examples of org.geotools.data.Transaction.addAuthorization()

                if (numberLocked > 0) {
                    Transaction t = new DefaultTransaction();

                    try {
                        try {
                            t.addAuthorization(response.getLockId());
                            DataStore dataStore = (DataStore) source.getDataStore();
                            dataStore.getLockingManager().refresh(response.getLockId(), t);
                        } finally {
                            t.commit();
                        }
View Full Code Here

Examples of org.geotools.data.Transaction.addAuthorization()

                if (numberLocked > 0) {
                    Transaction t = new DefaultTransaction();

                    try {
                        try {
                            t.addAuthorization(fLock.getAuthorization());
                            DataStore dataStore = (DataStore) source.getDataStore();
                            dataStore.getLockingManager().refresh(fLock.getAuthorization(), t);
                        } finally {
                            t.commit();
                        }
View Full Code Here

Examples of org.geotools.data.Transaction.addAuthorization()

    public void testLockUnlockFilter() throws Exception {
        SimpleFeatureLocking fl;
        fl = (SimpleFeatureLocking) rts.getFeatureSource(RENAMED);
        final FeatureLock lock = FeatureLockFactory.generate(10 * 60 * 1000);
        Transaction t = new DefaultTransaction();
        t.addAuthorization(lock.getAuthorization());
        fl.setTransaction(t);
        fl.setFeatureLock(lock);

        SimpleFeatureLocking fl2;
        fl2 = (SimpleFeatureLocking) rts.getFeatureSource(RENAMED);
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.