diff flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollection.java @ 587:53ad6dd2cb2b

The project list displays the favorite state of a collection now. A gold star means, that a collection is a owner's favorite project and will never die. A silver star means, that the project is a common project. flys-client/trunk@2181 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 21 Jun 2011 16:22:39 +0000
parents ba238f917b94
children 14e5e51a7de4
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollection.java	Tue Jun 21 16:14:10 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollection.java	Tue Jun 21 16:22:39 2011 +0000
@@ -23,6 +23,10 @@
     /** The creation time of this collection.*/
     protected Date creation;
 
+    /** The time to live of the collection. If this value is 0, it will never
+     * die.*/
+    protected long ttl;
+
     /** The list of artifacts that are managed by this Collection.*/
     protected List<CollectionItem> items;
 
@@ -41,16 +45,20 @@
      *
      * @param uuid The UUID.
      */
-    public DefaultCollection(String uuid) {
+    public DefaultCollection(String uuid, long ttl) {
         this.uuid       = uuid;
+        this.ttl        = ttl;
         this.items      = new ArrayList<CollectionItem>();
         this.themeLists = new HashMap<String, ThemeList>();
     }
 
 
-    public DefaultCollection(String uuid, Map<String, ThemeList> themeLists) {
-        this(uuid);
-
+    public DefaultCollection(
+        String uuid,
+        long   ttl,
+        Map<String, ThemeList> themeLists)
+    {
+        this(uuid, ttl);
         this.themeLists = themeLists;
     }
 
@@ -61,8 +69,8 @@
      * @param uuid The identifier of this collection.
      * @param name The name of this collection.
      */
-    public DefaultCollection(String uuid, String name) {
-        this(uuid);
+    public DefaultCollection(String uuid, long ttl, String name) {
+        this(uuid, ttl);
 
         this.name = name;
     }
@@ -75,8 +83,8 @@
      * @param name The name of this collection.
      * @param creation The creation time.
      */
-    public DefaultCollection(String uuid, String name, Date creation) {
-        this(uuid, name);
+    public DefaultCollection(String uuid, long ttl, String name, Date creation){
+        this(uuid, ttl, name);
 
         this.creation = creation;
     }
@@ -97,6 +105,11 @@
     }
 
 
+    public long getTTL() {
+        return ttl;
+    }
+
+
     public String getName() {
         return name;
     }

http://dive4elements.wald.intevation.org