comparison artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java @ 133:2950c6011afa

Fixed typo in keys. Removed superfluous identifier in UserFactory.createUser(). Added backend stubs for handling of users. artifacts/trunk@1358 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 02 Mar 2011 10:07:37 +0000
parents bfa65a812c7a
children b90e831d3dfe
comparison
equal deleted inserted replaced
132:6f1e8c08f747 133:2950c6011afa
9 package de.intevation.artifactdatabase; 9 package de.intevation.artifactdatabase;
10 10
11 import de.intevation.artifacts.Artifact; 11 import de.intevation.artifacts.Artifact;
12 import de.intevation.artifacts.ArtifactFactory; 12 import de.intevation.artifacts.ArtifactFactory;
13 import de.intevation.artifacts.ArtifactSerializer; 13 import de.intevation.artifacts.ArtifactSerializer;
14 import de.intevation.artifacts.User;
14 15
15 import java.sql.Connection; 16 import java.sql.Connection;
16 import java.sql.PreparedStatement; 17 import java.sql.PreparedStatement;
17 import java.sql.ResultSet; 18 import java.sql.ResultSet;
18 import java.sql.SQLException; 19 import java.sql.SQLException;
19 import java.sql.Types; 20 import java.sql.Types;
20 21
21 import javax.sql.DataSource; 22 import javax.sql.DataSource;
22 23
23 import org.apache.log4j.Logger; 24 import org.apache.log4j.Logger;
25
26 import org.w3c.dom.Document;
27
24 28
25 /** 29 /**
26 * The backend implements the low level layer used to store artifacts 30 * The backend implements the low level layer used to store artifacts
27 * in a SQL database. 31 * in a SQL database.
28 * 32 *
77 * The SQL statement to replace the content of an 81 * The SQL statement to replace the content of an
78 * existing artifact inside the database. 82 * existing artifact inside the database.
79 */ 83 */
80 public static final String SQL_REPLACE = 84 public static final String SQL_REPLACE =
81 SQL.get("artifacts.replace"); 85 SQL.get("artifacts.replace");
86
87 // USER SQL
88
89 public static final String SQL_USERS_NEXT_ID =
90 SQL.get("users.id.nextval");
91
92 public static final String SQL_USERS_INSERT =
93 SQL.get("users.insert");
94
95 public static final String SQL_USERS_SELECT_GID =
96 SQL.get("users.select.gid");
97
98 public static final String SQL_USERS_DELETE_ID =
99 SQL.get("users.delete.id");
100
101 public static final String SQL_USERS_DELETE_COLLECTIONS =
102 SQL.get("users.delete.collections");
103
104 public static final String SQL_USER_SELECT_ALL =
105 SQL.get("users.select.all");
82 106
83 /** The singleton.*/ 107 /** The singleton.*/
84 protected static Backend instance; 108 protected static Backend instance;
85 109
86 /** 110 /**
762 } 786 }
763 catch (Exception e) { 787 catch (Exception e) {
764 logger.error(e.getLocalizedMessage(), e); 788 logger.error(e.getLocalizedMessage(), e);
765 } 789 }
766 } 790 }
791
792 public User createUser(
793 String name,
794 Document role
795 ) {
796 // TODO: implement me!
797 return null;
798 }
799
800 public void deleteUser(User user) {
801 // TODO: implement me!
802 }
803
804 public User getUser(String identifier) {
805 // TODO: implement me!
806 return null;
807 }
808
809 public User [] getUsers() {
810 // TODO: implement me!
811 return null;
812 }
767 } 813 }
768 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 814 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org