comparison artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java @ 281:942a54670a72

Made the TTL of a Collection retrievable via getter method. artifacts/trunk@2174 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 21 Jun 2011 10:57:03 +0000
parents e92d5944fe4b
children b0a949d3fe09
comparison
equal deleted inserted replaced
280:7fbe674d758a 281:942a54670a72
1034 Timestamp timestamp = result.getTimestamp(1); 1034 Timestamp timestamp = result.getTimestamp(1);
1035 creationTime = new Date(timestamp.getTime()); 1035 creationTime = new Date(timestamp.getTime());
1036 } 1036 }
1037 1037
1038 collection[0] = factory.createCollection( 1038 collection[0] = factory.createCollection(
1039 identifier, name, creationTime, attribute, context); 1039 identifier, name, creationTime, ttl, attribute, context);
1040 1040
1041 return true; 1041 return true;
1042 } 1042 }
1043 }; 1043 };
1044 1044
1076 new Date(result.getTimestamp(4).getTime()); 1076 new Date(result.getTimestamp(4).getTime());
1077 Date lastAccess = 1077 Date lastAccess =
1078 new Date(result.getTimestamp(5).getTime()); 1078 new Date(result.getTimestamp(5).getTime());
1079 Document attr = 1079 Document attr =
1080 XMLUtils.fromByteArray(result.getBytes(6), true); 1080 XMLUtils.fromByteArray(result.getBytes(6), true);
1081 long ttl = result.getLong(7);
1081 1082
1082 ArtifactCollection collection = 1083 ArtifactCollection collection =
1083 collectionFactory.createCollection( 1084 collectionFactory.createCollection(
1084 collectionId, 1085 collectionId,
1085 collectionName, 1086 collectionName,
1086 creationTime, 1087 creationTime,
1088 ttl,
1087 attr, 1089 attr,
1088 context); 1090 context);
1089 1091
1090 if (ownerId != null) { 1092 if (ownerId != null) {
1091 collection.setUser(new LazyBackendUser( 1093 collection.setUser(new LazyBackendUser(
1138 String collectionIdentifier = result.getString(1); 1140 String collectionIdentifier = result.getString(1);
1139 String collectionName = result.getString(2); 1141 String collectionName = result.getString(2);
1140 Date creationTime = 1142 Date creationTime =
1141 new Date(result.getTimestamp(3).getTime()); 1143 new Date(result.getTimestamp(3).getTime());
1142 String userIdentifier = result.getString(4); 1144 String userIdentifier = result.getString(4);
1145 long ttl = result.getLong(5);
1143 1146
1144 ArtifactCollection collection = 1147 ArtifactCollection collection =
1145 collectionFactory.createCollection( 1148 collectionFactory.createCollection(
1146 collectionIdentifier, 1149 collectionIdentifier,
1147 collectionName, 1150 collectionName,
1148 creationTime, 1151 creationTime,
1152 ttl,
1149 data, 1153 data,
1150 context); 1154 context);
1151 1155
1152 if (userIdentifier != null) { 1156 if (userIdentifier != null) {
1153 LazyBackendUser user = users.get(userIdentifier); 1157 LazyBackendUser user = users.get(userIdentifier);

http://dive4elements.wald.intevation.org