comparison 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
comparison
equal deleted inserted replaced
272:2ce31a9414ff 273:22a90706d32d
92 public static final String ACTION_REMOVE_ARTIFACT = "removeartifact"; 92 public static final String ACTION_REMOVE_ARTIFACT = "removeartifact";
93 93
94 /** Action name for listing the artifacts of the collection.*/ 94 /** Action name for listing the artifacts of the collection.*/
95 public static final String ACTION_LIST_ARTIFACTS = "listartifacts"; 95 public static final String ACTION_LIST_ARTIFACTS = "listartifacts";
96 96
97 /** Action name for setting the ttl of a collection.*/
98 public static final String ACTION_SET_TTL = "settimetolive";
99
97 100
98 /** 101 /**
99 * Method to figure out which POST action was triggered and perform this 102 * Method to figure out which POST action was triggered and perform this
100 * operation on the collection specified by 'identifier' and found in the 103 * operation on the collection specified by 'identifier' and found in the
101 * artifact database 'db'. 104 * artifact database 'db'.
168 String art = getArtifactIdentifier(source); 171 String art = getArtifactIdentifier(source);
169 172
170 logger.info("Retrieve attribute of artifact '" + art + "'"); 173 logger.info("Retrieve attribute of artifact '" + art + "'");
171 out = db.getCollectionItemAttribute(identifier, art, meta); 174 out = db.getCollectionItemAttribute(identifier, art, meta);
172 } 175 }
176 else if (action.equals(ACTION_SET_TTL)) {
177 out = db.setCollectionTTL(identifier, source, meta);
178 }
173 else { 179 else {
174 throw new ArtifactDatabaseException(NO_SUCH_ACTION_MSG); 180 throw new ArtifactDatabaseException(NO_SUCH_ACTION_MSG);
175 } 181 }
176 } 182 }
177 catch (ArtifactDatabaseException adbe) { 183 catch (ArtifactDatabaseException adbe) {

http://dive4elements.wald.intevation.org