aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.DB4o/DB4oManager.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Data.DB4o/DB4oManager.cs21
1 files changed, 10 insertions, 11 deletions
diff --git a/OpenSim/Framework/Data.DB4o/DB4oManager.cs b/OpenSim/Framework/Data.DB4o/DB4oManager.cs
index 9e8a03f..033413a 100644
--- a/OpenSim/Framework/Data.DB4o/DB4oManager.cs
+++ b/OpenSim/Framework/Data.DB4o/DB4oManager.cs
@@ -29,23 +29,23 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using Db4objects.Db4o; 30using Db4objects.Db4o;
31using libsecondlife; 31using libsecondlife;
32using OpenSim.Framework;
33 32
34namespace OpenSim.Framework.Data.DB4o 33namespace OpenSim.Framework.Data.DB4o
35{ 34{
36 /// <summary> 35 /// <summary>
37 /// A Database manager for Db4o 36 /// A Database manager for Db4o
38 /// </summary> 37 /// </summary>
39 class DB4oGridManager 38 internal class DB4oGridManager
40 { 39 {
41 /// <summary> 40 /// <summary>
42 /// A list of the current regions connected (in-memory cache) 41 /// A list of the current regions connected (in-memory cache)
43 /// </summary> 42 /// </summary>
44 public Dictionary<LLUUID, RegionProfileData> simProfiles = new Dictionary<LLUUID, RegionProfileData>(); 43 public Dictionary<LLUUID, RegionProfileData> simProfiles = new Dictionary<LLUUID, RegionProfileData>();
44
45 /// <summary> 45 /// <summary>
46 /// Database File Name 46 /// Database File Name
47 /// </summary> 47 /// </summary>
48 string dbfl; 48 private string dbfl;
49 49
50 /// <summary> 50 /// <summary>
51 /// Creates a new grid storage manager 51 /// Creates a new grid storage manager
@@ -56,7 +56,7 @@ namespace OpenSim.Framework.Data.DB4o
56 dbfl = db4odb; 56 dbfl = db4odb;
57 IObjectContainer database; 57 IObjectContainer database;
58 database = Db4oFactory.OpenFile(dbfl); 58 database = Db4oFactory.OpenFile(dbfl);
59 IObjectSet result = database.Get(typeof(RegionProfileData)); 59 IObjectSet result = database.Get(typeof (RegionProfileData));
60 // Loads the file into the in-memory cache 60 // Loads the file into the in-memory cache
61 foreach (RegionProfileData row in result) 61 foreach (RegionProfileData row in result)
62 { 62 {
@@ -94,23 +94,22 @@ namespace OpenSim.Framework.Data.DB4o
94 return false; 94 return false;
95 } 95 }
96 } 96 }
97
98
99 } 97 }
100 98
101 /// <summary> 99 /// <summary>
102 /// A manager for the DB4o database (user profiles) 100 /// A manager for the DB4o database (user profiles)
103 /// </summary> 101 /// </summary>
104 class DB4oUserManager 102 internal class DB4oUserManager
105 { 103 {
106 /// <summary> 104 /// <summary>
107 /// A list of the user profiles (in memory cache) 105 /// A list of the user profiles (in memory cache)
108 /// </summary> 106 /// </summary>
109 public Dictionary<LLUUID, UserProfileData> userProfiles = new Dictionary<LLUUID, UserProfileData>(); 107 public Dictionary<LLUUID, UserProfileData> userProfiles = new Dictionary<LLUUID, UserProfileData>();
108
110 /// <summary> 109 /// <summary>
111 /// Database filename 110 /// Database filename
112 /// </summary> 111 /// </summary>
113 string dbfl; 112 private string dbfl;
114 113
115 /// <summary> 114 /// <summary>
116 /// Initialises a new DB manager 115 /// Initialises a new DB manager
@@ -122,7 +121,7 @@ namespace OpenSim.Framework.Data.DB4o
122 IObjectContainer database; 121 IObjectContainer database;
123 database = Db4oFactory.OpenFile(dbfl); 122 database = Db4oFactory.OpenFile(dbfl);
124 // Load to cache 123 // Load to cache
125 IObjectSet result = database.Get(typeof(UserProfileData)); 124 IObjectSet result = database.Get(typeof (UserProfileData));
126 foreach (UserProfileData row in result) 125 foreach (UserProfileData row in result)
127 { 126 {
128 if (userProfiles.ContainsKey(row.UUID)) 127 if (userProfiles.ContainsKey(row.UUID))
@@ -144,7 +143,7 @@ namespace OpenSim.Framework.Data.DB4o
144 /// <param name="record">The profile to update</param> 143 /// <param name="record">The profile to update</param>
145 /// <returns>true on success, false on fail to persist to db</returns> 144 /// <returns>true on success, false on fail to persist to db</returns>
146 public bool UpdateRecord(UserProfileData record) 145 public bool UpdateRecord(UserProfileData record)
147 { 146 {
148 if (userProfiles.ContainsKey(record.UUID)) 147 if (userProfiles.ContainsKey(record.UUID))
149 { 148 {
150 userProfiles[record.UUID] = record; 149 userProfiles[record.UUID] = record;
@@ -168,4 +167,4 @@ namespace OpenSim.Framework.Data.DB4o
168 } 167 }
169 } 168 }
170 } 169 }
171} 170} \ No newline at end of file