Package org.geotools.data

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


            store.unLockFeatures();   
            fail( "unlock should have thrown an exception");
        }
        catch( FeatureLockException e ) {}
       
        tx.addAuthorization(lock.getAuthorization());
        store.unLockFeatures();
       
        writer = dataStore.getFeatureWriter(tname("ft1"), tx );
        assertTrue( writer.hasNext() );
       
View Full Code Here


            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

            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

            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

        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

        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

            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

        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

                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

                org.geotools.data.Transaction t = new DefaultTransaction("Refresh "
                        + meta.getWorkspace().getName());

                try {
                    t.addAuthorization(lockId);

                    if (lockingManager.release(lockId, t)) {
                        refresh = true;
                    }
                } catch (IOException e) {
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.