ingo@226: package de.intevation.artifactdatabase.state; ingo@226: felix@351: import java.util.List; felix@351: ingo@278: import java.io.Serializable; ingo@278: ingo@295: import org.w3c.dom.Document; ingo@295: import org.w3c.dom.Node; ingo@295: ingo@280: import de.intevation.artifacts.Artifact; ingo@280: import de.intevation.artifacts.CallContext; ingo@280: ingo@226: ingo@226: /** ingo@226: * @author Ingo Weinzierl ingo@226: */ ingo@278: public interface Facet extends Serializable { ingo@226: ingo@226: /** ingo@277: * Returns the index of this facet. ingo@277: * ingo@277: * @return the index of this facet. ingo@277: */ ingo@277: int getIndex(); ingo@277: ingo@277: /** ingo@226: * Returns the name of this facet. ingo@226: * ingo@226: * @return the name of this facet. ingo@226: */ ingo@226: String getName(); ingo@226: ingo@226: ingo@226: /** ingo@226: * Returns the description of this facet. ingo@226: * ingo@226: * @return the description of this facet. ingo@226: */ ingo@226: String getDescription(); ingo@280: ingo@280: ingo@280: /** ingo@280: * Returns the data this facet requires. ingo@280: * ingo@280: * @param artifact The owner artifact. ingo@280: * @param context The CallContext. ingo@280: * ingo@280: * @return the data. ingo@280: */ ingo@280: Object getData(Artifact artifact, CallContext context); ingo@295: ingo@295: ingo@295: /** felix@351: * Get keys for which this Facet can provide data (for other facets, not felix@351: * for plot). felix@357: * @param artifact Artifact that this facet belongs to. felix@351: * @return list of keys felix@351: */ felix@378: List getDataProviderKeys(Artifact artifact, CallContext context); felix@351: felix@351: felix@351: /** felix@351: * Provide data to other facet. felix@351: * felix@351: * @param art The artifact that this facet belongs to. felix@351: * @param key the key of the requested service. felix@351: * @param prm optional parameters. felix@351: * @param ctxt the callcontext. felix@351: * felix@351: * @return the data felix@351: */ felix@351: Object provideBlackboardData( felix@351: Artifact art, felix@351: Object key, felix@351: Object prm, felix@351: CallContext ctxt); felix@351: felix@351: felix@351: /** ingo@295: * Write the internal representation of a facet to a node. ingo@295: * ingo@295: * @param doc A Document. ingo@295: * ingo@295: * @return the representation as Node. ingo@295: */ ingo@295: Node toXML(Document doc); sascha@322: sascha@322: Facet deepCopy(); ingo@226: } ingo@226: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :