IContentDatabase.cs 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 OpenSimulator 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. #region Header
  28. // IContentDatabase.cs
  29. // User: bongiojp
  30. //
  31. //
  32. //
  33. #endregion Header
  34. using System;
  35. using OpenMetaverse;
  36. using OpenSim.Region.Framework.Scenes;
  37. using Nini.Config;
  38. namespace OpenSim.Region.OptionalModules.ContentManagement
  39. {
  40. public interface IContentDatabase
  41. {
  42. #region Methods
  43. /// <summary>
  44. /// Returns the most recent revision number of a region.
  45. /// </summary>
  46. int GetMostRecentRevision(UUID regionid);
  47. string GetRegionObjectHeightMap(UUID regionid);
  48. string GetRegionObjectHeightMap(UUID regionid, int revision);
  49. /// <summary>
  50. /// Retrieves the xml that describes each individual object from the last revision or specific revision of the given region.
  51. /// </summary>
  52. System.Collections.ArrayList GetRegionObjectXMLList(UUID regionid);
  53. System.Collections.ArrayList GetRegionObjectXMLList(UUID regionid, int revision);
  54. /// <summary>
  55. /// Similar to the IRegionModule function. This is the function to be called before attempting to interface with the database.
  56. /// Initialise should be called one for each region to be contained in the database. The directory should be the full path
  57. /// to the repository and will only be defined once, regardless of how many times the method is called.
  58. /// </summary>
  59. void Initialise(Scene scene, String dir);
  60. /// <summary>
  61. /// Returns a list of the revision numbers and corresponding log messages for a given region.
  62. /// </summary>
  63. System.Collections.Generic.SortedDictionary<string, string> ListOfRegionRevisions(UUID id);
  64. /// <summary>
  65. /// Returns the total number of revisions saved for a specific region.
  66. /// </summary>
  67. int NumOfRegionRev(UUID regionid);
  68. /// <summary>
  69. /// Should be called once after Initialise has been called.
  70. /// </summary>
  71. void PostInitialise();
  72. /// <summary>
  73. /// Saves the Region terrain map and objects within the region as xml to the database.
  74. /// </summary>
  75. void SaveRegion(UUID regionid, string regionName, string logMessage);
  76. #endregion Methods
  77. }
  78. }