aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs78
1 files changed, 39 insertions, 39 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs
index 26044f0..ae8341f 100644
--- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) Contributors 2 * Copyright (c) Contributors
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
@@ -83,7 +83,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
83 // ----------------------------------------------------------------- 83 // -----------------------------------------------------------------
84 public void Initialise(IConfigSource config) 84 public void Initialise(IConfigSource config)
85 { 85 {
86 try 86 try
87 { 87 {
88 if ((m_config = config.Configs["JsonStore"]) == null) 88 if ((m_config = config.Configs["JsonStore"]) == null)
89 { 89 {
@@ -159,7 +159,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
159 159
160 // ----------------------------------------------------------------- 160 // -----------------------------------------------------------------
161 /// <summary> 161 /// <summary>
162 /// Called when all modules have been added for a region. This is 162 /// Called when all modules have been added for a region. This is
163 /// where we hook up events 163 /// where we hook up events
164 /// </summary> 164 /// </summary>
165 // ----------------------------------------------------------------- 165 // -----------------------------------------------------------------
@@ -184,7 +184,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
184#region SceneEvents 184#region SceneEvents
185 // ----------------------------------------------------------------- 185 // -----------------------------------------------------------------
186 /// <summary> 186 /// <summary>
187 /// 187 ///
188 /// </summary> 188 /// </summary>
189 // ----------------------------------------------------------------- 189 // -----------------------------------------------------------------
190 public void EventManagerOnObjectBeingRemovedFromScene(SceneObjectGroup obj) 190 public void EventManagerOnObjectBeingRemovedFromScene(SceneObjectGroup obj)
@@ -196,10 +196,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
196 196
197#region ScriptInvocationInteface 197#region ScriptInvocationInteface
198 198
199 199
200 // ----------------------------------------------------------------- 200 // -----------------------------------------------------------------
201 /// <summary> 201 /// <summary>
202 /// 202 ///
203 /// </summary> 203 /// </summary>
204 // ----------------------------------------------------------------- 204 // -----------------------------------------------------------------
205 public JsonStoreStats GetStoreStats() 205 public JsonStoreStats GetStoreStats()
@@ -210,13 +210,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
210 { 210 {
211 stats.StoreCount = m_JsonValueStore.Count; 211 stats.StoreCount = m_JsonValueStore.Count;
212 } 212 }
213 213
214 return stats; 214 return stats;
215 } 215 }
216 216
217 // ----------------------------------------------------------------- 217 // -----------------------------------------------------------------
218 /// <summary> 218 /// <summary>
219 /// 219 ///
220 /// </summary> 220 /// </summary>
221 // ----------------------------------------------------------------- 221 // -----------------------------------------------------------------
222 public bool AttachObjectStore(UUID objectID) 222 public bool AttachObjectStore(UUID objectID)
@@ -235,17 +235,17 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
235 { 235 {
236 if (m_JsonValueStore.ContainsKey(objectID)) 236 if (m_JsonValueStore.ContainsKey(objectID))
237 return true; 237 return true;
238 238
239 JsonStore map = new JsonObjectStore(m_scene,objectID); 239 JsonStore map = new JsonObjectStore(m_scene,objectID);
240 m_JsonValueStore.Add(objectID,map); 240 m_JsonValueStore.Add(objectID,map);
241 } 241 }
242 242
243 return true; 243 return true;
244 } 244 }
245 245
246 // ----------------------------------------------------------------- 246 // -----------------------------------------------------------------
247 /// <summary> 247 /// <summary>
248 /// 248 ///
249 /// </summary> 249 /// </summary>
250 // ----------------------------------------------------------------- 250 // -----------------------------------------------------------------
251 public bool CreateStore(string value, ref UUID result) 251 public bool CreateStore(string value, ref UUID result)
@@ -254,12 +254,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
254 result = UUID.Random(); 254 result = UUID.Random();
255 255
256 JsonStore map = null; 256 JsonStore map = null;
257 257
258 if (! m_enabled) return false; 258 if (! m_enabled) return false;
259 259
260 260
261 try 261 try
262 { 262 {
263 map = new JsonStore(value); 263 map = new JsonStore(value);
264 } 264 }
265 catch (Exception) 265 catch (Exception)
@@ -270,13 +270,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
270 270
271 lock (m_JsonValueStore) 271 lock (m_JsonValueStore)
272 m_JsonValueStore.Add(result,map); 272 m_JsonValueStore.Add(result,map);
273 273
274 return true; 274 return true;
275 } 275 }
276 276
277 // ----------------------------------------------------------------- 277 // -----------------------------------------------------------------
278 /// <summary> 278 /// <summary>
279 /// 279 ///
280 /// </summary> 280 /// </summary>
281 // ----------------------------------------------------------------- 281 // -----------------------------------------------------------------
282 public bool DestroyStore(UUID storeID) 282 public bool DestroyStore(UUID storeID)
@@ -289,7 +289,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
289 289
290 // ----------------------------------------------------------------- 290 // -----------------------------------------------------------------
291 /// <summary> 291 /// <summary>
292 /// 292 ///
293 /// </summary> 293 /// </summary>
294 // ----------------------------------------------------------------- 294 // -----------------------------------------------------------------
295 public bool TestStore(UUID storeID) 295 public bool TestStore(UUID storeID)
@@ -302,7 +302,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
302 302
303 // ----------------------------------------------------------------- 303 // -----------------------------------------------------------------
304 /// <summary> 304 /// <summary>
305 /// 305 ///
306 /// </summary> 306 /// </summary>
307 // ----------------------------------------------------------------- 307 // -----------------------------------------------------------------
308 public JsonStoreNodeType GetNodeType(UUID storeID, string path) 308 public JsonStoreNodeType GetNodeType(UUID storeID, string path)
@@ -318,7 +318,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
318 return JsonStoreNodeType.Undefined; 318 return JsonStoreNodeType.Undefined;
319 } 319 }
320 } 320 }
321 321
322 try 322 try
323 { 323 {
324 lock (map) 324 lock (map)
@@ -334,7 +334,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
334 334
335 // ----------------------------------------------------------------- 335 // -----------------------------------------------------------------
336 /// <summary> 336 /// <summary>
337 /// 337 ///
338 /// </summary> 338 /// </summary>
339 // ----------------------------------------------------------------- 339 // -----------------------------------------------------------------
340 public JsonStoreValueType GetValueType(UUID storeID, string path) 340 public JsonStoreValueType GetValueType(UUID storeID, string path)
@@ -350,7 +350,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
350 return JsonStoreValueType.Undefined; 350 return JsonStoreValueType.Undefined;
351 } 351 }
352 } 352 }
353 353
354 try 354 try
355 { 355 {
356 lock (map) 356 lock (map)
@@ -366,7 +366,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
366 366
367 // ----------------------------------------------------------------- 367 // -----------------------------------------------------------------
368 /// <summary> 368 /// <summary>
369 /// 369 ///
370 /// </summary> 370 /// </summary>
371 // ----------------------------------------------------------------- 371 // -----------------------------------------------------------------
372 public bool SetValue(UUID storeID, string path, string value, bool useJson) 372 public bool SetValue(UUID storeID, string path, string value, bool useJson)
@@ -382,7 +382,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
382 return false; 382 return false;
383 } 383 }
384 } 384 }
385 385
386 try 386 try
387 { 387 {
388 lock (map) 388 lock (map)
@@ -393,7 +393,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
393 storeID,map.StringSpace,m_maxStringSpace); 393 storeID,map.StringSpace,m_maxStringSpace);
394 return false; 394 return false;
395 } 395 }
396 396
397 return map.SetValue(path,value,useJson); 397 return map.SetValue(path,value,useJson);
398 } 398 }
399 } 399 }
@@ -404,10 +404,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
404 404
405 return false; 405 return false;
406 } 406 }
407 407
408 // ----------------------------------------------------------------- 408 // -----------------------------------------------------------------
409 /// <summary> 409 /// <summary>
410 /// 410 ///
411 /// </summary> 411 /// </summary>
412 // ----------------------------------------------------------------- 412 // -----------------------------------------------------------------
413 public bool RemoveValue(UUID storeID, string path) 413 public bool RemoveValue(UUID storeID, string path)
@@ -423,7 +423,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
423 return false; 423 return false;
424 } 424 }
425 } 425 }
426 426
427 try 427 try
428 { 428 {
429 lock (map) 429 lock (map)
@@ -436,10 +436,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
436 436
437 return false; 437 return false;
438 } 438 }
439 439
440 // ----------------------------------------------------------------- 440 // -----------------------------------------------------------------
441 /// <summary> 441 /// <summary>
442 /// 442 ///
443 /// </summary> 443 /// </summary>
444 // ----------------------------------------------------------------- 444 // -----------------------------------------------------------------
445 public int GetArrayLength(UUID storeID, string path) 445 public int GetArrayLength(UUID storeID, string path)
@@ -464,19 +464,19 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
464 { 464 {
465 m_log.Error("[JsonStore]: unable to retrieve value", e); 465 m_log.Error("[JsonStore]: unable to retrieve value", e);
466 } 466 }
467 467
468 return -1; 468 return -1;
469 } 469 }
470 470
471 // ----------------------------------------------------------------- 471 // -----------------------------------------------------------------
472 /// <summary> 472 /// <summary>
473 /// 473 ///
474 /// </summary> 474 /// </summary>
475 // ----------------------------------------------------------------- 475 // -----------------------------------------------------------------
476 public bool GetValue(UUID storeID, string path, bool useJson, out string value) 476 public bool GetValue(UUID storeID, string path, bool useJson, out string value)
477 { 477 {
478 value = String.Empty; 478 value = String.Empty;
479 479
480 if (! m_enabled) return false; 480 if (! m_enabled) return false;
481 481
482 JsonStore map = null; 482 JsonStore map = null;
@@ -497,13 +497,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
497 { 497 {
498 m_log.Error("[JsonStore]: unable to retrieve value", e); 498 m_log.Error("[JsonStore]: unable to retrieve value", e);
499 } 499 }
500 500
501 return false; 501 return false;
502 } 502 }
503 503
504 // ----------------------------------------------------------------- 504 // -----------------------------------------------------------------
505 /// <summary> 505 /// <summary>
506 /// 506 ///
507 /// </summary> 507 /// </summary>
508 // ----------------------------------------------------------------- 508 // -----------------------------------------------------------------
509 public void TakeValue(UUID storeID, string path, bool useJson, TakeValueCallback cback) 509 public void TakeValue(UUID storeID, string path, bool useJson, TakeValueCallback cback)
@@ -536,13 +536,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
536 { 536 {
537 m_log.Error("[JsonStore] unable to retrieve value", e); 537 m_log.Error("[JsonStore] unable to retrieve value", e);
538 } 538 }
539 539
540 cback(String.Empty); 540 cback(String.Empty);
541 } 541 }
542 542
543 // ----------------------------------------------------------------- 543 // -----------------------------------------------------------------
544 /// <summary> 544 /// <summary>
545 /// 545 ///
546 /// </summary> 546 /// </summary>
547 // ----------------------------------------------------------------- 547 // -----------------------------------------------------------------
548 public void ReadValue(UUID storeID, string path, bool useJson, TakeValueCallback cback) 548 public void ReadValue(UUID storeID, string path, bool useJson, TakeValueCallback cback)
@@ -575,7 +575,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
575 { 575 {
576 m_log.Error("[JsonStore]: unable to retrieve value", e); 576 m_log.Error("[JsonStore]: unable to retrieve value", e);
577 } 577 }
578 578
579 cback(String.Empty); 579 cback(String.Empty);
580 } 580 }
581 581