aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs')
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs132
1 files changed, 0 insertions, 132 deletions
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs
deleted file mode 100644
index 5380e7b..0000000
--- a/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs
+++ /dev/null
@@ -1,132 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Text;
31
32using OpenSim.Region.Environment.Scenes;
33using OpenSim.Region.Environment.LandManagement;
34using OpenSim.Region.Environment;
35using OpenSim.Region.Interfaces;
36using OpenSim.Framework.Console;
37using libsecondlife;
38
39using Db4objects.Db4o;
40using Db4objects.Db4o.Query;
41
42namespace OpenSim.DataStore.DB4oStorage
43{
44 public class SceneObjectQuery : Predicate
45 {
46 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
47
48 private LLUUID globalIDSearch;
49
50 public SceneObjectQuery(LLUUID find)
51 {
52 globalIDSearch = find;
53 }
54
55 public bool Match(SceneObjectGroup obj)
56 {
57 return obj.UUID == globalIDSearch;
58 }
59 }
60
61 public class DB4oDataStore : IRegionDataStore
62 {
63 private IObjectContainer db;
64
65 public void Initialise(string dbfile, string dbname)
66 {
67 m_log.Info("[DATASTORE]: DB4O - Opening " + dbfile);
68 db = Db4oFactory.OpenFile(dbfile);
69 }
70
71 public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID)
72 {
73 db.Set(obj);
74 }
75
76 public void RemoveObject(LLUUID obj, LLUUID regionUUID)
77 {
78 IObjectSet result = db.Query(new SceneObjectQuery(obj));
79 if (result.Count > 0)
80 {
81 SceneObjectGroup item = (SceneObjectGroup)result.Next();
82 db.Delete(item);
83 }
84 }
85
86 public List<SceneObjectGroup> LoadObjects(LLUUID regionUUID)
87 {
88 IObjectSet result = db.Get(typeof(SceneObjectGroup));
89 List<SceneObjectGroup> retvals = new List<SceneObjectGroup>();
90
91 m_log.Info("[DATASTORE]: DB4O - LoadObjects found " + result.Count.ToString() + " objects");
92
93 foreach (Object obj in result)
94 {
95 retvals.Add((SceneObjectGroup)obj);
96 }
97
98 return retvals;
99 }
100
101 public void StoreTerrain(double[,] ter)
102 {
103 }
104
105 public double[,] LoadTerrain()
106 {
107 return null;
108 }
109
110 public void RemoveLandObject(uint id)
111 {
112 }
113
114 public void StoreParcel(Land parcel)
115 {
116 }
117
118 public List<Land> LoadLandObjects()
119 {
120 return new List<Land>();
121 }
122
123 public void Shutdown()
124 {
125 if (db != null)
126 {
127 db.Commit();
128 db.Close();
129 }
130 }
131 }
132}