diff artifact-database/src/main/java/de/intevation/artifactdatabase/rest/CollectionResource.java @ 273:22a90706d32d

Enables the artifact server to set the TTL of a specific collection via REST call. artifacts/trunk@2070 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 07 Jun 2011 16:27:47 +0000
parents 4edaf3073109
children e92d5944fe4b
line wrap: on
line diff
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/rest/CollectionResource.java	Tue Jun 07 11:06:54 2011 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/rest/CollectionResource.java	Tue Jun 07 16:27:47 2011 +0000
@@ -94,6 +94,9 @@
     /** Action name for listing the artifacts of the collection.*/
     public static final String ACTION_LIST_ARTIFACTS = "listartifacts";
 
+    /** Action name for setting the ttl of a collection.*/
+    public static final String ACTION_SET_TTL = "settimetolive";
+
 
     /**
      * Method to figure out which POST action was triggered and perform this
@@ -170,6 +173,9 @@
                 logger.info("Retrieve attribute of artifact '" + art + "'");
                 out = db.getCollectionItemAttribute(identifier, art, meta);
             }
+            else if (action.equals(ACTION_SET_TTL)) {
+                out = db.setCollectionTTL(identifier, source, meta);
+            }
             else {
                 throw new ArtifactDatabaseException(NO_SUCH_ACTION_MSG);
             }

http://dive4elements.wald.intevation.org