diff options
Diffstat (limited to 'OpenSim/Region/Storage/OpenSim.DataStore.DB4o')
-rw-r--r-- | OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs | 132 | ||||
-rw-r--r-- | OpenSim/Region/Storage/OpenSim.DataStore.DB4o/Properties/AssemblyInfo.cs | 62 |
2 files changed, 0 insertions, 194 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 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | |||
32 | using OpenSim.Region.Environment.Scenes; | ||
33 | using OpenSim.Region.Environment.LandManagement; | ||
34 | using OpenSim.Region.Environment; | ||
35 | using OpenSim.Region.Interfaces; | ||
36 | using OpenSim.Framework.Console; | ||
37 | using libsecondlife; | ||
38 | |||
39 | using Db4objects.Db4o; | ||
40 | using Db4objects.Db4o.Query; | ||
41 | |||
42 | namespace 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 | } | ||
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/Properties/AssemblyInfo.cs b/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/Properties/AssemblyInfo.cs deleted file mode 100644 index 0416779..0000000 --- a/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/Properties/AssemblyInfo.cs +++ /dev/null | |||
@@ -1,62 +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 | |||
28 | using System.Reflection; | ||
29 | using System.Runtime.CompilerServices; | ||
30 | using System.Runtime.InteropServices; | ||
31 | |||
32 | // General information about an assembly is controlled through the following | ||
33 | // set of attributes. Change these attribute values to modify the information | ||
34 | // associated with an assembly. | ||
35 | [assembly: AssemblyTitle("OpenSim.DataStore.DB4o")] | ||
36 | [assembly: AssemblyDescription("")] | ||
37 | [assembly: AssemblyConfiguration("")] | ||
38 | [assembly: AssemblyCompany("")] | ||
39 | [assembly: AssemblyProduct("OpenSim.DataStore.DB4o")] | ||
40 | [assembly: AssemblyCopyright("Copyright (c) 2007")] | ||
41 | [assembly: AssemblyTrademark("")] | ||
42 | [assembly: AssemblyCulture("")] | ||
43 | |||
44 | // Setting ComVisible to false makes the types in this assembly not visible | ||
45 | // to COM components. If you need to access a type in this assembly from | ||
46 | // COM, set the ComVisible attribute to true on that type. | ||
47 | [assembly: ComVisible(false)] | ||
48 | |||
49 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
50 | [assembly: Guid("7a12de8b-fdd1-48f5-89a9-8dc2dafbeebc")] | ||
51 | |||
52 | // Version information for an assembly consists of the following four values: | ||
53 | // | ||
54 | // Major Version | ||
55 | // Minor Version | ||
56 | // Build Number | ||
57 | // Revision | ||
58 | // | ||
59 | // You can specify all the values or you can default the Revision and Build Numbers | ||
60 | // by using the '*' as shown below: | ||
61 | [assembly: AssemblyVersion("1.0.0.0")] | ||
62 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||