changeset 954:a88fc6320cf8

Add more Javadocs gnv/trunk@1098 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 18 May 2010 09:11:31 +0000
parents 4b64b4d1f0cf
children efdc9f9d2fc0
files gnv/ChangeLog gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java gnv/src/main/java/de/intevation/gnv/action/sessionmodel/package.html
diffstat 6 files changed, 135 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/gnv/ChangeLog	Tue May 18 07:32:45 2010 +0000
+++ b/gnv/ChangeLog	Tue May 18 09:11:31 2010 +0000
@@ -1,3 +1,12 @@
+2010-05-18  Tim Englich  <tim.englich@intevation.de>
+
+	* src/main/java/de/intevation/gnv/action/sessionmodel/package.html,
+	  src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java,
+	  src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java,
+	  src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java,
+	  src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java: 
+	  Added more Javadocs.
+
 2010-05-18  Tim Englich  <tim.englich@intevation.de>
 
 	* src/main/java/de/intevation/gnv/action/mapviewer/parser/package.html,
--- a/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java	Tue May 18 07:32:45 2010 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java	Tue May 18 09:11:31 2010 +0000
@@ -1,16 +1,16 @@
 package de.intevation.gnv.action.sessionmodel;
 
-import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription;
-import de.intevation.gnv.artifactdatabase.objects.ArtifactObject;
-import de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet;
-import de.intevation.gnv.artifactdatabase.objects.OutputMode;
-
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.Locale;
 
 import org.apache.log4j.Logger;
 
+import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription;
+import de.intevation.gnv.artifactdatabase.objects.ArtifactObject;
+import de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet;
+import de.intevation.gnv.artifactdatabase.objects.OutputMode;
+
 /**
  * The default implementation of <code>SessionModel</code> which stores the
  * current artifact object and the digram options selected by the user.
@@ -30,16 +30,34 @@
      */
     private static final long serialVersionUID = 3431484439985158311L;
 
+    /**
+     * Container for <code>ArtifactFactory</code>-objects.
+     */
     private Collection<ArtifactObject> artifactFactories = null;
 
+    /**
+     * The selected <code>ArtifactFactory</code>
+     */
     private ArtifactObject selectedArtifactFactory = null;
 
+    /**
+     * The currently used artifact.
+     */
     private ArtifactObject currentArtifact = null;
 
+    /**
+     * The Diagrammoptions.
+     */
     private DiagrammOptions diagrammOptions = null;
 
+    /**
+     * The Container for statistic-values.
+     */
     private Collection<ArtifactStatisticsSet> statistics = null;
 
+    /**
+     * The Locale that currently should be used.
+     */
     private Locale currentLocale;
 
     /**
@@ -51,7 +69,6 @@
 
     /**
      * Constructor
-     *
      * @param currentLocale A locale used to create the user interface.
      */
     public DefaultSessionModel(Locale currentLocale) {
@@ -82,7 +99,7 @@
 
 
     public void setArtifacteFactories(
-                                      Collection<ArtifactObject> artifactFactories) {
+                                Collection<ArtifactObject> artifactFactories) {
         this.artifactFactories = artifactFactories;
     }
 
--- a/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java	Tue May 18 07:32:45 2010 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java	Tue May 18 09:11:31 2010 +0000
@@ -21,6 +21,8 @@
     }
 
     /**
+     * Returns the Value to a given Key
+     * @param The key of the value that should be returned.
      * @return the value.
      */
     public String getValue(String key) {
--- a/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java	Tue May 18 07:32:45 2010 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java	Tue May 18 09:11:31 2010 +0000
@@ -1,15 +1,14 @@
 package de.intevation.gnv.action.sessionmodel;
 
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.Locale;
+
 import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription;
 import de.intevation.gnv.artifactdatabase.objects.ArtifactObject;
 import de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet;
 import de.intevation.gnv.artifactdatabase.objects.OutputMode;
 
-import java.io.Serializable;
-
-import java.util.Collection;
-import java.util.Locale;
-
 /**
  * This interface describe basic methods to store artifacts and diagram options.
  * The SessionModel is saved in the session, which keeps alive during the work.
@@ -19,34 +18,111 @@
  */
 public interface SessionModel extends Serializable {
 
+    /**
+     * Returns all Artifactfactories which were retrieved from the 
+     * Artifactdatabases which are connected to the Client.
+     * @return the artifactfactories.
+     */
     Collection<ArtifactObject> getArtifactFactories();
 
+    /**
+     * Sets all Artifactfactories which were retieved from the Artifactdatabases
+     * to the SessionModel.
+     * @param artifactFactories the artifactfactories.
+     */
     void setArtifacteFactories(Collection<ArtifactObject> artifactFactories);
 
+    /**
+     * Set the Artifactfactory which match to the given id to selected.
+     * @param artiFactFactoryId the id of the artifactfactory which should 
+     *                          be selected.
+     */
     void selectArtifactFactory(String artiFactFactoryId);
 
+    /**
+     * Returns the Artifactfactory which is selected.
+     * @return the artifactfactory which is selected.
+     */
     ArtifactObject getSelectedArtifactFactory();
 
+    /**
+     * Returns the currently used artifact.
+     * This Artifact will retrieved from the selected artifactfactory and will 
+     * be used to do handle the special businesslogic.
+     * @return the artifact which is currently used.
+     */
     ArtifactObject getCurrentArtifact();
 
+    /**
+     * Sets a new Artifact as the artifact that should be used.
+     * @param artifact the new artifact which should be used.
+     */
     void setCurrentArtifact(ArtifactObject artifact);
 
+    /**
+     * Sets the currently used diagrammoptions to the Sessionmodel.
+     * Diagrammoptions will be used to manipulate the look of diagramms
+     * and render the GUI so that the user is enabled to switch the options.
+     * Diagrammoptions are also used for Histogram, all Exports and WMS 
+     * @param diagrammOptions the Options that should be used.
+     */
     void setDiagrammOptions(DiagrammOptions diagrammOptions);
 
+    /**
+     * Returns the diagrammoptions that currently set to the SessionModel.
+     * @return the diagrammoptions that currently set to the SessionModel.
+     */
     DiagrammOptions getDiagrammOptions();
 
+    /**
+     * Returns the Outputmode that matches to the given name of an mode.
+     * Outputmodes are used to define which kind of modes are defined to 
+     * generate an result for a given Artifact (chart, export, wms,...)
+     * @param name the name of the OutputMode that should be used
+     * @return the OutputMode that matches to the given name.
+     */
     OutputMode getOutputMode(String name);
 
+    /**
+     * Returns the description to the currently used Artifact.
+     * The description can be used to retrieve the supported OutputModes,
+     * the parameters that could be feed, ...
+     * @return the description of the artifact which is currently used.
+     */
     ArtifactDescription getArtifactDescription();
 
+    /**
+     * Reset the Model. So that it will have the status as no Artifactfactory
+     * was selected.
+     */
     void resetModel();
 
+    /**
+     * Sets the Statistics that were retrieved from the currently used Artifact
+     * to the SessionModel.
+     * @param statistics the Statistics that should be shown in the GUI.
+     */
     void setStatistics(Collection<ArtifactStatisticsSet> statistics);
 
+    /**
+     * Returns the statistics that are currently set to the SessionModel
+     * @return the statistics that are currently set to the SessionModel
+     */
     Collection<ArtifactStatisticsSet> getStatistics();
 
+    /**
+     * Sets the locale that should be used.
+     * The loacle will be used to customize the GUI for a language that matches
+     * to the locale or it will be used to tell the Artifactdatabase which locale
+     * has to be used.
+     * @param locale the locale that should be used.
+     */
     void setCurrentLocale(Locale locale);
 
+    /**
+     * Returns the currently used locale.
+     * @return the locale that is currently used.
+     */
     Locale getCurrentLocale();
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- a/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java	Tue May 18 07:32:45 2010 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java	Tue May 18 09:11:31 2010 +0000
@@ -12,7 +12,13 @@
  */
 public class SessionModelFactory {
 
-    public final static String SESSION_MODEL_ID = "de.intevation.gnv.action.sessionmodel.SessionModel.ID";
+    /**
+     * The id of the <code>SessionModel</code> that must be used to lookup the 
+     * model from the given <code>HttpSession<Code> of the request.
+     */
+    public final static String SESSION_MODEL_ID = "de.intevation.gnv.action." +
+                                                 "sessionmodel.SessionModel.ID";
+
     /**
      * the logger, used to log exceptions and additonaly information
      */
@@ -32,10 +38,10 @@
 
     /**
      * This Method provides an singleton Instance of this Class.
-     *
      * @return an singleton Instance of this Class
      */
     public synchronized static SessionModelFactory getInstance() {
+        log.debug("SessionModelFactory.getInstance");
         if (instance == null) {
             instance = new SessionModelFactory();
         }
@@ -44,10 +50,11 @@
 
     /**
      * Getting the ArtifactDatabaseClient
-     *
+     * @param request the tequest from which the SessionModel should be read.
      * @return the ArtifactDatabaseClient
      */
     public SessionModel getSessionModel(HttpServletRequest request) {
+        log.debug("SessionModelFactory.getSessionModel");
         synchronized (request) {
             SessionModel sm = null;
             Object obj = request.getSession().getAttribute(SESSION_MODEL_ID);
--- a/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/package.html	Tue May 18 07:32:45 2010 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/package.html	Tue May 18 09:11:31 2010 +0000
@@ -1,3 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
+This package provides the classes and interface-definitions for providing an 
+SessionModel for storing Information which can be reused during a session.
+</body>
+</html>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
 <html>
 <head>

http://dive4elements.wald.intevation.org