aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Storage
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Storage')
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs220
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.DB4o/Properties/AssemblyInfo.cs70
2 files changed, 145 insertions, 145 deletions
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs
index 91dab04..06c9069 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs
@@ -1,110 +1,110 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4 4
5using OpenSim.Region.Environment.Scenes; 5using OpenSim.Region.Environment.Scenes;
6using OpenSim.Region.Environment.LandManagement; 6using OpenSim.Region.Environment.LandManagement;
7using OpenSim.Region.Environment; 7using OpenSim.Region.Environment;
8using OpenSim.Region.Interfaces; 8using OpenSim.Region.Interfaces;
9using OpenSim.Framework.Console; 9using OpenSim.Framework.Console;
10using libsecondlife; 10using libsecondlife;
11 11
12using Db4objects.Db4o; 12using Db4objects.Db4o;
13using Db4objects.Db4o.Query; 13using Db4objects.Db4o.Query;
14 14
15namespace OpenSim.DataStore.DB4oStorage 15namespace OpenSim.DataStore.DB4oStorage
16{ 16{
17 17
18 public class SceneObjectQuery : Predicate 18 public class SceneObjectQuery : Predicate
19 { 19 {
20 private LLUUID globalIDSearch; 20 private LLUUID globalIDSearch;
21 21
22 public SceneObjectQuery(LLUUID find) 22 public SceneObjectQuery(LLUUID find)
23 { 23 {
24 globalIDSearch = find; 24 globalIDSearch = find;
25 } 25 }
26 26
27 public bool Match(SceneObject obj) 27 public bool Match(SceneObject obj)
28 { 28 {
29 return obj.rootUUID == globalIDSearch; 29 return obj.rootUUID == globalIDSearch;
30 } 30 }
31 } 31 }
32 32
33 33
34 public class DB4oDataStore : IRegionDataStore 34 public class DB4oDataStore : IRegionDataStore
35 { 35 {
36 private IObjectContainer db; 36 private IObjectContainer db;
37 37
38 public void Initialise(string dbfile, string dbname) 38 public void Initialise(string dbfile, string dbname)
39 { 39 {
40 MainLog.Instance.Verbose("DATASTORE", "DB4O - Opening " + dbfile); 40 MainLog.Instance.Verbose("DATASTORE", "DB4O - Opening " + dbfile);
41 db = Db4oFactory.OpenFile(dbfile); 41 db = Db4oFactory.OpenFile(dbfile);
42 42
43 return; 43 return;
44 } 44 }
45 45
46 public void StoreObject(SceneObject obj) 46 public void StoreObject(SceneObject obj)
47 { 47 {
48 db.Set(obj); 48 db.Set(obj);
49 } 49 }
50 50
51 public void RemoveObject(LLUUID obj) 51 public void RemoveObject(LLUUID obj)
52 { 52 {
53 IObjectSet result = db.Query(new SceneObjectQuery(obj)); 53 IObjectSet result = db.Query(new SceneObjectQuery(obj));
54 if (result.Count > 0) 54 if (result.Count > 0)
55 { 55 {
56 SceneObject item = (SceneObject)result.Next(); 56 SceneObject item = (SceneObject)result.Next();
57 db.Delete(item); 57 db.Delete(item);
58 } 58 }
59 } 59 }
60 60
61 public List<SceneObject> LoadObjects() 61 public List<SceneObject> LoadObjects()
62 { 62 {
63 IObjectSet result = db.Get(typeof(SceneObject)); 63 IObjectSet result = db.Get(typeof(SceneObject));
64 List<SceneObject> retvals = new List<SceneObject>(); 64 List<SceneObject> retvals = new List<SceneObject>();
65 65
66 MainLog.Instance.Verbose("DATASTORE", "DB4O - LoadObjects found " + result.Count.ToString() + " objects"); 66 MainLog.Instance.Verbose("DATASTORE", "DB4O - LoadObjects found " + result.Count.ToString() + " objects");
67 67
68 foreach (Object obj in result) 68 foreach (Object obj in result)
69 { 69 {
70 retvals.Add((SceneObject)obj); 70 retvals.Add((SceneObject)obj);
71 } 71 }
72 72
73 return retvals; 73 return retvals;
74 } 74 }
75 75
76 public void StoreTerrain(double[,] ter) 76 public void StoreTerrain(double[,] ter)
77 { 77 {
78 78
79 } 79 }
80 80
81 public double[,] LoadTerrain() 81 public double[,] LoadTerrain()
82 { 82 {
83 return null; 83 return null;
84 } 84 }
85 85
86 public void RemoveLandObject(uint id) 86 public void RemoveLandObject(uint id)
87 { 87 {
88 88
89 } 89 }
90 90
91 public void StoreParcel(Land parcel) 91 public void StoreParcel(Land parcel)
92 { 92 {
93 93
94 } 94 }
95 95
96 public List<Land> LoadLandObjects() 96 public List<Land> LoadLandObjects()
97 { 97 {
98 return new List<Land>(); 98 return new List<Land>();
99 } 99 }
100 100
101 public void Shutdown() 101 public void Shutdown()
102 { 102 {
103 if (db != null) 103 if (db != null)
104 { 104 {
105 db.Commit(); 105 db.Commit();
106 db.Close(); 106 db.Close();
107 } 107 }
108 } 108 }
109 } 109 }
110} 110}
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/Properties/AssemblyInfo.cs b/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/Properties/AssemblyInfo.cs
index 0d6788b..6985947 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/Properties/AssemblyInfo.cs
@@ -1,35 +1,35 @@
1using System.Reflection; 1using System.Reflection;
2using System.Runtime.CompilerServices; 2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices; 3using System.Runtime.InteropServices;
4 4
5// General Information about an assembly is controlled through the following 5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information 6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly. 7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.DataStore.DB4o")] 8[assembly: AssemblyTitle("OpenSim.DataStore.DB4o")]
9[assembly: AssemblyDescription("")] 9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")] 10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")] 11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OpenSim.DataStore.DB4o")] 12[assembly: AssemblyProduct("OpenSim.DataStore.DB4o")]
13[assembly: AssemblyCopyright("Copyright © 2007")] 13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")] 14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")] 15[assembly: AssemblyCulture("")]
16 16
17// Setting ComVisible to false makes the types in this assembly not visible 17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from 18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type. 19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)] 20[assembly: ComVisible(false)]
21 21
22// The following GUID is for the ID of the typelib if this project is exposed to COM 22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("7a12de8b-fdd1-48f5-89a9-8dc2dafbeebc")] 23[assembly: Guid("7a12de8b-fdd1-48f5-89a9-8dc2dafbeebc")]
24 24
25// Version information for an assembly consists of the following four values: 25// Version information for an assembly consists of the following four values:
26// 26//
27// Major Version 27// Major Version
28// Minor Version 28// Minor Version
29// Build Number 29// Build Number
30// Revision 30// Revision
31// 31//
32// You can specify all the values or you can default the Revision and Build Numbers 32// You can specify all the values or you can default the Revision and Build Numbers
33// by using the '*' as shown below: 33// by using the '*' as shown below:
34[assembly: AssemblyVersion("1.0.0.0")] 34[assembly: AssemblyVersion("1.0.0.0")]
35[assembly: AssemblyFileVersion("1.0.0.0")] 35[assembly: AssemblyFileVersion("1.0.0.0")]