Implement the "delete" path for assets. Adds a new option to allow remote asset deletion in robust handler.

This commit is contained in:
Melanie
2010-05-09 17:56:52 +01:00
parent 9b22393cf3
commit 60357d3778
11 changed files with 60 additions and 6 deletions

View File

@@ -48,5 +48,6 @@ namespace OpenSim.Data
public abstract void Initialise(string connect);
public abstract void Initialise();
public abstract void Dispose();
public abstract bool Delete(string id);
}
}

View File

@@ -38,6 +38,7 @@ namespace OpenSim.Data
bool ExistsAsset(UUID uuid);
List<AssetMetadata> FetchAssetMetadataSet(int start, int count);
void Initialise(string connect);
bool Delete(string id);
}
public class AssetDataInitialiser : PluginInitialiserBase

View File

@@ -322,6 +322,10 @@ namespace OpenSim.Data.MSSQL
return retList;
}
public override bool Delete(string id)
{
return false;
}
#endregion
}
}

View File

@@ -338,6 +338,24 @@ namespace OpenSim.Data.MySQL
return retList;
}
public override bool Delete(string id)
{
lock (m_dbLock)
{
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
MySqlCommand cmd = new MySqlCommand("delete from assets where id=?id");
cmd.Parameters.AddWithValue("?id", id);
cmd.ExecuteNonQuery();
cmd.Dispose();
}
}
return true;
}
#endregion
}
}

View File

@@ -338,6 +338,11 @@ namespace OpenSim.Data.SQLite
get { return "SQLite Asset storage engine"; }
}
public override bool Delete(string id)
{
return false;
}
#endregion
}
}

View File

@@ -338,6 +338,10 @@ namespace OpenSim.Data.SQLiteLegacy
get { return "SQLite Asset storage engine"; }
}
public override bool Delete(string id)
{
return false;
}
#endregion
}
}
}