sascha@1: package de.intevation.artifacts; sascha@1: tim@33: import java.io.Serializable; tim@33: sascha@4: import org.w3c.dom.Document; tim@7: import org.w3c.dom.Node; sascha@4: sascha@1: /** sascha@1: * Interface of an artifact producing factory. sascha@1: * sascha@1: * @author Sascha L. Teichmann (sascha.teichmann@intevation.de) sascha@1: */ tim@33: public interface ArtifactFactory extends Serializable sascha@1: { sascha@1: /** sascha@1: * The short name of this factory. sascha@1: * @return the name of this factory. sascha@1: */ sascha@1: String getName(); sascha@1: sascha@1: /** sascha@1: * Description of this factory. sascha@1: * @return description of the factory. sascha@1: */ sascha@1: String getDescription(); sascha@1: sascha@1: /** sascha@1: * Create a new artifact of certain type, given a general purpose context and sascha@1: * an identifier. sascha@1: * @param context a context from the ArtifactDatabase. sascha@1: * @param identifier unique identifer for the new artifact tim@75: * @param data the data containing more details for the setup of an Artifact. sascha@1: * @return a new {@linkplain de.intevation.artifacts.Artifact Artifact} sascha@1: */ tim@75: Artifact createArtifact(String identifier, Object context, Document data); sascha@4: sascha@4: /** sascha@4: * Setup the factory with a given configuration sascha@4: * @param config the configuration tim@7: * @param factoryNode the ConfigurationNode of this Factory sascha@4: */ tim@7: void setup(Document config, Node factoryNode); sascha@10: sascha@10: /** sascha@10: * Tells how long an artifact should survive if it is sascha@10: * not touched. This is put in the factory because sascha@10: * life time is nothing a artifact should handle it self. sascha@10: * This method is only called once directly after the sascha@10: * artifact is created. sascha@10: * @param artifact The artifact to be rated. sascha@10: * @param context The global context. sascha@10: * return time to live in ms. null means eternal. sascha@10: */ sascha@10: Long timeToLiveUntouched(Artifact artifact, Object context); sascha@41: sascha@41: ArtifactSerializer getSerializer(); sascha@1: } sascha@1: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: