Package org.geoserver.catalog

Examples of org.geoserver.catalog.StoreInfo


            return false;
        if (!( obj instanceof StoreInfo ) ) {
            return false;
        }
       
        final StoreInfo other = (StoreInfo) obj;
        if (connectionParameters == null) {
            if (other.getConnectionParameters() != null)
                return false;
        } else if (!connectionParameters.equals(other.getConnectionParameters()))
            return false;
        if (description == null) {
            if (other.getDescription() != null)
                return false;
        } else if (!description.equals(other.getDescription()))
            return false;
        if (enabled != other.isEnabled())
            return false;
        if (id == null) {
            if (other.getId() != null)
                return false;
        } else if (!id.equals(other.getId()))
            return false;
        if (name == null) {
            if (other.getName() != null)
                return false;
        } else if (!name.equals(other.getName()))
            return false;
        if (workspace == null) {
            if (other.getWorkspace() != null)
                return false;
        } else if (!workspace.equals(other.getWorkspace()))
            return false;
        return true;
    }
View Full Code Here


                json.key("data");
                data(data, task, expand-1);
            }

            //target
            StoreInfo store = task.getStore();
            if (store != null) {
                json.key("target");
                store(store, task, false, expand-1);
            }
View Full Code Here

    public FeatureTypeInfoImpl(Catalog catalog, String id) {
        super(catalog,id);
    }

    public DataStoreInfo getStore() {
        StoreInfo storeInfo = super.getStore();
        if (!(storeInfo instanceof DataStoreInfo)) {
            LOGGER.warning("Failed to load actual store for " + this);
            return null;
        }
        return (DataStoreInfo) super.getStore();
View Full Code Here

      //create a builder to help build catalog objects
        CatalogBuilder cb = new CatalogBuilder(catalog);
        cb.setWorkspace( ws );

        // ok, find the target store
        StoreInfo storeInfo = null;
        boolean add = false;
        if (store != null) {
          if (features != null)
          {
            storeInfo = catalog.getDataStoreByName(ws.getName(), store);
View Full Code Here

    }

    ImportContext dettach(ImportContext context) {
        Catalog catalog = importer.getCatalog();
        for (ImportTask task : context.getTasks()) {
            StoreInfo store = task.getStore();
            if (store != null && store.getId() != null) {
                task.setStore(catalog.detach(store));
            }
        }
        return context;
    }
View Full Code Here

     * @param workspaceName Name of the workspace of the store.
     * @param name Name of the store.
     */
    protected void removeStore(String workspaceName, String name) {
        Catalog cat = getCatalog();
        StoreInfo store = cat.getStoreByName(workspaceName, name, StoreInfo.class);
        if (store == null) {
            return;
        }

        CascadeDeleteVisitor v = new CascadeDeleteVisitor(getCatalog());
        store.accept(v);
    }
View Full Code Here

        expect(catalog.getWorkspaceByName(CITE_PREFIX)).andReturn(ws).anyTimes();

        NamespaceInfo ns = createMock(NamespaceInfo.class);
        expect(catalog.getNamespaceByPrefix(CITE_PREFIX)).andReturn(ns).anyTimes();
       
        StoreInfo s1 = createMock(StoreInfo.class);
        StoreInfo s2 = createMock(StoreInfo.class);
        expect(catalog.getStoresByWorkspace(ws, StoreInfo.class)).andReturn(Arrays.asList(s1, s2)).anyTimes();

        ns.accept((CatalogVisitor)anyObject());
        expectLastCall();

        s1.accept((CatalogVisitor)anyObject());
        expectLastCall();

        s2.accept((CatalogVisitor)anyObject());
        expectLastCall();

        catalog.remove(ws);
        expectLastCall();
View Full Code Here

        replay(fs);
       
        DataStore dstore = createNiceMock(DataStore.class);
        replay(dstore);
       
        StoreInfo store;
        if (resourceClass.equals(CoverageInfo.class)) {
            store = createNiceMock(CoverageStoreInfo.class);
        } else {
            store = createNiceMock(DataStoreInfo.class);
            expect((DataStore)((DataStoreInfo) store).getDataStore(null)).andReturn(dstore);
        }
        expect(store.getWorkspace()).andReturn(ws).anyTimes();
        replay(store);

        NamespaceInfo ns = createNiceMock(NamespaceInfo.class);
        expect(ns.getName()).andReturn(ws.getName()).anyTimes();
        expect(ns.getPrefix()).andReturn(ws.getName()).anyTimes();
View Full Code Here

    }

    public void validate(final IValidatable validatable) {

        final Catalog catalog = GeoServerApplication.get().getCatalog();
        final StoreInfo store = catalog.getStore(storeId, StoreInfo.class);
        final WorkspaceInfo previousWorkspace = catalog.getWorkspace(wsId);

        final WorkspaceInfo newWorkspace = (WorkspaceInfo) validatable.getValue();
        if (previousWorkspace.equals(newWorkspace)) {
            return;
View Full Code Here

            return;
        }

        Catalog catalog = GeoServerApplication.get().getCatalog();

        final StoreInfo existing = catalog.getStoreByName(workspace, name, StoreInfo.class);
        if (existing != null) {
            final String existingId = existing.getId();
            if (!existingId.equals(edittingStoreId)) {
                ValidationError error = new ValidationError();
                error.addMessageKey("StoreNameValidator.storeExistsInWorkspace");
                error.setVariable("workspace", workspace.getName());
                error.setVariable("storeName", name);
View Full Code Here

TOP

Related Classes of org.geoserver.catalog.StoreInfo

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.