Package org.geowebcache.grid

Examples of org.geowebcache.grid.GridSetBroker


        @Override
        protected TileLayer load() {
            final GWC gwc = GWC.get();
            final GWCConfig defaults = gwc.getConfig().saneConfig().clone();
            defaults.setCacheLayersByDefault(true);
            final GridSetBroker gridsets = gwc.getGridSetBroker();
            Catalog catalog = getCatalog();

            LayerInfo layer = catalog.getLayerByName(name);
            if (layer != null) {
                return new GeoServerTileLayer(layer, defaults, gridsets);
View Full Code Here


    }

    protected GridSubset findBestGridSubset(GetMapRequest req) {
        Map formatOpts = req.getFormatOptions();

        GridSetBroker gridSetBroker = gwc.getGridSetBroker();
        GridSet gridSet = null;

        // first check format options to see if explicitly specified
        if (formatOpts.containsKey("gridset")) {
            gridSet = gridSetBroker.get(formatOpts.get("gridset").toString());
        }

        // next check srs
        if (gridSet == null && getSRS(req) != null) {
            gridSet = gridSetBroker.get( getSRS(req) );
        }

        if (gridSet != null) {
            return GridSubsetFactory.createGridSubSet(gridSet);
        }
View Full Code Here

        // has an id
        Preconditions.checkState(layer.getId() != null);
        tileLayerInfo.setId(layer.getId());

        final String name;
        final GridSetBroker gridsets = gwc.getGridSetBroker();
        GeoServerTileLayer tileLayer;
        if (layer instanceof LayerGroupInfo) {
            LayerGroupInfo groupInfo = (LayerGroupInfo) layer;
            name = tileLayerName(groupInfo);
            tileLayer = new GeoServerTileLayer(groupInfo, gridsets, tileLayerInfo);
View Full Code Here

                // odd/even style
                final int index = item.getIndex();
                item.add(new SimpleAttributeModifier("class", index % 2 == 0 ? "even" : "odd"));

                final XMLGridSubset gridSubset = item.getModelObject();
                GridSetBroker gridSetBroker = GWC.get().getGridSetBroker();

                String gridsetDescription = null;
                int gridsetLevels;
                boolean gridsetExists;
                {
                    final GridSet gridSet = gridSetBroker.get(gridSubset.getGridSetName());
                    gridsetExists = gridSet != null;
                    if (gridsetExists) {
                        gridsetLevels = gridSet.getNumLevels();
                        gridsetDescription = gridSet.getDescription();
                    } else {
View Full Code Here

                        error(validatable, "GridSubsetsEditor.validation.zoomLevelsError");
                        return;
                    }
                }

                final GridSetBroker gridSetBroker = gwc.getGridSetBroker();
                final GridSet gridSet = gridSetBroker.get(gridSetName);

                if (null == gridSet) {
                    error(validatable, "GridSubsetsEditor.validation.gridSetNotFound", gridSetName);
                    return;
                }
View Full Code Here

        this.name = name;
    }

    @Override
    protected GridSet load() {
        GridSetBroker gridSetBroker = GWC.get().getGridSetBroker();
        GridSet gridSet = gridSetBroker.get(name);
        return gridSet;
    }
View Full Code Here

        GridSetInfo gridsetInfo;

        if (gridSetName == null) {
            gridsetInfo = new GridSetInfo();
        } else {
            GridSetBroker gridSetBroker = GWC.get().getGridSetBroker();
            GridSet gridSet = gridSetBroker.get(gridSetName);
            if (gridSet == null) {
                throw new IllegalArgumentException("Requested GridSet does not exist: '"
                        + gridSetName + "'");
            }
View Full Code Here

        protected void onValidate(IValidatable<String> validatable) {
            final String name = validatable.getValue();
            if (name.equals(previousName)) {
                return;
            }
            final GridSetBroker gridSetBroker = GWC.get().getGridSetBroker();
            if (previousName != null) {
                gridSetBroker.get(previousName);
            }
            GridSet gridSet = gridSetBroker.get(name);
            if (gridSet != null) {
                error(validatable, "gridSetAlreadyExists",
                        Collections.singletonMap("name", (Object) name));
            }
        }
View Full Code Here

        GridSetTableProvider provider = new GridSetTableProvider() {
            private static final long serialVersionUID = 1L;

            @Override
            public List<GridSet> getItems() {
                GridSetBroker gridSetBroker = GWC.get().getGridSetBroker();
                List<String> list = selection.getObject();
                List<GridSet> gridsets = new ArrayList<GridSet>(list.size());
                for (String id : list) {
                    GridSet gridSet = gridSetBroker.get(id);
                    if (gridSet != null) {
                        gridsets.add(gridSet);
                    }
                }
                return gridsets;
View Full Code Here

        gwcConfigPersister = mock(GWCConfigPersister.class);
        when(gwcConfigPersister.getConfig()).thenReturn(defaults);

        storageBroker = mock(StorageBroker.class);
        gridSetBroker = new GridSetBroker(true, true);

        tileLayerInfo = TileLayerInfoUtil.loadOrCreate(layer, defaults);
        tileLayerGroupInfo = TileLayerInfoUtil.loadOrCreate(layerGroup, defaults);

        tileLayer = new GeoServerTileLayer(layer, gridSetBroker, tileLayerInfo);
View Full Code Here

TOP

Related Classes of org.geowebcache.grid.GridSetBroker

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.