Examples of LayerQuota


Examples of org.geowebcache.diskquota.storage.LayerQuota

                .longValue());

        assertNotNull(config.getLayerQuotas());
        assertEquals(2, config.getLayerQuotas().size());

        LayerQuota states = config.layerQuota("topp:states");
        assertNotNull(states);
        assertEquals(LFU, states.getExpirationPolicyName());
        assertEquals(MiB.convertTo(100, B).longValue(), states.getQuota().getBytes().longValue());

        LayerQuota raster = config.layerQuota("raster test layer");
        assertNotNull(raster);
    }
View Full Code Here

Examples of org.geowebcache.diskquota.storage.LayerQuota

    }

    public void testSaveConfig() throws ConfigurationException, IOException {
        DiskQuotaConfig config = new DiskQuotaConfig();
        List<LayerQuota> quotas = new ArrayList<LayerQuota>();
        LayerQuota lq = new LayerQuota("topp:states", LRU, new Quota(10, StorageUnit.MiB));
        quotas.add(lq);
        config.addLayerQuota(lq);

        File configFile = new File(cacheDir, "geowebcache-diskquota.xml");
        if (configFile.exists()) {
View Full Code Here

Examples of org.geowebcache.diskquota.storage.LayerQuota

        }

    }

    public QuotaResolver newLayerQuotaResolver(final String layerName) {
        LayerQuota layerQuota = quotaConfig.layerQuota(layerName);
        return new LayerQuotaResolver(layerQuota, quotaStore);
    }
View Full Code Here

Examples of org.geowebcache.diskquota.storage.LayerQuota

                log.debug("Cache clean up task still running for layer '" + layerName
                        + "'. Ignoring it for this run.");
                continue;
            }

            final LayerQuota definedQuotaForLayer = quotaConfig.layerQuota(layerName);
            final ExpirationPolicy policy = definedQuotaForLayer.getExpirationPolicyName();
            final Quota quota = definedQuotaForLayer.getQuota();
            final Quota usedQuota = monitor.getUsedQuotaByLayerName(layerName);

            Quota excedent = usedQuota.difference(quota);
            if (excedent.getBytes().compareTo(BigInteger.ZERO) > 0) {
                log.info("Layer '" + layerName + "' exceeds its quota of " + quota.toNiceString()
View Full Code Here

Examples of org.geowebcache.diskquota.storage.LayerQuota

    public void testSetLayerQuotas() {
        // config.setLayerQuotas(null);
        assertNull(config.getLayerQuotas());

        try {
            config.addLayerQuota(new LayerQuota("layer", ExpirationPolicy.LRU));
            fail("Expected IAE");
        } catch (IllegalArgumentException e) {
            assertTrue(true);
        }
        LayerQuota lq = new LayerQuota("layer", ExpirationPolicy.LFU, new Quota());
        config.addLayerQuota(lq);
        assertNotNull(config.layerQuota("layer"));
    }
View Full Code Here

Examples of org.geowebcache.diskquota.storage.LayerQuota

        config.addLayerQuota(lq);
        assertNotNull(config.layerQuota("layer"));
    }

    public void testRemove() {
        LayerQuota lq = new LayerQuota("layer", ExpirationPolicy.LFU, new Quota());
        config.addLayerQuota(lq);
        config.remove(lq);
        assertNull(config.layerQuota("layer"));
    }
View Full Code Here

Examples of org.geowebcache.diskquota.storage.LayerQuota

                .longValue());

        assertNotNull(config.getLayerQuotas());
        assertEquals(2, config.getLayerQuotas().size());

        LayerQuota states = config.layerQuota("topp:states");
        assertNotNull(states);
        assertEquals(LFU, states.getExpirationPolicyName());
        assertEquals(MiB.convertTo(100, B).longValue(), states.getQuota().getBytes().longValue());

        LayerQuota raster = config.layerQuota("raster test layer");
        assertNotNull(raster);
    }
View Full Code Here

Examples of org.geowebcache.diskquota.storage.LayerQuota

    }

    public void testSaveConfig() throws ConfigurationException, IOException {
        DiskQuotaConfig config = new DiskQuotaConfig();
        List<LayerQuota> quotas = new ArrayList<LayerQuota>();
        LayerQuota lq = new LayerQuota("topp:states", LRU, new Quota(10, StorageUnit.MiB));
        quotas.add(lq);
        config.addLayerQuota(lq);

        File configFile = new File(cacheDir, "geowebcache-diskquota.xml");
        if (configFile.exists()) {
View Full Code Here

Examples of org.geowebcache.diskquota.storage.LayerQuota

        }

    }

    public QuotaResolver newLayerQuotaResolver(final String layerName) {
        LayerQuota layerQuota = quotaConfig.layerQuota(layerName);
        return new LayerQuotaResolver(layerQuota, quotaStore);
    }
View Full Code Here

Examples of org.geowebcache.diskquota.storage.LayerQuota

                            + "'. Ignoring it for this run.");
                }
                continue;
            }

            final LayerQuota definedQuotaForLayer = quotaConfig.layerQuota(layerName);
            final ExpirationPolicy policy = definedQuotaForLayer.getExpirationPolicyName();
            final Quota quota = definedQuotaForLayer.getQuota();
            final Quota usedQuota = monitor.getUsedQuotaByLayerName(layerName);

            Quota excedent = usedQuota.difference(quota);
            if (excedent.getBytes().compareTo(BigInteger.ZERO) > 0) {
                if (log.isInfoEnabled()) {
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.