view flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/map/WSPLGENReportFacet.java @ 4187:21f4e4b79121

Refactor GaugeDischargeCurveFacet to be able to set a facet name For adding another output of the GaugeDischargeCurveArtifact it is necessary to provide to facet instances with different names. Therefore the GaugeDischargeCurveFacet is extended to set the facet name in the constructor.
author Björn Ricks <bjoern.ricks@intevation.de>
date Fri, 19 Oct 2012 13:25:49 +0200
parents e1cf76b3ecb4
children
line wrap: on
line source
package de.intevation.flys.artifacts.model.map;

import org.apache.log4j.Logger;

import de.intevation.artifacts.Artifact;
import de.intevation.artifacts.CallContext;

import de.intevation.artifactdatabase.state.Facet;

import de.intevation.flys.artifacts.model.CalculationResult;
import de.intevation.flys.artifacts.model.ReportFacet;
import de.intevation.flys.artifacts.states.DefaultState.ComputeType;


/**
 * This facet is used to provide WSPLGEN reports <b>only</b>.
 */
public class WSPLGENReportFacet extends ReportFacet {

    private static Logger logger = Logger.getLogger(WSPLGENReportFacet.class);


    protected CalculationResult result;


    public WSPLGENReportFacet() {
    }


    public WSPLGENReportFacet(
        ComputeType       type,
        String            hash,
        String            stateId,
        CalculationResult result
    ) {
        super(type, hash, stateId);
        this.result = result;
    }


    @Override
    public Object getData(Artifact artifact, CallContext context) {
        return result.getReport();
    }


    @Override
    public Facet deepCopy() {
        WSPLGENReportFacet copy = new WSPLGENReportFacet();
        copy.set(this);
        copy.type    = type;
        copy.hash    = hash;
        copy.stateId = stateId;
        copy.result  = result;
        return copy;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org