sascha@115: /* sascha@115: * Copyright (c) 2011 by Intevation GmbH sascha@115: * sascha@115: * This program is free software under the LGPL (>=v2.1) sascha@115: * Read the file LGPL.txt coming with the software for details sascha@115: * or visit http://www.gnu.org/licenses/ if it does not exist. sascha@115: */ sascha@115: package de.intevation.artifacts; sascha@115: sascha@170: import java.util.Date; sascha@170: sascha@115: import org.w3c.dom.Document; sascha@115: import org.w3c.dom.Node; sascha@115: sascha@170: sascha@115: public interface ArtifactCollectionFactory sascha@115: { sascha@115: /** sascha@115: * The short name of this factory. sascha@115: * @return the name of this factory. sascha@115: */ sascha@115: String getName(); sascha@115: sascha@115: /** sascha@115: * Description of this factory. sascha@115: * @return description of the factory. sascha@115: */ sascha@115: String getDescription(); sascha@115: sascha@115: /** sascha@115: * Create a new artifact of certain type, given a general purpose context and sascha@115: * an identifier. sascha@115: * @param context a context from the ArtifactDatabase. sascha@115: * @param identifier unique identifer for the new artifact sascha@115: * @param data the data containing more details for the setup of an Artifact. sascha@115: * @return a new {@linkplain de.intevation.artifacts.ArtifactCollection ArtifactCollection} sascha@115: */ sascha@159: ArtifactCollection createCollection( sascha@159: String identifier, sascha@170: String name, sascha@170: Date creationTime, sascha@159: Document data, sascha@159: Object context); sascha@115: sascha@115: /** sascha@115: * Setup the factory with a given configuration sascha@115: * @param config the configuration sascha@115: * @param factoryNode the ConfigurationNode of this Factory sascha@115: */ sascha@115: void setup(Document config, Node factoryNode); sascha@120: sascha@120: /** sascha@120: * Tells how long a collection should survive if it is sascha@120: * not touched. This is put in the factory because sascha@120: * life time is nothing a collection should handle it self. sascha@120: * This method is only called once directly after the sascha@120: * artifact is created. sascha@120: * @param artifact The artifact to be rated. sascha@120: * @param context The global context. sascha@120: * @return time to live in ms. null means eternal. sascha@120: */ sascha@120: Long timeToLiveUntouched(ArtifactCollection collection, Object context); sascha@115: } sascha@115: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :