view artifacts/src/main/java/org/dive4elements/river/artifacts/access/DGMAccess.java @ 7471:fff862f4ef76

Experimental caching of datacage recommendations. The respective hook is called a lot and running the datacage over and over again when loading data can be expensive. So the generated recommendations are cached for some time. Hopefully this improves the overall speed of loading data from the datacage.
author Sascha L. Teichmann <teichmann@intevation.de>
date Wed, 30 Oct 2013 15:26:21 +0100
parents 1f38656b68c4
children a805211690f7
line wrap: on
line source
package org.dive4elements.river.artifacts.access;

import org.dive4elements.river.artifacts.D4EArtifact;
import org.dive4elements.river.model.DGM;

public class DGMAccess
extends      RangeAccess
{
    private DGM dgm;

    private String geoJSON;

    public DGMAccess() {
    }

    public DGMAccess(D4EArtifact artifact) {
        super(artifact);
    }

    public DGM getDGM() {
        if (dgm == null) {
            Integer sridId = getInteger("dgm");
            dgm = DGM.getDGM(sridId);
        }
        return dgm;
    }

    public String getGeoJSON() {
        if (geoJSON == null) {
            geoJSON = getString("uesk.barriers");
        }
        return geoJSON;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org