Package org.geoserver.catalog

Examples of org.geoserver.catalog.Catalog.list()


            public CloseableIteratorAdapter<LayerInfo> answer(InvocationOnMock invocation) throws Throwable {
                return new CloseableIteratorAdapter<LayerInfo>(layers.iterator());
            }
        };
       
        when(catalog.list(eq(LayerInfo.class), eq(Predicates.and(Predicates.equal("resource.namespace.prefix",
                "foo"), Predicates.fullTextSearch("o"))), isA(Integer.class), isA(Integer.class), isA(SortBy.class))).thenAnswer(a);
       
        when(catalog.count(eq(LayerInfo.class), eq(Predicates.and(Predicates.equal("resource.namespace.prefix",
                "foo"), Predicates.fullTextSearch(""))))).thenReturn(layers.size());
       
View Full Code Here


            if (def != null) {
                wsName = def.getName();
            }
        }

        CloseableIterator<LayerGroupInfo> it = cat.list(LayerGroupInfo.class, equal("workspace.name", wsName));
        try {
            while (it.hasNext()) {
                LayerGroupInfo map = it.next();
                if( checkMap( map ) ){
                    JSONObj obj = arr.addObject();
View Full Code Here

        obj.put("page", page != null ? page : 0);
        obj.put("count", Math.min(total, count != null ? count : total));

        JSONArr arr = obj.putArray("layers");
        try (
            CloseableIterator<LayerInfo> it = cat.list(LayerInfo.class, filter, offset(page, count), count, sortBy);
        ) {
            while (it.hasNext()) {
                layer(arr.addObject(), it.next(), req);
            }
        }
View Full Code Here

        if (def != null) {
           workspace(arr.addObject(), def, namespaceFor(def), true);
        }

        try (
            CloseableIterator<WorkspaceInfo> list = cat.list(WorkspaceInfo.class, Predicates.acceptAll());
        ) {
            while(list.hasNext()) {
                WorkspaceInfo ws = list.next();
                if (def != null && ws.getName().equals(def.getName())) {
                    continue;
View Full Code Here

        Catalog cat = geoServer.getCatalog();
        WorkspaceInfo ws = store.getWorkspace();

        Filter filter = and(equal("store", store), equal("namespace.prefix", ws.getName()));
        int count=0;
        try (CloseableIterator<ResourceInfo> layers = cat.list(ResourceInfo.class, filter);) {
            while (layers.hasNext()) {
                ResourceInfo r = layers.next();
                for (LayerInfo l : cat.getLayers(r)) {
                    if (l != null) {
                        count++;
View Full Code Here

    private JSONArr layers(StoreInfo store, JSONArr list) throws IOException {
        Catalog cat = geoServer.getCatalog();
        WorkspaceInfo ws = store.getWorkspace();

        Filter filter = and(equal("store", store), equal("namespace.prefix", ws.getName()));
        try (CloseableIterator<ResourceInfo> layers = cat.list(ResourceInfo.class, filter);) {
            while (layers.hasNext()) {
                ResourceInfo r = layers.next();
                for (LayerInfo l : cat.getLayers(r)) {
                    layer(list.addObject(), l,true);
                }
View Full Code Here

            }
        }
        else {
            Filter filter = and(equal("namespace.prefix", store.getWorkspace().getName()),equal("nativeName", name));
            try (
                CloseableIterator<ResourceInfo> published = cat.list(ResourceInfo.class, filter);
            ) {
                while (published.hasNext()) {
                    ResourceInfo info = published.next();
                    if (!info.getStore().getId().equals(store.getId())) {
                        continue; // native name is not enough, double check store id
View Full Code Here

    }

    private CloseableIterator<DataStoreInfo> getDataStores() {
        Catalog catalog = getGeoServer().getCatalog();
        Filter filter = Predicates.acceptAll();
        CloseableIterator<DataStoreInfo> stores = catalog.list(DataStoreInfo.class, filter);
        return stores;
    }

}
View Full Code Here

       
        mockFTInfo = createMockFeatureType("baz", mockWSInfo, CatalogMode.CHALLENGE, mockFilter, false, false);
        source.add(mockFTInfo);
        replay(mockFTInfo);
       
        expect(catalog.list(
                eq(FeatureTypeInfo.class),
                capture(filterCapture),
                (Integer)isNull(),
                (Integer)isNull(),
                (SortBy)isNull())).andStubAnswer(new IAnswer<CloseableIterator<FeatureTypeInfo>>() {
View Full Code Here

                srs.addAll(srsList);
            }
            handleRootCrsList(srs);

            CloseableIterator<LayerInfo> layers;
            layers = catalog.list(LayerInfo.class, filter);
            try{
                handleRootBbox(layers);
            }finally{
                layers.close();
            }
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.