Package org.geoserver.catalog

Examples of org.geoserver.catalog.DataStoreInfo


    @Override
    protected void onSave() {
        try {
            VirtualTable vt = buildVirtualTable();
            DataStoreInfo dsInfo = getCatalog().getStore(storeId, DataStoreInfo.class);
            JDBCDataStore ds = (JDBCDataStore) dsInfo.getDataStore(null);
            ds.addVirtualTable(vt);

            CatalogBuilder builder = new CatalogBuilder(getCatalog());
            builder.setStore(dsInfo);
            FeatureTypeInfo fti = builder.buildFeatureType(ds.getFeatureSource(vt.getName()));
View Full Code Here


        return (DataStoreInfo) first(query);
    }

    public void setDefaultDataStore(WorkspaceInfo workspace, DataStoreInfo store) {
        //TODO: remove the cast to DataStoreInfoImpl
        DataStoreInfo old = getDefaultDataStore(workspace);

        if (old != null) {
            ((DataStoreInfoImpl)old).setDefault(false);
            save(old);
        }
View Full Code Here

        Catalog catalog = getCatalog();
        catalog.setDefaultNamespace(catalog.getNamespaceByURI(typeName.getNamespaceURI()));
        FeatureTypeInfo typeInfo = catalog.getFeatureTypeByName(typeName.getNamespaceURI(), typeName.getLocalPart());
        typeInfo.setEnabled(true);
        catalog.save(typeInfo);
        DataStoreInfo store = typeInfo.getStore();
        store.setEnabled(true);
        catalog.save(store);
       
        // and request typeName without prefix
        String path = "ows?service=WFS&version=1.1.0&request=DescribeFeatureType&typeName="
            + typeName.getLocalPart();
View Full Code Here

   
    @Override
    public void testGetDataStoreById() {
        addDataStore();
       
        DataStoreInfo ds2 = catalog.getDataStore(ds.getId());
        assertNotNull(ds2);
        assertEquals( ds, ds2 );
    }
View Full Code Here

   
    @Override
    public void testGetDataStoreByName() {
        addDataStore();
       
        DataStoreInfo ds2 = catalog.getDataStoreByName(ds.getName());
        assertNotNull(ds2);
        assertEquals( ds, ds2 );
       
        DataStoreInfo ds3 = catalog.getDataStoreByName(ws, null);
        assertNotNull(ds3);
        assertEquals( ds, ds3 );
       
        DataStoreInfo ds4 = catalog.getDataStoreByName(ws, Catalog.DEFAULT);
        assertNotNull(ds4);
        assertEquals( ds, ds4 );
       
        DataStoreInfo ds5 = catalog.getDataStoreByName(Catalog.DEFAULT, Catalog.DEFAULT);
        assertNotNull(ds5);
        assertEquals( ds, ds5 );
    }
View Full Code Here

   
    @Override
    public void testModifyDataStore() {
        addDataStore();
       
        DataStoreInfo ds2 = catalog.getDataStoreByName(ds.getName());
        ds2.setName( "dsName2" );
        ds2.setDescription( "dsDescription2" );
       
        catalog.save( ds2 );
        DataStoreInfo ds3 = catalog.getDataStoreByName("dsName2");
        assertEquals(ds2, ds3);
        assertEquals( "dsName2", ds3.getName() );
        assertEquals( "dsDescription2", ds3.getDescription() );
    }
View Full Code Here

        testAddWorkspace();
        WorkspaceInfo ws = dao.getWorkspaceByName("acme");
       
        assertEquals(0, dao.getStoresByWorkspace(ws, DataStoreInfo.class).size());
       
        DataStoreInfo ds = dao.getCatalog().getFactory().createDataStore();
        ds.setWorkspace(ws);
        ds.setName("widgets");
        dao.add(ds);
    
        assertEquals(1, dao.getStoresByWorkspace(ws, DataStoreInfo.class).size());
    }
View Full Code Here

    public void testModifyDataStore() throws Exception {
        testAddDataStore();
       
        WorkspaceInfo ws = dao.getWorkspaceByName("acme");
       
        DataStoreInfo ds = dao.getStoreByName( ws, "widgets", DataStoreInfo.class );
        ds.setName("foo");
        dao.save(ds);
       
        assertNull(dao.getStoreByName( ws, "widgets", DataStoreInfo.class));
        assertNotNull(dao.getStoreByName( ws, "foo", DataStoreInfo.class));
    }
View Full Code Here

        testAddDataStore();
        assertEquals(1, dao.getStores(DataStoreInfo.class).size());
       
        WorkspaceInfo ws = dao.getWorkspaceByName("acme");
       
        DataStoreInfo ds = dao.getStoreByName( ws, "widgets", DataStoreInfo.class );
        dao.remove(ds);
       
        assertNull(dao.getStoreByName( ws, "widgets", DataStoreInfo.class ));
        assertEquals(0, dao.getStores(DataStoreInfo.class).size());
    }
View Full Code Here

    @Test
    public void testDefaultDataStore() throws Exception {
        testAddDataStore();
       
        WorkspaceInfo ws = dao.getWorkspaceByName("acme");
        DataStoreInfo ds = dao.getStoreByName(ws, "widgets", DataStoreInfo.class);
        dao.setDefaultDataStore(ws, ds);
       
        DataStoreInfo ds1 = dao.getDefaultDataStore(ws);
       
        assertEquals(ds, ds1);
       
        DataStoreInfo ds2 = dao.getCatalog().getFactory().createDataStore();
        ds2.setWorkspace(ws);
        ds2.setName("things");
        dao.add(ds2);
        dao.setDefaultDataStore(ws, ds2);
       
        assertEquals(dao.getStoreByName(ws, "things", DataStoreInfo.class), ds2);
       
View Full Code Here

TOP

Related Classes of org.geoserver.catalog.DataStoreInfo

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.