Package org.geotools.data

Examples of org.geotools.data.DataAccess


                    // Don't count locks from disabled datastores.
                    continue;
                }
   
                try {
                    DataAccess store = meta.getDataStore(null);
                    if(store instanceof DataStore) {
                        LockingManager lockingManager = ((DataStore) store).getLockingManager();
                        if (lockingManager != null){
                            // we can't actually *count* locks right now?
                            // count += lockingManager.getLockSet().size();
View Full Code Here


   
   
    @Test
    public void testReadOnlyFeatureSourceDataAccess() throws Exception {
        // build the mock up
        DataAccess da = createNiceMock(DataAccess.class);
        replay(da);
        FeatureSource fs = createNiceMock(FeatureSource.class);
        expect(fs.getDataStore()).andReturn(da);
        replay(fs);
       
View Full Code Here

                // Don't count locks from disabled datastores.
                continue;
            }

            try {
                DataAccess store = meta.getDataStore(null);
                if(store instanceof DataStore) {
                    LockingManager lockingManager = ((DataStore) store).getLockingManager();
                    if (lockingManager != null){
                        // we can't actually *count* locks right now?
                        // count += lockingManager.getLockSet().size();
View Full Code Here

    public CatalogRepository(Catalog catalog) {
        this.catalog = catalog;
    }

    public DataStore dataStore(Name name) {
        DataAccess da = access(name);
        if ( da instanceof DataStore ) {
            return (DataStore) da;
        }
       
        LOGGER.severe( name + " is not a data store.");
View Full Code Here

            if ( !ds.isEnabled() ) {
                continue;
            }
           
            try {
                DataAccess da = ds.getDataStore( null );
                if ( da instanceof DataStore ) {
                    dataStores.add( (DataStore) da );
                }
            }
            catch (IOException e) {
View Full Code Here

            if(virtualTable == null) {
                throw new IllegalArgumentException("The specified feature type does not have a sql view attached to it");
            }

            // get the store
            DataAccess da = store.getDataStore(null);
            if (!(da instanceof JDBCDataStore)) {
                error("Cannot create a SQL view if the store is not database based");
                doReturn(StorePage.class);
                return;
            }
View Full Code Here

        // reset to default first, to avoid the container being displayed if store is not a
        // DataStoreInfo
        createSQLViewContainer.setVisible(false);
        if (store instanceof DataStoreInfo) {
            try {
                DataAccess da = ((DataStoreInfo) store).getDataStore(null);
                createSQLViewContainer.setVisible(da instanceof JDBCDataStore);
            } catch (IOException e) {
                LOGGER.log(Level.FINEST, e.getMessage());
            }
        }
View Full Code Here

        }

        FeatureIterator<SimpleFeature> fi = null;
        try {
            // basic sanity checks on the datastore
            DataAccess ds = info.getVersioningDataStore().getDataStore(null);
            if (!(ds instanceof VersionedPostgisDataStore)) {
                throw new GSSException(
                        "The store attached to the gss module is not a PostGIS versioning one");
            }
            VersionedPostgisDataStore dataStore = (VersionedPostgisDataStore) ds;
View Full Code Here

        DataAccessFactory f = getGeoServer().getCatalog().getResourcePool().getDataStoreFactory(info);
       
        assertNotNull( f );
        assertTrue( f instanceof PropertyDataStoreFactory );
       
        DataAccess store = getGeoServer().getCatalog().getResourcePool().getDataStore(info);
               
        assertEquals( testDS.toURI().toString().toLowerCase(), store.getInfo().getSource().toString().replace("/./", "/").toLowerCase());
    }
View Full Code Here

    @SuppressWarnings("rawtypes")
    @Test
    public void testPutWithCalculation() throws Exception {
        DataStoreInfo dataStoreInfo = getCatalog().getDataStoreByName("sf","sf");
        String dataStoreId = dataStoreInfo.getId();
        DataAccess dataAccessBefore = dataStoreInfo.getDataStore(null);
        assertSame("ResourcePool DataStoreCache", dataAccessBefore, getCatalog().getResourcePool().getDataStoreCache().get( dataStoreId ));
       
        String clearLatLonBoundingBox =
              "<featureType>"
                + "<nativeBoundingBox>"
                  + "<minx>-180.0</minx>" + "<maxx>180.0</maxx>"
                  + "<miny>-90.0</miny>" + "<maxy>90.0</maxy>"
                  + "<crs>EPSG:4326</crs>"
                + "</nativeBoundingBox>"
                + "<latLonBoundingBox/>"
            + "</featureType>";
       
        String path = "/rest/workspaces/sf/datastores/sf/featuretypes/PrimitiveGeoFeature";
        MockHttpServletResponse response =
                putAsServletResponse(path, clearLatLonBoundingBox, "text/xml");
        assertEquals("Couldn't remove lat/lon bounding box:\n" + response.getOutputStreamContent(),
                200, response.getStatusCode());

        Document dom = getAsDOM(path + ".xml");
        assertXpathEvaluatesTo("0.0", "/featureType/latLonBoundingBox/minx", dom);
       
        // confirm ResourcePoool cache of DataStore is unchanged
        DataAccess dataAccessAfter = getCatalog().getDataStoreByName("sf","sf").getDataStore(null);
        assertSame( "ResourcePool DataStoreCache check 1", dataAccessBefore, dataAccessAfter );
        assertSame("ResourcePool DataStoreCache", dataAccessBefore, getCatalog().getResourcePool().getDataStoreCache().get( dataStoreId ));
       
        String updateNativeBounds =
                "<featureType>"
View Full Code Here

TOP

Related Classes of org.geotools.data.DataAccess

Copyright © 2018 www.massapicom. 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.