diff options
author | lbsa71 | 2008-03-28 14:54:20 +0000 |
---|---|---|
committer | lbsa71 | 2008-03-28 14:54:20 +0000 |
commit | 8c901e93474af5fcd17a7f37acd711622c5286e0 (patch) | |
tree | 732b8db3dd2480d7cdeed49f4d086194e529ba6f | |
parent | Applied patch from mantis# 825, thanks A_Biondi (diff) | |
download | opensim-SC_OLD-8c901e93474af5fcd17a7f37acd711622c5286e0.zip opensim-SC_OLD-8c901e93474af5fcd17a7f37acd711622c5286e0.tar.gz opensim-SC_OLD-8c901e93474af5fcd17a7f37acd711622c5286e0.tar.bz2 opensim-SC_OLD-8c901e93474af5fcd17a7f37acd711622c5286e0.tar.xz |
* Introduced common abstract AssetDataBase implementing IAssetProvider
* changed the semantics of SQLiteBase to SQLiteUtils
* Added abstract placeholder files for the other db providers
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Data.MSSQL/MSSQLAssetData.cs | 18 | ||||
-rw-r--r-- | OpenSim/Framework/Data.MySQL/MySQLAssetData.cs | 18 | ||||
-rw-r--r-- | OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs | 36 | ||||
-rw-r--r-- | OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/Data.SQLite/SQLiteManager.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/Data.SQLite/SQLiteUserData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/Data.SQLite/SQLiteUtils.cs (renamed from OpenSim/Framework/Data.SQLite/SQLiteBase.cs) | 18 | ||||
-rw-r--r-- | OpenSim/Framework/Data/AssetDataBase.cs | 20 | ||||
-rw-r--r-- | OpenSim/Framework/Data/DataStoreBase.cs | 10 | ||||
-rw-r--r-- | OpenSim/Framework/Data/GridDataBase.cs | 10 | ||||
-rw-r--r-- | OpenSim/Framework/Data/InventoryDataBase.cs | 10 | ||||
-rw-r--r-- | OpenSim/Framework/Data/UserDataBase.cs | 10 |
12 files changed, 108 insertions, 48 deletions
diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLAssetData.cs b/OpenSim/Framework/Data.MSSQL/MSSQLAssetData.cs index b8d57a7..059bb5e 100644 --- a/OpenSim/Framework/Data.MSSQL/MSSQLAssetData.cs +++ b/OpenSim/Framework/Data.MSSQL/MSSQLAssetData.cs | |||
@@ -34,7 +34,7 @@ using OpenSim.Framework.Console; | |||
34 | 34 | ||
35 | namespace OpenSim.Framework.Data.MSSQL | 35 | namespace OpenSim.Framework.Data.MSSQL |
36 | { | 36 | { |
37 | internal class MSSQLAssetData : IAssetProvider | 37 | internal class MSSQLAssetData : AssetDataBase |
38 | { | 38 | { |
39 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 39 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
40 | 40 | ||
@@ -66,7 +66,7 @@ namespace OpenSim.Framework.Data.MSSQL | |||
66 | UpgradeAssetsTable(tableList["assets"]); | 66 | UpgradeAssetsTable(tableList["assets"]); |
67 | } | 67 | } |
68 | 68 | ||
69 | public AssetBase FetchAsset(LLUUID assetID) | 69 | override public AssetBase FetchAsset(LLUUID assetID) |
70 | { | 70 | { |
71 | AssetBase asset = null; | 71 | AssetBase asset = null; |
72 | 72 | ||
@@ -83,7 +83,7 @@ namespace OpenSim.Framework.Data.MSSQL | |||
83 | return asset; | 83 | return asset; |
84 | } | 84 | } |
85 | 85 | ||
86 | public void CreateAsset(AssetBase asset) | 86 | override public void CreateAsset(AssetBase asset) |
87 | { | 87 | { |
88 | if (ExistsAsset((LLUUID) asset.FullID)) | 88 | if (ExistsAsset((LLUUID) asset.FullID)) |
89 | { | 89 | { |
@@ -129,7 +129,7 @@ namespace OpenSim.Framework.Data.MSSQL | |||
129 | } | 129 | } |
130 | 130 | ||
131 | 131 | ||
132 | public void UpdateAsset(AssetBase asset) | 132 | override public void UpdateAsset(AssetBase asset) |
133 | { | 133 | { |
134 | SqlCommand command = new SqlCommand("UPDATE assets set id = @id, " + | 134 | SqlCommand command = new SqlCommand("UPDATE assets set id = @id, " + |
135 | "name = @name, " + | 135 | "name = @name, " + |
@@ -169,7 +169,7 @@ namespace OpenSim.Framework.Data.MSSQL | |||
169 | } | 169 | } |
170 | } | 170 | } |
171 | 171 | ||
172 | public bool ExistsAsset(LLUUID uuid) | 172 | override public bool ExistsAsset(LLUUID uuid) |
173 | { | 173 | { |
174 | if (FetchAsset(uuid) != null) | 174 | if (FetchAsset(uuid) != null) |
175 | { | 175 | { |
@@ -181,7 +181,7 @@ namespace OpenSim.Framework.Data.MSSQL | |||
181 | /// <summary> | 181 | /// <summary> |
182 | /// All writes are immediately commited to the database, so this is a no-op | 182 | /// All writes are immediately commited to the database, so this is a no-op |
183 | /// </summary> | 183 | /// </summary> |
184 | public void CommitAssets() | 184 | override public void CommitAssets() |
185 | { | 185 | { |
186 | } | 186 | } |
187 | 187 | ||
@@ -189,7 +189,7 @@ namespace OpenSim.Framework.Data.MSSQL | |||
189 | 189 | ||
190 | #region IPlugin Members | 190 | #region IPlugin Members |
191 | 191 | ||
192 | public void Initialise() | 192 | override public void Initialise() |
193 | { | 193 | { |
194 | IniFile GridDataMySqlFile = new IniFile("mssql_connection.ini"); | 194 | IniFile GridDataMySqlFile = new IniFile("mssql_connection.ini"); |
195 | string settingDataSource = GridDataMySqlFile.ParseFileReadValue("data_source"); | 195 | string settingDataSource = GridDataMySqlFile.ParseFileReadValue("data_source"); |
@@ -205,13 +205,13 @@ namespace OpenSim.Framework.Data.MSSQL | |||
205 | TestTables(); | 205 | TestTables(); |
206 | } | 206 | } |
207 | 207 | ||
208 | public string Version | 208 | override public string Version |
209 | { | 209 | { |
210 | // get { return database.getVersion(); } | 210 | // get { return database.getVersion(); } |
211 | get { return database.getVersion(); } | 211 | get { return database.getVersion(); } |
212 | } | 212 | } |
213 | 213 | ||
214 | public string Name | 214 | override public string Name |
215 | { | 215 | { |
216 | get { return "MSSQL Asset storage engine"; } | 216 | get { return "MSSQL Asset storage engine"; } |
217 | } | 217 | } |
diff --git a/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs b/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs index b439582..79994ae 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs | |||
@@ -34,7 +34,7 @@ using OpenSim.Framework.Console; | |||
34 | 34 | ||
35 | namespace OpenSim.Framework.Data.MySQL | 35 | namespace OpenSim.Framework.Data.MySQL |
36 | { | 36 | { |
37 | internal class MySQLAssetData : IAssetProvider | 37 | internal class MySQLAssetData : AssetDataBase, IPlugin |
38 | { | 38 | { |
39 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 39 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
40 | 40 | ||
@@ -66,7 +66,7 @@ namespace OpenSim.Framework.Data.MySQL | |||
66 | UpgradeAssetsTable(tableList["assets"]); | 66 | UpgradeAssetsTable(tableList["assets"]); |
67 | } | 67 | } |
68 | 68 | ||
69 | public AssetBase FetchAsset(LLUUID assetID) | 69 | override public AssetBase FetchAsset(LLUUID assetID) |
70 | { | 70 | { |
71 | AssetBase asset = null; | 71 | AssetBase asset = null; |
72 | lock (_dbConnection) | 72 | lock (_dbConnection) |
@@ -108,7 +108,7 @@ namespace OpenSim.Framework.Data.MySQL | |||
108 | return asset; | 108 | return asset; |
109 | } | 109 | } |
110 | 110 | ||
111 | public void CreateAsset(AssetBase asset) | 111 | override public void CreateAsset(AssetBase asset) |
112 | { | 112 | { |
113 | lock (_dbConnection) | 113 | lock (_dbConnection) |
114 | { | 114 | { |
@@ -147,12 +147,12 @@ namespace OpenSim.Framework.Data.MySQL | |||
147 | } | 147 | } |
148 | } | 148 | } |
149 | 149 | ||
150 | public void UpdateAsset(AssetBase asset) | 150 | override public void UpdateAsset(AssetBase asset) |
151 | { | 151 | { |
152 | CreateAsset(asset); | 152 | CreateAsset(asset); |
153 | } | 153 | } |
154 | 154 | ||
155 | public bool ExistsAsset(LLUUID uuid) | 155 | override public bool ExistsAsset(LLUUID uuid) |
156 | { | 156 | { |
157 | throw new Exception("The method or operation is not implemented."); | 157 | throw new Exception("The method or operation is not implemented."); |
158 | } | 158 | } |
@@ -160,7 +160,7 @@ namespace OpenSim.Framework.Data.MySQL | |||
160 | /// <summary> | 160 | /// <summary> |
161 | /// All writes are immediately commited to the database, so this is a no-op | 161 | /// All writes are immediately commited to the database, so this is a no-op |
162 | /// </summary> | 162 | /// </summary> |
163 | public void CommitAssets() | 163 | override public void CommitAssets() |
164 | { | 164 | { |
165 | } | 165 | } |
166 | 166 | ||
@@ -168,7 +168,7 @@ namespace OpenSim.Framework.Data.MySQL | |||
168 | 168 | ||
169 | #region IPlugin Members | 169 | #region IPlugin Members |
170 | 170 | ||
171 | public void Initialise() | 171 | override public void Initialise() |
172 | { | 172 | { |
173 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); | 173 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); |
174 | string hostname = GridDataMySqlFile.ParseFileReadValue("hostname"); | 174 | string hostname = GridDataMySqlFile.ParseFileReadValue("hostname"); |
@@ -183,12 +183,12 @@ namespace OpenSim.Framework.Data.MySQL | |||
183 | TestTables(); | 183 | TestTables(); |
184 | } | 184 | } |
185 | 185 | ||
186 | public string Version | 186 | override public string Version |
187 | { | 187 | { |
188 | get { return _dbConnection.getVersion(); } | 188 | get { return _dbConnection.getVersion(); } |
189 | } | 189 | } |
190 | 190 | ||
191 | public string Name | 191 | override public string Name |
192 | { | 192 | { |
193 | get { return "MySQL Asset storage engine"; } | 193 | get { return "MySQL Asset storage engine"; } |
194 | } | 194 | } |
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs b/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs index 0703e54..afa73b1 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs | |||
@@ -37,7 +37,7 @@ namespace OpenSim.Framework.Data.SQLite | |||
37 | /// <summary> | 37 | /// <summary> |
38 | /// A User storage interface for the DB4o database system | 38 | /// A User storage interface for the DB4o database system |
39 | /// </summary> | 39 | /// </summary> |
40 | public class SQLiteAssetData : SQLiteBase, IAssetProvider | 40 | public class SQLiteAssetData : AssetDataBase |
41 | { | 41 | { |
42 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 42 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
43 | 43 | ||
@@ -63,7 +63,7 @@ namespace OpenSim.Framework.Data.SQLite | |||
63 | return; | 63 | return; |
64 | } | 64 | } |
65 | 65 | ||
66 | public AssetBase FetchAsset(LLUUID uuid) | 66 | override public AssetBase FetchAsset(LLUUID uuid) |
67 | { | 67 | { |
68 | 68 | ||
69 | using (SqliteCommand cmd = new SqliteCommand(SelectAssetSQL, m_conn)) | 69 | using (SqliteCommand cmd = new SqliteCommand(SelectAssetSQL, m_conn)) |
@@ -86,7 +86,7 @@ namespace OpenSim.Framework.Data.SQLite | |||
86 | } | 86 | } |
87 | } | 87 | } |
88 | 88 | ||
89 | public void CreateAsset(AssetBase asset) | 89 | override public void CreateAsset(AssetBase asset) |
90 | { | 90 | { |
91 | m_log.Info("[SQLITE]: Creating Asset " + Util.ToRawUuidString(asset.FullID)); | 91 | m_log.Info("[SQLITE]: Creating Asset " + Util.ToRawUuidString(asset.FullID)); |
92 | if (ExistsAsset(asset.FullID)) | 92 | if (ExistsAsset(asset.FullID)) |
@@ -111,7 +111,7 @@ namespace OpenSim.Framework.Data.SQLite | |||
111 | } | 111 | } |
112 | } | 112 | } |
113 | 113 | ||
114 | public void UpdateAsset(AssetBase asset) | 114 | override public void UpdateAsset(AssetBase asset) |
115 | { | 115 | { |
116 | LogAssetLoad(asset); | 116 | LogAssetLoad(asset); |
117 | 117 | ||
@@ -144,7 +144,7 @@ namespace OpenSim.Framework.Data.SQLite | |||
144 | asset.InvType, temporary, local, assetLength)); | 144 | asset.InvType, temporary, local, assetLength)); |
145 | } | 145 | } |
146 | 146 | ||
147 | public bool ExistsAsset(LLUUID uuid) | 147 | override public bool ExistsAsset(LLUUID uuid) |
148 | { | 148 | { |
149 | using (SqliteCommand cmd = new SqliteCommand(SelectAssetSQL, m_conn)) | 149 | using (SqliteCommand cmd = new SqliteCommand(SelectAssetSQL, m_conn)) |
150 | { | 150 | { |
@@ -175,7 +175,7 @@ namespace OpenSim.Framework.Data.SQLite | |||
175 | } | 175 | } |
176 | } | 176 | } |
177 | 177 | ||
178 | public void CommitAssets() // force a sync to the database | 178 | override public void CommitAssets() // force a sync to the database |
179 | { | 179 | { |
180 | m_log.Info("[SQLITE]: Attempting commit"); | 180 | m_log.Info("[SQLITE]: Attempting commit"); |
181 | // lock (ds) | 181 | // lock (ds) |
@@ -197,14 +197,14 @@ namespace OpenSim.Framework.Data.SQLite | |||
197 | { | 197 | { |
198 | DataTable assets = new DataTable("assets"); | 198 | DataTable assets = new DataTable("assets"); |
199 | 199 | ||
200 | createCol(assets, "UUID", typeof (String)); | 200 | SQLiteUtil.createCol(assets, "UUID", typeof (String)); |
201 | createCol(assets, "Name", typeof (String)); | 201 | SQLiteUtil.createCol(assets, "Name", typeof (String)); |
202 | createCol(assets, "Description", typeof (String)); | 202 | SQLiteUtil.createCol(assets, "Description", typeof (String)); |
203 | createCol(assets, "Type", typeof (Int32)); | 203 | SQLiteUtil.createCol(assets, "Type", typeof (Int32)); |
204 | createCol(assets, "InvType", typeof (Int32)); | 204 | SQLiteUtil.createCol(assets, "InvType", typeof (Int32)); |
205 | createCol(assets, "Local", typeof (Boolean)); | 205 | SQLiteUtil.createCol(assets, "Local", typeof (Boolean)); |
206 | createCol(assets, "Temporary", typeof (Boolean)); | 206 | SQLiteUtil.createCol(assets, "Temporary", typeof (Boolean)); |
207 | createCol(assets, "Data", typeof (Byte[])); | 207 | SQLiteUtil.createCol(assets, "Data", typeof (Byte[])); |
208 | // Add in contraints | 208 | // Add in contraints |
209 | assets.PrimaryKey = new DataColumn[] {assets.Columns["UUID"]}; | 209 | assets.PrimaryKey = new DataColumn[] {assets.Columns["UUID"]}; |
210 | return assets; | 210 | return assets; |
@@ -248,7 +248,7 @@ namespace OpenSim.Framework.Data.SQLite | |||
248 | 248 | ||
249 | private void InitDB(SqliteConnection conn) | 249 | private void InitDB(SqliteConnection conn) |
250 | { | 250 | { |
251 | string createAssets = defineTable(createAssetsTable()); | 251 | string createAssets = SQLiteUtil.defineTable(createAssetsTable()); |
252 | SqliteCommand pcmd = new SqliteCommand(createAssets, conn); | 252 | SqliteCommand pcmd = new SqliteCommand(createAssets, conn); |
253 | pcmd.ExecuteNonQuery(); | 253 | pcmd.ExecuteNonQuery(); |
254 | } | 254 | } |
@@ -272,7 +272,7 @@ namespace OpenSim.Framework.Data.SQLite | |||
272 | 272 | ||
273 | #region IPlugin interface | 273 | #region IPlugin interface |
274 | 274 | ||
275 | public string Version | 275 | override public string Version |
276 | { | 276 | { |
277 | get | 277 | get |
278 | { | 278 | { |
@@ -286,12 +286,12 @@ namespace OpenSim.Framework.Data.SQLite | |||
286 | } | 286 | } |
287 | } | 287 | } |
288 | 288 | ||
289 | public void Initialise() | 289 | override public void Initialise() |
290 | { | 290 | { |
291 | Initialise("AssetStorage.db", ""); | 291 | Initialise("AssetStorage.db", ""); |
292 | } | 292 | } |
293 | 293 | ||
294 | public string Name | 294 | override public string Name |
295 | { | 295 | { |
296 | get { return "SQLite Asset storage engine"; } | 296 | get { return "SQLite Asset storage engine"; } |
297 | } | 297 | } |
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs b/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs index 97fdc96..14a3e1a 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs | |||
@@ -35,7 +35,7 @@ using OpenSim.Framework.Console; | |||
35 | 35 | ||
36 | namespace OpenSim.Framework.Data.SQLite | 36 | namespace OpenSim.Framework.Data.SQLite |
37 | { | 37 | { |
38 | public class SQLiteInventoryStore : SQLiteBase, IInventoryData | 38 | public class SQLiteInventoryStore : SQLiteUtil, IInventoryData |
39 | { | 39 | { |
40 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 40 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
41 | 41 | ||
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteManager.cs b/OpenSim/Framework/Data.SQLite/SQLiteManager.cs index bec0cd8..b383b0d 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteManager.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteManager.cs | |||
@@ -35,7 +35,7 @@ using OpenSim.Framework.Console; | |||
35 | 35 | ||
36 | namespace OpenSim.Framework.Data.SQLite | 36 | namespace OpenSim.Framework.Data.SQLite |
37 | { | 37 | { |
38 | internal class SQLiteManager : SQLiteBase | 38 | internal class SQLiteManager : SQLiteUtil |
39 | { | 39 | { |
40 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 40 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
41 | 41 | ||
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs index 0b2df9d..4a582ac 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs | |||
@@ -37,7 +37,7 @@ namespace OpenSim.Framework.Data.SQLite | |||
37 | /// <summary> | 37 | /// <summary> |
38 | /// A User storage interface for the SQLite database system | 38 | /// A User storage interface for the SQLite database system |
39 | /// </summary> | 39 | /// </summary> |
40 | public class SQLiteUserData : SQLiteBase, IUserData | 40 | public class SQLiteUserData : SQLiteUtil, IUserData |
41 | { | 41 | { |
42 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 42 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
43 | 43 | ||
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteBase.cs b/OpenSim/Framework/Data.SQLite/SQLiteUtils.cs index 8997faa..1334e53 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteBase.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteUtils.cs | |||
@@ -34,17 +34,17 @@ namespace OpenSim.Framework.Data.SQLite | |||
34 | /// <summary> | 34 | /// <summary> |
35 | /// A base class for methods needed by all SQLite database classes | 35 | /// A base class for methods needed by all SQLite database classes |
36 | /// </summary> | 36 | /// </summary> |
37 | public class SQLiteBase | 37 | public class SQLiteUtil |
38 | { | 38 | { |
39 | /*********************************************************************** | 39 | /*********************************************************************** |
40 | * | 40 | * |
41 | * Database Definition Functions | 41 | * Database Definition Helper Functions |
42 | * | 42 | * |
43 | * This should be db agnostic as we define them in ADO.NET terms | 43 | * This should be db agnostic as we define them in ADO.NET terms |
44 | * | 44 | * |
45 | **********************************************************************/ | 45 | **********************************************************************/ |
46 | 46 | ||
47 | protected static void createCol(DataTable dt, string name, Type type) | 47 | public static void createCol(DataTable dt, string name, Type type) |
48 | { | 48 | { |
49 | DataColumn col = new DataColumn(name, type); | 49 | DataColumn col = new DataColumn(name, type); |
50 | dt.Columns.Add(col); | 50 | dt.Columns.Add(col); |
@@ -60,7 +60,7 @@ namespace OpenSim.Framework.Data.SQLite | |||
60 | * | 60 | * |
61 | **********************************************************************/ | 61 | **********************************************************************/ |
62 | 62 | ||
63 | protected static SqliteCommand createInsertCommand(string table, DataTable dt) | 63 | public static SqliteCommand createInsertCommand(string table, DataTable dt) |
64 | { | 64 | { |
65 | /** | 65 | /** |
66 | * This is subtle enough to deserve some commentary. | 66 | * This is subtle enough to deserve some commentary. |
@@ -95,7 +95,7 @@ namespace OpenSim.Framework.Data.SQLite | |||
95 | return cmd; | 95 | return cmd; |
96 | } | 96 | } |
97 | 97 | ||
98 | protected static SqliteCommand createUpdateCommand(string table, string pk, DataTable dt) | 98 | public static SqliteCommand createUpdateCommand(string table, string pk, DataTable dt) |
99 | { | 99 | { |
100 | string sql = "update " + table + " set "; | 100 | string sql = "update " + table + " set "; |
101 | string subsql = String.Empty; | 101 | string subsql = String.Empty; |
@@ -123,7 +123,7 @@ namespace OpenSim.Framework.Data.SQLite | |||
123 | } | 123 | } |
124 | 124 | ||
125 | 125 | ||
126 | protected static string defineTable(DataTable dt) | 126 | public static string defineTable(DataTable dt) |
127 | { | 127 | { |
128 | string sql = "create table " + dt.TableName + "("; | 128 | string sql = "create table " + dt.TableName + "("; |
129 | string subsql = String.Empty; | 129 | string subsql = String.Empty; |
@@ -168,7 +168,7 @@ namespace OpenSim.Framework.Data.SQLite | |||
168 | /// for us. | 168 | /// for us. |
169 | ///</summary> | 169 | ///</summary> |
170 | ///<returns>a built sqlite parameter</returns> | 170 | ///<returns>a built sqlite parameter</returns> |
171 | protected static SqliteParameter createSqliteParameter(string name, Type type) | 171 | public static SqliteParameter createSqliteParameter(string name, Type type) |
172 | { | 172 | { |
173 | SqliteParameter param = new SqliteParameter(); | 173 | SqliteParameter param = new SqliteParameter(); |
174 | param.ParameterName = ":" + name; | 174 | param.ParameterName = ":" + name; |
@@ -184,7 +184,7 @@ namespace OpenSim.Framework.Data.SQLite | |||
184 | * | 184 | * |
185 | **********************************************************************/ | 185 | **********************************************************************/ |
186 | 186 | ||
187 | protected static DbType dbtypeFromType(Type type) | 187 | public static DbType dbtypeFromType(Type type) |
188 | { | 188 | { |
189 | if (type == typeof (String)) | 189 | if (type == typeof (String)) |
190 | { | 190 | { |
@@ -226,7 +226,7 @@ namespace OpenSim.Framework.Data.SQLite | |||
226 | 226 | ||
227 | // this is something we'll need to implement for each db | 227 | // this is something we'll need to implement for each db |
228 | // slightly differently. | 228 | // slightly differently. |
229 | protected static string sqliteType(Type type) | 229 | public static string sqliteType(Type type) |
230 | { | 230 | { |
231 | if (type == typeof (String)) | 231 | if (type == typeof (String)) |
232 | { | 232 | { |
diff --git a/OpenSim/Framework/Data/AssetDataBase.cs b/OpenSim/Framework/Data/AssetDataBase.cs new file mode 100644 index 0000000..2162358 --- /dev/null +++ b/OpenSim/Framework/Data/AssetDataBase.cs | |||
@@ -0,0 +1,20 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using libsecondlife; | ||
5 | |||
6 | namespace OpenSim.Framework.Data | ||
7 | { | ||
8 | public abstract class AssetDataBase : IAssetProvider | ||
9 | { | ||
10 | public abstract AssetBase FetchAsset(LLUUID uuid); | ||
11 | public abstract void CreateAsset(AssetBase asset); | ||
12 | public abstract void UpdateAsset(AssetBase asset); | ||
13 | public abstract bool ExistsAsset(LLUUID uuid); | ||
14 | public abstract void CommitAssets(); | ||
15 | |||
16 | public abstract string Version { get; } | ||
17 | public abstract string Name { get; } | ||
18 | public abstract void Initialise(); | ||
19 | } | ||
20 | } | ||
diff --git a/OpenSim/Framework/Data/DataStoreBase.cs b/OpenSim/Framework/Data/DataStoreBase.cs new file mode 100644 index 0000000..671d0f0 --- /dev/null +++ b/OpenSim/Framework/Data/DataStoreBase.cs | |||
@@ -0,0 +1,10 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | namespace OpenSim.Framework.Data | ||
6 | { | ||
7 | public abstract class DataStoreBase | ||
8 | { | ||
9 | } | ||
10 | } | ||
diff --git a/OpenSim/Framework/Data/GridDataBase.cs b/OpenSim/Framework/Data/GridDataBase.cs new file mode 100644 index 0000000..e7333b4 --- /dev/null +++ b/OpenSim/Framework/Data/GridDataBase.cs | |||
@@ -0,0 +1,10 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | namespace OpenSim.Framework.Data | ||
6 | { | ||
7 | public abstract class GridDataBase | ||
8 | { | ||
9 | } | ||
10 | } | ||
diff --git a/OpenSim/Framework/Data/InventoryDataBase.cs b/OpenSim/Framework/Data/InventoryDataBase.cs new file mode 100644 index 0000000..d88acff --- /dev/null +++ b/OpenSim/Framework/Data/InventoryDataBase.cs | |||
@@ -0,0 +1,10 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | namespace OpenSim.Framework.Data | ||
6 | { | ||
7 | public abstract class InventoryDataBase | ||
8 | { | ||
9 | } | ||
10 | } | ||
diff --git a/OpenSim/Framework/Data/UserDataBase.cs b/OpenSim/Framework/Data/UserDataBase.cs new file mode 100644 index 0000000..a704ed4 --- /dev/null +++ b/OpenSim/Framework/Data/UserDataBase.cs | |||
@@ -0,0 +1,10 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | namespace OpenSim.Framework.Data | ||
6 | { | ||
7 | public abstract class UserDataBase | ||
8 | { | ||
9 | } | ||
10 | } | ||