aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs220
1 files changed, 110 insertions, 110 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}