aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
authorMike Mazur2008-07-18 04:51:41 +0000
committerMike Mazur2008-07-18 04:51:41 +0000
commite0e0db366061eae148364e3d5670f275b1ab25b7 (patch)
treecbd4890958aa28a3ff98a917909ec77247a80d00 /OpenSim/Data
parentMake scripts LSL compliant. (diff)
downloadopensim-SC_OLD-e0e0db366061eae148364e3d5670f275b1ab25b7.zip
opensim-SC_OLD-e0e0db366061eae148364e3d5670f275b1ab25b7.tar.gz
opensim-SC_OLD-e0e0db366061eae148364e3d5670f275b1ab25b7.tar.bz2
opensim-SC_OLD-e0e0db366061eae148364e3d5670f275b1ab25b7.tar.xz
Thanks, sempuki, for a patch that moves all grid plugins to new PluginLoader (issue 1763).
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/GridDataBase.cs12
-rw-r--r--OpenSim/Data/IGridData.cs45
-rw-r--r--OpenSim/Data/ILogData.cs34
-rw-r--r--OpenSim/Data/MSSQL/MSSQLGridData.cs22
-rw-r--r--OpenSim/Data/MSSQL/MSSQLLogData.cs30
-rw-r--r--OpenSim/Data/MySQL/MySQLAssetData.cs1
-rw-r--r--OpenSim/Data/MySQL/MySQLGridData.cs22
-rw-r--r--OpenSim/Data/MySQL/MySQLLogData.cs26
-rw-r--r--OpenSim/Data/MySQL/MySQLManager.cs2
-rw-r--r--OpenSim/Data/SQLite/SQLiteGridData.cs25
10 files changed, 145 insertions, 74 deletions
diff --git a/OpenSim/Data/GridDataBase.cs b/OpenSim/Data/GridDataBase.cs
index 0c9d24a..6480f84 100644
--- a/OpenSim/Data/GridDataBase.cs
+++ b/OpenSim/Data/GridDataBase.cs
@@ -29,19 +29,21 @@ using libsecondlife;
29 29
30namespace OpenSim.Data 30namespace OpenSim.Data
31{ 31{
32 public abstract class GridDataBase : IGridData 32 public abstract class GridDataBase : IGridDataPlugin
33 { 33 {
34 public abstract RegionProfileData GetProfileByHandle(ulong regionHandle); 34 public abstract RegionProfileData GetProfileByHandle(ulong regionHandle);
35 public abstract RegionProfileData GetProfileByLLUUID(LLUUID UUID); 35 public abstract RegionProfileData GetProfileByLLUUID(LLUUID UUID);
36 public abstract RegionProfileData GetProfileByString(string regionName); 36 public abstract RegionProfileData GetProfileByString(string regionName);
37 public abstract RegionProfileData[] GetProfilesInRange(uint Xmin, uint Ymin, uint Xmax, uint Ymax); 37 public abstract RegionProfileData[] GetProfilesInRange(uint Xmin, uint Ymin, uint Xmax, uint Ymax);
38 public abstract bool AuthenticateSim(LLUUID UUID, ulong regionHandle, string simrecvkey); 38 public abstract bool AuthenticateSim(LLUUID UUID, ulong regionHandle, string simrecvkey);
39 public abstract void Initialise(string connect);
40 public abstract void Close();
41 public abstract string getName();
42 public abstract string getVersion();
43 public abstract DataResponse AddProfile(RegionProfileData profile); 39 public abstract DataResponse AddProfile(RegionProfileData profile);
44 public abstract ReservationData GetReservationAtPoint(uint x, uint y); 40 public abstract ReservationData GetReservationAtPoint(uint x, uint y);
45 public abstract DataResponse UpdateProfile(RegionProfileData profile); 41 public abstract DataResponse UpdateProfile(RegionProfileData profile);
42
43 public abstract void Initialise();
44 public abstract void Initialise(string connect);
45 public abstract void Dispose();
46 public abstract string Name { get; }
47 public abstract string Version { get; }
46 } 48 }
47} 49}
diff --git a/OpenSim/Data/IGridData.cs b/OpenSim/Data/IGridData.cs
index e242312..fa24d82 100644
--- a/OpenSim/Data/IGridData.cs
+++ b/OpenSim/Data/IGridData.cs
@@ -26,6 +26,10 @@
26 */ 26 */
27 27
28using libsecondlife; 28using libsecondlife;
29using Mono.Addins;
30using OpenSim.Framework;
31
32[assembly : AddinRoot("OpenSim.Data", "0.5")]
29 33
30namespace OpenSim.Data 34namespace OpenSim.Data
31{ 35{
@@ -40,9 +44,15 @@ namespace OpenSim.Data
40 /// <summary> 44 /// <summary>
41 /// A standard grid interface 45 /// A standard grid interface
42 /// </summary> 46 /// </summary>
43 public interface IGridData 47 [TypeExtensionPoint("/OpenSim/GridDataStore")]
48 public interface IGridDataPlugin : IPlugin
44 { 49 {
45 /// <summary> 50 /// <summary>
51 /// Initialises the interface
52 /// </summary>
53 void Initialise(string connect);
54
55 /// <summary>
46 /// Returns a sim profile from a regionHandle 56 /// Returns a sim profile from a regionHandle
47 /// </summary> 57 /// </summary>
48 /// <param name="regionHandle">A 64bit Region Handle</param> 58 /// <param name="regionHandle">A 64bit Region Handle</param>
@@ -84,28 +94,6 @@ namespace OpenSim.Data
84 bool AuthenticateSim(LLUUID UUID, ulong regionHandle, string simrecvkey); 94 bool AuthenticateSim(LLUUID UUID, ulong regionHandle, string simrecvkey);
85 95
86 /// <summary> 96 /// <summary>
87 /// Initialises the interface
88 /// </summary>
89 void Initialise(string connect);
90
91 /// <summary>
92 /// Closes the interface
93 /// </summary>
94 void Close();
95
96 /// <summary>
97 /// The plugin being loaded
98 /// </summary>
99 /// <returns>A string containing the plugin name</returns>
100 string getName();
101
102 /// <summary>
103 /// The plugins version
104 /// </summary>
105 /// <returns>A string containing the plugin version</returns>
106 string getVersion();
107
108 /// <summary>
109 /// Adds a new profile to the database 97 /// Adds a new profile to the database
110 /// </summary> 98 /// </summary>
111 /// <param name="profile">The profile to add</param> 99 /// <param name="profile">The profile to add</param>
@@ -116,4 +104,15 @@ namespace OpenSim.Data
116 104
117 ReservationData GetReservationAtPoint(uint x, uint y); 105 ReservationData GetReservationAtPoint(uint x, uint y);
118 } 106 }
107
108 public class GridDataStoreInitialiser : PluginInitialiserBase
109 {
110 private string connect;
111 public GridDataStoreInitialiser (string s) { connect = s; }
112 public override void Initialise (IPlugin plugin)
113 {
114 IGridDataPlugin p = plugin as IGridDataPlugin;
115 p.Initialise (connect);
116 }
117 }
119} 118}
diff --git a/OpenSim/Data/ILogData.cs b/OpenSim/Data/ILogData.cs
index 7275637..34657dc 100644
--- a/OpenSim/Data/ILogData.cs
+++ b/OpenSim/Data/ILogData.cs
@@ -25,6 +25,9 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using Mono.Addins;
29using OpenSim.Framework;
30
28namespace OpenSim.Data 31namespace OpenSim.Data
29{ 32{
30 /// <summary> 33 /// <summary>
@@ -61,7 +64,8 @@ namespace OpenSim.Data
61 /// <summary> 64 /// <summary>
62 /// An interface to a LogData storage system 65 /// An interface to a LogData storage system
63 /// </summary> 66 /// </summary>
64 public interface ILogData 67 [TypeExtensionPoint("/OpenSim/GridLogData")]
68 public interface ILogDataPlugin : IPlugin
65 { 69 {
66 void saveLog(string serverDaemon, string target, string methodCall, string arguments, int priority, 70 void saveLog(string serverDaemon, string target, string methodCall, string arguments, int priority,
67 string logMessage); 71 string logMessage);
@@ -70,22 +74,16 @@ namespace OpenSim.Data
70 /// Initialises the interface 74 /// Initialises the interface
71 /// </summary> 75 /// </summary>
72 void Initialise(string connect); 76 void Initialise(string connect);
73 77 }
74 /// <summary> 78
75 /// Closes the interface 79 public class LogDataInitialiser : PluginInitialiserBase
76 /// </summary> 80 {
77 void Close(); 81 private string connect;
78 82 public LogDataInitialiser (string s) { connect = s; }
79 /// <summary> 83 public override void Initialise (IPlugin plugin)
80 /// The plugin being loaded 84 {
81 /// </summary> 85 ILogDataPlugin p = plugin as ILogDataPlugin;
82 /// <returns>A string containing the plugin name</returns> 86 p.Initialise (connect);
83 string getName(); 87 }
84
85 /// <summary>
86 /// The plugins version
87 /// </summary>
88 /// <returns>A string containing the plugin version</returns>
89 string getVersion();
90 } 88 }
91} 89}
diff --git a/OpenSim/Data/MSSQL/MSSQLGridData.cs b/OpenSim/Data/MSSQL/MSSQLGridData.cs
index 0abd0d0..7de77d1 100644
--- a/OpenSim/Data/MSSQL/MSSQLGridData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLGridData.cs
@@ -33,12 +33,18 @@ using System.Security.Cryptography;
33using System.Text; 33using System.Text;
34using libsecondlife; 34using libsecondlife;
35using log4net; 35using log4net;
36using Mono.Addins;
37using OpenSim.Framework;
38
39[assembly : Addin]
40[assembly : AddinDependency("OpenSim.Data", "0.5")]
36 41
37namespace OpenSim.Data.MSSQL 42namespace OpenSim.Data.MSSQL
38{ 43{
39 /// <summary> 44 /// <summary>
40 /// A grid data interface for MSSQL Server 45 /// A grid data interface for MSSQL Server
41 /// </summary> 46 /// </summary>
47 [Extension("/OpenSim/GridDataStore")]
42 public class MSSQLGridData : GridDataBase 48 public class MSSQLGridData : GridDataBase
43 { 49 {
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -50,6 +56,12 @@ namespace OpenSim.Data.MSSQL
50 56
51 private string m_regionsTableName; 57 private string m_regionsTableName;
52 58
59 override public void Initialise()
60 {
61 m_log.Info("[MSSQLGridData]: " + Name + " cannot be default-initialized!");
62 throw new PluginNotInitialisedException (Name);
63 }
64
53 /// <summary> 65 /// <summary>
54 /// Initialises the Grid Interface 66 /// Initialises the Grid Interface
55 /// </summary> 67 /// </summary>
@@ -101,7 +113,7 @@ namespace OpenSim.Data.MSSQL
101 /// <summary> 113 /// <summary>
102 /// Shuts down the grid interface 114 /// Shuts down the grid interface
103 /// </summary> 115 /// </summary>
104 override public void Close() 116 override public void Dispose()
105 { 117 {
106 // nothing to close 118 // nothing to close
107 } 119 }
@@ -110,18 +122,18 @@ namespace OpenSim.Data.MSSQL
110 /// The name of this DB provider. 122 /// The name of this DB provider.
111 /// </summary> 123 /// </summary>
112 /// <returns>A string containing the storage system name</returns> 124 /// <returns>A string containing the storage system name</returns>
113 override public string getName() 125 override public string Name
114 { 126 {
115 return "Sql OpenGridData"; 127 get { return "Sql OpenGridData"; }
116 } 128 }
117 129
118 /// <summary> 130 /// <summary>
119 /// Database provider version. 131 /// Database provider version.
120 /// </summary> 132 /// </summary>
121 /// <returns>A string containing the storage system version</returns> 133 /// <returns>A string containing the storage system version</returns>
122 override public string getVersion() 134 override public string Version
123 { 135 {
124 return "0.1"; 136 get { return "0.1"; }
125 } 137 }
126 138
127 /// <summary> 139 /// <summary>
diff --git a/OpenSim/Data/MSSQL/MSSQLLogData.cs b/OpenSim/Data/MSSQL/MSSQLLogData.cs
index 849d0fb..d0d81b6 100644
--- a/OpenSim/Data/MSSQL/MSSQLLogData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLLogData.cs
@@ -25,21 +25,39 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System;
29using System.Reflection;
28using System.Collections.Generic; 30using System.Collections.Generic;
29using System.Data; 31using System.Data;
32using log4net;
33using Mono.Addins;
34using OpenSim.Framework;
35
36// Only one attribute per assembly. See: *GridData.cs
37// [assembly : Addin]
38// [assembly : AddinDependency("OpenSim.Data", "0.5")]
30 39
31namespace OpenSim.Data.MSSQL 40namespace OpenSim.Data.MSSQL
32{ 41{
33 /// <summary> 42 /// <summary>
34 /// An interface to the log database for MSSQL 43 /// An interface to the log database for MSSQL
35 /// </summary> 44 /// </summary>
36 internal class MSSQLLogData : ILogData 45 [Extension("/OpenSim/GridLogData")]
46 internal class MSSQLLogData : ILogDataPlugin
37 { 47 {
48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49
38 /// <summary> 50 /// <summary>
39 /// The database manager 51 /// The database manager
40 /// </summary> 52 /// </summary>
41 public MSSQLManager database; 53 public MSSQLManager database;
42 54
55 public void Initialise()
56 {
57 m_log.Info("[MSSQLLogData]: " + Name + " cannot be default-initialized!");
58 throw new PluginNotInitialisedException (Name);
59 }
60
43 /// <summary> 61 /// <summary>
44 /// Artificial constructor called when the plugin is loaded 62 /// Artificial constructor called when the plugin is loaded
45 /// </summary> 63 /// </summary>
@@ -97,15 +115,15 @@ namespace OpenSim.Data.MSSQL
97 /// Returns the name of this DB provider 115 /// Returns the name of this DB provider
98 /// </summary> 116 /// </summary>
99 /// <returns>A string containing the DB provider name</returns> 117 /// <returns>A string containing the DB provider name</returns>
100 public string getName() 118 public string Name
101 { 119 {
102 return "MSSQL Logdata Interface"; 120 get { return "MSSQL Logdata Interface"; }
103 } 121 }
104 122
105 /// <summary> 123 /// <summary>
106 /// Closes the database provider 124 /// Closes the database provider
107 /// </summary> 125 /// </summary>
108 public void Close() 126 public void Dispose()
109 { 127 {
110 // Do nothing. 128 // Do nothing.
111 } 129 }
@@ -114,9 +132,9 @@ namespace OpenSim.Data.MSSQL
114 /// Returns the version of this DB provider 132 /// Returns the version of this DB provider
115 /// </summary> 133 /// </summary>
116 /// <returns>A string containing the provider version</returns> 134 /// <returns>A string containing the provider version</returns>
117 public string getVersion() 135 public string Version
118 { 136 {
119 return "0.1"; 137 get { return "0.1"; }
120 } 138 }
121 } 139 }
122} 140}
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs
index 6cb0b4c..9284ba9 100644
--- a/OpenSim/Data/MySQL/MySQLAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLAssetData.cs
@@ -34,6 +34,7 @@ using log4net;
34using MySql.Data.MySqlClient; 34using MySql.Data.MySqlClient;
35using OpenSim.Framework; 35using OpenSim.Framework;
36 36
37
37namespace OpenSim.Data.MySQL 38namespace OpenSim.Data.MySQL
38{ 39{
39 /// <summary> 40 /// <summary>
diff --git a/OpenSim/Data/MySQL/MySQLGridData.cs b/OpenSim/Data/MySQL/MySQLGridData.cs
index bb71c99..8142c74 100644
--- a/OpenSim/Data/MySQL/MySQLGridData.cs
+++ b/OpenSim/Data/MySQL/MySQLGridData.cs
@@ -33,12 +33,18 @@ using System.Security.Cryptography;
33using System.Text; 33using System.Text;
34using libsecondlife; 34using libsecondlife;
35using log4net; 35using log4net;
36using Mono.Addins;
37using OpenSim.Framework;
38
39[assembly : Addin]
40[assembly : AddinDependency("OpenSim.Data", "0.5")]
36 41
37namespace OpenSim.Data.MySQL 42namespace OpenSim.Data.MySQL
38{ 43{
39 /// <summary> 44 /// <summary>
40 /// A MySQL Interface for the Grid Server 45 /// A MySQL Interface for the Grid Server
41 /// </summary> 46 /// </summary>
47 [Extension("/OpenSim/GridDataStore")]
42 public class MySQLGridData : GridDataBase 48 public class MySQLGridData : GridDataBase
43 { 49 {
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -48,6 +54,12 @@ namespace OpenSim.Data.MySQL
48 /// </summary> 54 /// </summary>
49 private MySQLManager database; 55 private MySQLManager database;
50 56
57 override public void Initialise()
58 {
59 m_log.Info("[MySQLLogData]: " + Name + " cannot be default-initialized!");
60 throw new PluginNotInitialisedException (Name);
61 }
62
51 /// <summary> 63 /// <summary>
52 /// <para>Initialises Grid interface</para> 64 /// <para>Initialises Grid interface</para>
53 /// <para> 65 /// <para>
@@ -144,7 +156,7 @@ namespace OpenSim.Data.MySQL
144 /// <summary> 156 /// <summary>
145 /// Shuts down the grid interface 157 /// Shuts down the grid interface
146 /// </summary> 158 /// </summary>
147 override public void Close() 159 override public void Dispose()
148 { 160 {
149 database.Close(); 161 database.Close();
150 } 162 }
@@ -153,18 +165,18 @@ namespace OpenSim.Data.MySQL
153 /// Returns the plugin name 165 /// Returns the plugin name
154 /// </summary> 166 /// </summary>
155 /// <returns>Plugin name</returns> 167 /// <returns>Plugin name</returns>
156 override public string getName() 168 override public string Name
157 { 169 {
158 return "MySql OpenGridData"; 170 get { return "MySql OpenGridData"; }
159 } 171 }
160 172
161 /// <summary> 173 /// <summary>
162 /// Returns the plugin version 174 /// Returns the plugin version
163 /// </summary> 175 /// </summary>
164 /// <returns>Plugin version</returns> 176 /// <returns>Plugin version</returns>
165 override public string getVersion() 177 override public string Version
166 { 178 {
167 return "0.1"; 179 get { return "0.1"; }
168 } 180 }
169 181
170 /// <summary> 182 /// <summary>
diff --git a/OpenSim/Data/MySQL/MySQLLogData.cs b/OpenSim/Data/MySQL/MySQLLogData.cs
index fee7f2f..f11aec5 100644
--- a/OpenSim/Data/MySQL/MySQLLogData.cs
+++ b/OpenSim/Data/MySQL/MySQLLogData.cs
@@ -28,20 +28,34 @@ using System;
28using System.Reflection; 28using System.Reflection;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using log4net; 30using log4net;
31using Mono.Addins;
32using OpenSim.Framework;
33
34// Only one attribute per assembly. See: *GridData.cs
35// [assembly : Addin]
36// [assembly : AddinDependency("OpenSim.Data", "0.5")]
31 37
32namespace OpenSim.Data.MySQL 38namespace OpenSim.Data.MySQL
33{ 39{
34 /// <summary> 40 /// <summary>
35 /// An interface to the log database for MySQL 41 /// An interface to the log database for MySQL
36 /// </summary> 42 /// </summary>
37 internal class MySQLLogData : ILogData 43 [Extension("/OpenSim/GridLogData")]
44 internal class MySQLLogData : ILogDataPlugin
38 { 45 {
39 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47
40 /// <summary> 48 /// <summary>
41 /// The database manager 49 /// The database manager
42 /// </summary> 50 /// </summary>
43 public MySQLManager database; 51 public MySQLManager database;
44 52
53 public void Initialise()
54 {
55 m_log.Info("[MySQLLogData]: " + Name + " cannot be default-initialized!");
56 throw new PluginNotInitialisedException (Name);
57 }
58
45 /// <summary> 59 /// <summary>
46 /// Artificial constructor called when the plugin is loaded 60 /// Artificial constructor called when the plugin is loaded
47 /// Uses the obsolete mysql_connection.ini if connect string is empty. 61 /// Uses the obsolete mysql_connection.ini if connect string is empty.
@@ -128,16 +142,16 @@ namespace OpenSim.Data.MySQL
128 /// Returns the name of this DB provider 142 /// Returns the name of this DB provider
129 /// </summary> 143 /// </summary>
130 /// <returns>A string containing the DB provider name</returns> 144 /// <returns>A string containing the DB provider name</returns>
131 public string getName() 145 public string Name
132 { 146 {
133 return "MySQL Logdata Interface"; 147 get { return "MySQL Logdata Interface";}
134 } 148 }
135 149
136 /// <summary> 150 /// <summary>
137 /// Closes the database provider 151 /// Closes the database provider
138 /// </summary> 152 /// </summary>
139 /// <remarks>do nothing</remarks> 153 /// <remarks>do nothing</remarks>
140 public void Close() 154 public void Dispose()
141 { 155 {
142 // Do nothing. 156 // Do nothing.
143 } 157 }
@@ -146,9 +160,9 @@ namespace OpenSim.Data.MySQL
146 /// Returns the version of this DB provider 160 /// Returns the version of this DB provider
147 /// </summary> 161 /// </summary>
148 /// <returns>A string containing the provider version</returns> 162 /// <returns>A string containing the provider version</returns>
149 public string getVersion() 163 public string Version
150 { 164 {
151 return "0.1"; 165 get { return "0.1"; }
152 } 166 }
153 } 167 }
154} 168}
diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs
index cf4bce3..89d0672 100644
--- a/OpenSim/Data/MySQL/MySQLManager.cs
+++ b/OpenSim/Data/MySQL/MySQLManager.cs
@@ -227,7 +227,7 @@ namespace OpenSim.Data.MySQL
227 227
228 return 228 return
229 string.Format("{0}.{1}.{2}.{3}", dllVersion.Major, dllVersion.Minor, dllVersion.Build, 229 string.Format("{0}.{1}.{2}.{3}", dllVersion.Major, dllVersion.Minor, dllVersion.Build,
230 dllVersion.Revision); 230 dllVersion.Revision);
231 } 231 }
232 232
233 /// <summary> 233 /// <summary>
diff --git a/OpenSim/Data/SQLite/SQLiteGridData.cs b/OpenSim/Data/SQLite/SQLiteGridData.cs
index 6fd7235..1e07458 100644
--- a/OpenSim/Data/SQLite/SQLiteGridData.cs
+++ b/OpenSim/Data/SQLite/SQLiteGridData.cs
@@ -28,23 +28,38 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Data; 30using System.Data;
31using System.Reflection;
31using System.Security.Cryptography; 32using System.Security.Cryptography;
32using System.Text; 33using System.Text;
33using libsecondlife; 34using libsecondlife;
35using log4net;
36using Mono.Addins;
34using OpenSim.Framework; 37using OpenSim.Framework;
35 38
39[assembly : Addin]
40[assembly : AddinDependency("OpenSim.Data", "0.5")]
41
36namespace OpenSim.Data.SQLite 42namespace OpenSim.Data.SQLite
37{ 43{
38 /// <summary> 44 /// <summary>
39 /// A Grid Interface to the SQLite database 45 /// A Grid Interface to the SQLite database
40 /// </summary> 46 /// </summary>
47 [Extension("/OpenSim/GridDataStore")]
41 public class SQLiteGridData : GridDataBase 48 public class SQLiteGridData : GridDataBase
42 { 49 {
50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
51
43 /// <summary> 52 /// <summary>
44 /// SQLite database manager 53 /// SQLite database manager
45 /// </summary> 54 /// </summary>
46 private SQLiteManager database; 55 private SQLiteManager database;
47 56
57 override public void Initialise()
58 {
59 m_log.Info("[SQLite]: " + Name + " cannot be default-initialized!");
60 throw new PluginNotInitialisedException (Name);
61 }
62
48 /// <summary> 63 /// <summary>
49 /// <list type="bullet"> 64 /// <list type="bullet">
50 /// <item>Initialises Inventory interface</item> 65 /// <item>Initialises Inventory interface</item>
@@ -61,7 +76,7 @@ namespace OpenSim.Data.SQLite
61 /// <summary> 76 /// <summary>
62 /// Shuts down the grid interface 77 /// Shuts down the grid interface
63 /// </summary> 78 /// </summary>
64 override public void Close() 79 override public void Dispose()
65 { 80 {
66 database.Close(); 81 database.Close();
67 } 82 }
@@ -70,18 +85,18 @@ namespace OpenSim.Data.SQLite
70 /// Returns the name of this grid interface 85 /// Returns the name of this grid interface
71 /// </summary> 86 /// </summary>
72 /// <returns>A string containing the grid interface</returns> 87 /// <returns>A string containing the grid interface</returns>
73 override public string getName() 88 override public string Name
74 { 89 {
75 return "SQLite OpenGridData"; 90 get { return "SQLite OpenGridData"; }
76 } 91 }
77 92
78 /// <summary> 93 /// <summary>
79 /// Returns the version of this grid interface 94 /// Returns the version of this grid interface
80 /// </summary> 95 /// </summary>
81 /// <returns>A string containing the version</returns> 96 /// <returns>A string containing the version</returns>
82 override public string getVersion() 97 override public string Version
83 { 98 {
84 return "0.1"; 99 get { return "0.1"; }
85 } 100 }
86 101
87 /// <summary> 102 /// <summary>