changeset 127:0245a87df368

Made the user factory available in the artifact database. artifacts/trunk@1351 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 01 Mar 2011 18:45:34 +0000
parents 76744dcbe826
children bfa65a812c7a
files ChangeLog artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java artifact-database/src/main/java/de/intevation/artifactdatabase/FactoryBootstrap.java
diffstat 3 files changed, 31 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Mar 01 17:49:17 2011 +0000
+++ b/ChangeLog	Tue Mar 01 18:45:34 2011 +0000
@@ -1,3 +1,11 @@
+2011-03-01  Ingo Weinzierl <ingo@intevation.de>
+
+	* artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java:
+	  Setup the user factory.
+
+	* artifact-database/src/main/java/de/intevation/artifactdatabase/FactoryBootstrap.java:
+	  New method to retrieve the user factory.
+
 2011-03-01  Ingo Weinzierl <ingo@intevation.de>
 
 	* artifact-database/doc/example-conf/conf.xml: Added a user-factory
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java	Tue Mar 01 17:49:17 2011 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java	Tue Mar 01 18:45:34 2011 +0000
@@ -350,6 +350,11 @@
     protected HashMap     name2service;
 
     /**
+     * The factory that is used to create and list users.
+     */
+    protected UserFactory userFactory;
+
+    /**
      * Reference to the storage backend.
      */
     protected Backend     backend;
@@ -399,6 +404,7 @@
 
         setupArtifactFactories(bootstrap);
         setupServices(bootstrap);
+        setupUserFactory(bootstrap);
 
         context      = bootstrap.getContext();
         exportSecret = bootstrap.getExportSecret();
@@ -431,6 +437,14 @@
         }
     }
 
+
+    /**
+     * Used to extract the user factory from the bootstrap.
+     */
+    protected void setupUserFactory(FactoryBootstrap bootstrap) {
+        userFactory = bootstrap.getUserFactory();
+    }
+
     /**
      * Used to extract the service factories from the bootstrap
      * parameters, setting up the services and building the internal
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/FactoryBootstrap.java	Tue Mar 01 17:49:17 2011 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/FactoryBootstrap.java	Tue Mar 01 18:45:34 2011 +0000
@@ -328,6 +328,15 @@
     }
 
     /**
+     * Returns the user factory.
+     *
+     * @return the user factory.
+     */
+    public UserFactory getUserFactory() {
+        return userFactory;
+    }
+
+    /**
      * Returns the global context created by the global context factory.
      * @return The global context.
      */

http://dive4elements.wald.intevation.org