Package org.geoserver.catalog

Examples of org.geoserver.catalog.DataStoreInfo


        expect(cat.getWorkspaces()).andReturn(Arrays.asList(ws)).anyTimes();
        expect(cat.getDefaultWorkspace()).andReturn(ws).anyTimes();
        expect(cat.getWorkspaceByName("acme")).andReturn(ws).anyTimes();
       
        //data stores
        DataStoreInfo acme = createNiceMock(DataStoreInfo.class);
        expect(acme.getName()).andReturn("acme").anyTimes();
        expect(acme.getWorkspace()).andReturn(ws).anyTimes();
        expect(acme.getDataStore(null)).andReturn((DataAccess) ds).anyTimes();
        replay(acme);
       
        expect(cat.getDataStoresByWorkspace(ws)).andReturn(Arrays.asList(acme)).anyTimes();
        expect(cat.getDataStoresByWorkspace("acme")).andReturn(Arrays.asList(acme)).anyTimes();
       
View Full Code Here


        pi.exec("from geoserver.catalog import Store");
        pi.exec("st = Store('bar')");
        pi.exec("st.connectionParameters.putAll({'database':'target/bar', 'dbtype': 'h2'})");
        pi.exec("st.save()");
       
        DataStoreInfo ds = cat.getDataStoreByName("foo", "bar");
        assertNotNull(ds);
        assertNotNull(ds.getDataStore(null));
    }
View Full Code Here

        NamespaceInfo ns = cat.getFactory().createNamespace();
        ns.setPrefix("foo");
        ns.setURI("http://foo.org");
        cat.add(ns);
       
        DataStoreInfo ds = cat.getDataStoreByName("foo", "bar");
       
        SimpleFeatureTypeBuilder tb = new SimpleFeatureTypeBuilder();
        tb.setName("baz");
        tb.add("x", Integer.class);
        tb.add("y", String.class);
        ((DataStore)ds.getDataStore(null)).createSchema(tb.buildFeatureType());
       
        assertNull(cat.getFeatureTypeByDataStore(ds, "baz"));
       
        pi.exec("from geoserver.catalog import Catalog");
        pi.exec("from geoserver.catalog import Layer");
View Full Code Here

        return ModificationProxy.createList(lookup(clazz, stores) , clazz);
    }
   
    public DataStoreInfo getDefaultDataStore(WorkspaceInfo workspace) {
        if(defaultStores.containsKey(workspace.getId())) {
            DataStoreInfo defaultStore = defaultStores.get(workspace.getId());
            return ModificationProxy.create(defaultStore, DataStoreInfo.class);
        } else {
            return null;
        }
    }
View Full Code Here

            return null;
        }
    }
   
    public void setDefaultDataStore(WorkspaceInfo workspace, DataStoreInfo store) {
        DataStoreInfo old = defaultStores.get(workspace.getId());
        synchronized(defaultStores) {
            if (store != null) {
                defaultStores.put(workspace.getId(), store);   
            }
            else {
View Full Code Here

            boolean refresh = false;

            List dataStores = catalog.getDataStores();

            for (Iterator i = dataStores.iterator(); i.hasNext();) {
                DataStoreInfo meta = (DataStoreInfo) i.next();
                DataStore dataStore = null;
               
                // TODO: support locking for DataAccess
                if (meta.isEnabled()) {
                    DataAccess da = meta.getDataStore(null);
                    if ( da instanceof DataStore ) {
                        dataStore = (DataStore) da;
                    }
                }
               
                if ( dataStore == null ) {
                    continue; // disabled or not a DataStore
                }

                LockingManager lockingManager = dataStore.getLockingManager();

                if (lockingManager == null) {
                    continue; // locks not supported
                }

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

                try {
                    t.addAuthorization(lockId);

                    if (lockingManager.release(lockId, t)) {
View Full Code Here

    public void releaseAll() throws WFSException {
        try {
            List dataStores = catalog.getDataStores();

            for (Iterator i = dataStores.iterator(); i.hasNext();) {
                DataStoreInfo meta = (DataStoreInfo) i.next();
                DataStore dataStore = null;
               
                // TODO: support locking for DataAccess
                if (meta.isEnabled()) {
                    DataAccess da = meta.getDataStore(null);
                    if ( da instanceof DataStore ) {
                        dataStore = (DataStore) da;
                    }
                }
               
View Full Code Here

    public boolean exists(String lockId) throws WFSException {
        try {
            List dataStores = catalog.getDataStores();

            for (Iterator i = dataStores.iterator(); i.hasNext();) {
                DataStoreInfo meta = (DataStoreInfo) i.next();
                DataStore dataStore = null;
               
                // TODO: support locking for DataAccess
                if (meta.isEnabled()) {
                    DataAccess da = meta.getDataStore(null);
                    if ( da instanceof DataStore ) {
                        dataStore = (DataStore) da;
                    }
                }
               
View Full Code Here

            boolean refresh = false;

            List dataStores = catalog.getDataStores();

            for (Iterator i = dataStores.iterator(); i.hasNext();) {
                DataStoreInfo meta = (DataStoreInfo) i.next();
                DataStore dataStore = null;
               
                // TODO: support locking for DataAccess
                if (meta.isEnabled()) {
                    DataAccess da = meta.getDataStore(null);
                    if ( da instanceof DataStore ) {
                        dataStore = (DataStore) da;
                    }
                }
               
                if ( dataStore == null ) {
                    continue; // disabled or not a DataStore
                }
               
                LockingManager lockingManager = dataStore.getLockingManager();

                if (lockingManager == null) {
                    continue; // locks not supported
                }

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

                try {
                    t.addAuthorization(lockId);

                    if (lockingManager.refresh(lockId, t)) {
View Full Code Here

    class ViewNameValidator extends AbstractValidator {
        @Override
        protected void onValidate(IValidatable validatable) {
            String vtName = (String) validatable.getValue();
           
            final DataStoreInfo store = getCatalog().getStore(storeId, DataStoreInfo.class);
            List<FeatureTypeInfo> ftis = getCatalog().getResourcesByStore(store, FeatureTypeInfo.class);
            for (FeatureTypeInfo curr : ftis) {
                VirtualTable currvt = curr.getMetadata().get(FeatureTypeInfo.JDBC_VIRTUAL_TABLE, VirtualTable.class);
                if(currvt != null) {
                    if(typeInfoId == null || !typeInfoId.equals(curr.getId())) {
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.