aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
authorMelanie2010-05-09 17:56:52 +0100
committerMelanie2010-05-09 17:56:52 +0100
commit60357d3778c95a47481f790803b7af39c70cde9c (patch)
treecc49f9da3a6907c32d3e8de31c1d811b11477d30 /OpenSim/Data
parentAdd a field asset_flags and a corresponding enum to the asset database. This (diff)
downloadopensim-SC_OLD-60357d3778c95a47481f790803b7af39c70cde9c.zip
opensim-SC_OLD-60357d3778c95a47481f790803b7af39c70cde9c.tar.gz
opensim-SC_OLD-60357d3778c95a47481f790803b7af39c70cde9c.tar.bz2
opensim-SC_OLD-60357d3778c95a47481f790803b7af39c70cde9c.tar.xz
Implement the "delete" path for assets. Adds a new option to allow remote asset deletion in robust handler.
Diffstat (limited to 'OpenSim/Data')
-rw-r--r--OpenSim/Data/AssetDataBase.cs1
-rw-r--r--OpenSim/Data/IAssetData.cs1
-rw-r--r--OpenSim/Data/MSSQL/MSSQLAssetData.cs4
-rw-r--r--OpenSim/Data/MySQL/MySQLAssetData.cs18
-rw-r--r--OpenSim/Data/SQLite/SQLiteAssetData.cs5
-rw-r--r--OpenSim/Data/SQLiteLegacy/SQLiteAssetData.cs6
6 files changed, 34 insertions, 1 deletions
diff --git a/OpenSim/Data/AssetDataBase.cs b/OpenSim/Data/AssetDataBase.cs
index 5deb44e..e1a810c 100644
--- a/OpenSim/Data/AssetDataBase.cs
+++ b/OpenSim/Data/AssetDataBase.cs
@@ -48,5 +48,6 @@ namespace OpenSim.Data
48 public abstract void Initialise(string connect); 48 public abstract void Initialise(string connect);
49 public abstract void Initialise(); 49 public abstract void Initialise();
50 public abstract void Dispose(); 50 public abstract void Dispose();
51 public abstract bool Delete(string id);
51 } 52 }
52} 53}
diff --git a/OpenSim/Data/IAssetData.cs b/OpenSim/Data/IAssetData.cs
index 2149bca..90d5eeb 100644
--- a/OpenSim/Data/IAssetData.cs
+++ b/OpenSim/Data/IAssetData.cs
@@ -38,6 +38,7 @@ namespace OpenSim.Data
38 bool ExistsAsset(UUID uuid); 38 bool ExistsAsset(UUID uuid);
39 List<AssetMetadata> FetchAssetMetadataSet(int start, int count); 39 List<AssetMetadata> FetchAssetMetadataSet(int start, int count);
40 void Initialise(string connect); 40 void Initialise(string connect);
41 bool Delete(string id);
41 } 42 }
42 43
43 public class AssetDataInitialiser : PluginInitialiserBase 44 public class AssetDataInitialiser : PluginInitialiserBase
diff --git a/OpenSim/Data/MSSQL/MSSQLAssetData.cs b/OpenSim/Data/MSSQL/MSSQLAssetData.cs
index d6ea262..8475b22 100644
--- a/OpenSim/Data/MSSQL/MSSQLAssetData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLAssetData.cs
@@ -322,6 +322,10 @@ namespace OpenSim.Data.MSSQL
322 return retList; 322 return retList;
323 } 323 }
324 324
325 public override bool Delete(string id)
326 {
327 return false;
328 }
325 #endregion 329 #endregion
326 } 330 }
327} 331}
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs
index 5a2af4f..35eed56 100644
--- a/OpenSim/Data/MySQL/MySQLAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLAssetData.cs
@@ -338,6 +338,24 @@ namespace OpenSim.Data.MySQL
338 return retList; 338 return retList;
339 } 339 }
340 340
341 public override bool Delete(string id)
342 {
343 lock (m_dbLock)
344 {
345 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
346 {
347 dbcon.Open();
348 MySqlCommand cmd = new MySqlCommand("delete from assets where id=?id");
349 cmd.Parameters.AddWithValue("?id", id);
350 cmd.ExecuteNonQuery();
351
352 cmd.Dispose();
353 }
354 }
355
356 return true;
357 }
358
341 #endregion 359 #endregion
342 } 360 }
343} 361}
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs
index 636bf86..9b938fa 100644
--- a/OpenSim/Data/SQLite/SQLiteAssetData.cs
+++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs
@@ -338,6 +338,11 @@ namespace OpenSim.Data.SQLite
338 get { return "SQLite Asset storage engine"; } 338 get { return "SQLite Asset storage engine"; }
339 } 339 }
340 340
341 public override bool Delete(string id)
342 {
343 return false;
344 }
345
341 #endregion 346 #endregion
342 } 347 }
343} 348}
diff --git a/OpenSim/Data/SQLiteLegacy/SQLiteAssetData.cs b/OpenSim/Data/SQLiteLegacy/SQLiteAssetData.cs
index 0d63dea..df50902 100644
--- a/OpenSim/Data/SQLiteLegacy/SQLiteAssetData.cs
+++ b/OpenSim/Data/SQLiteLegacy/SQLiteAssetData.cs
@@ -338,6 +338,10 @@ namespace OpenSim.Data.SQLiteLegacy
338 get { return "SQLite Asset storage engine"; } 338 get { return "SQLite Asset storage engine"; }
339 } 339 }
340 340
341 public override bool Delete(string id)
342 {
343 return false;
344 }
341 #endregion 345 #endregion
342 } 346 }
343} \ No newline at end of file 347}