comparison artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java @ 75:d4c4c23847f5

Extended the Artifact-Interface-Method setup to be able to put the XML-Document which can contain further Data to the Artifact-Implementation. artifacts/trunk@649 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Mon, 01 Feb 2010 13:54:05 +0000
parents ce488c1d3fc4
children f69e5b87f05f
comparison
equal deleted inserted replaced
74:66f43d1e69eb 75:d4c4c23847f5
1 package de.intevation.artifactdatabase; 1 package de.intevation.artifactdatabase;
2 2
3 import java.io.IOException;
4 import java.io.OutputStream;
5 import java.util.ArrayList;
6 import java.util.HashMap;
7 import java.util.HashSet;
8 import java.util.List;
9
10 import org.apache.log4j.Logger;
11 import org.w3c.dom.Document;
12
3 import de.intevation.artifactdatabase.Backend.PersistentArtifact; 13 import de.intevation.artifactdatabase.Backend.PersistentArtifact;
4
5 import de.intevation.artifacts.Artifact; 14 import de.intevation.artifacts.Artifact;
6 import de.intevation.artifacts.ArtifactDatabase; 15 import de.intevation.artifacts.ArtifactDatabase;
7 import de.intevation.artifacts.ArtifactDatabaseException; 16 import de.intevation.artifacts.ArtifactDatabaseException;
8 import de.intevation.artifacts.ArtifactFactory; 17 import de.intevation.artifacts.ArtifactFactory;
9 import de.intevation.artifacts.CallContext; 18 import de.intevation.artifacts.CallContext;
10 import de.intevation.artifacts.CallMeta; 19 import de.intevation.artifacts.CallMeta;
11 import de.intevation.artifacts.Service; 20 import de.intevation.artifacts.Service;
12 import de.intevation.artifacts.ServiceFactory; 21 import de.intevation.artifacts.ServiceFactory;
13
14 import java.io.IOException;
15 import java.io.OutputStream;
16
17 import java.util.ArrayList;
18 import java.util.HashMap;
19 import java.util.HashSet;
20 import java.util.List;
21
22 import org.apache.log4j.Logger;
23
24 import org.w3c.dom.Document;
25 22
26 /** 23 /**
27 * @author Sascha L. Teichmann 24 * @author Sascha L. Teichmann
28 */ 25 */
29 public class ArtifactDatabaseImpl 26 public class ArtifactDatabaseImpl
303 return (ArtifactFactory)name2factory.get(factoryName); 300 return (ArtifactFactory)name2factory.get(factoryName);
304 } 301 }
305 302
306 public Document createArtifactWithFactory( 303 public Document createArtifactWithFactory(
307 String factoryName, 304 String factoryName,
308 CallMeta callMeta 305 CallMeta callMeta,
306 Document data
309 ) 307 )
310 throws ArtifactDatabaseException 308 throws ArtifactDatabaseException
311 { 309 {
312 ArtifactFactory factory = getArtifactFactory(factoryName); 310 ArtifactFactory factory = getArtifactFactory(factoryName);
313 311
315 throw new ArtifactDatabaseException(NO_SUCH_FACTORY); 313 throw new ArtifactDatabaseException(NO_SUCH_FACTORY);
316 } 314 }
317 315
318 Artifact artifact = factory.createArtifact( 316 Artifact artifact = factory.createArtifact(
319 backend.newIdentifier(), 317 backend.newIdentifier(),
320 context); 318 context,
319 data);
321 320
322 if (artifact == null) { 321 if (artifact == null) {
323 throw new ArtifactDatabaseException(CREATION_FAILED); 322 throw new ArtifactDatabaseException(CREATION_FAILED);
324 } 323 }
325 324

http://dive4elements.wald.intevation.org