IUserManagement.cs 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. using System;
  28. using System.Collections.Generic;
  29. using OpenMetaverse;
  30. namespace OpenSim.Services.Interfaces
  31. {
  32. /// <summary>
  33. /// This maintains the relationship between a UUID and a user name.
  34. /// </summary>
  35. public interface IUserManagement
  36. {
  37. string GetUserName(UUID uuid);
  38. string GetUserHomeURL(UUID uuid);
  39. string GetUserUUI(UUID uuid);
  40. bool GetUserUUI(UUID userID, out string uui);
  41. string GetUserServerURL(UUID uuid, string serverType);
  42. /// <summary>
  43. /// Get user ID by the given name.
  44. /// </summary>
  45. /// <param name="name"></param>
  46. /// <returns>UUID.Zero if no user with that name is found or if the name is "Unknown User"</returns>
  47. UUID GetUserIdByName(string name);
  48. /// <summary>
  49. /// Get user ID by the given name.
  50. /// </summary>
  51. /// <param name="firstName"></param>
  52. /// <param name="lastName"></param>
  53. /// <returns>UUID.Zero if no user with that name is found or if the name is "Unknown User"</returns>
  54. UUID GetUserIdByName(string firstName, string lastName);
  55. /// <summary>
  56. /// Add a user.
  57. /// </summary>
  58. /// <remarks>
  59. /// If an account is found for the UUID, then the names in this will be used rather than any information
  60. /// extracted from creatorData.
  61. /// </remarks>
  62. /// <param name="uuid"></param>
  63. /// <param name="creatorData">The creator data for this user.</param>
  64. void AddUser(UUID uuid, string creatorData);
  65. /// <summary>
  66. /// Add a user.
  67. /// </summary>
  68. /// <remarks>
  69. /// The UUID is related to the name without any other checks being performed, such as user account presence.
  70. /// </remarks>
  71. /// <param name="uuid"></param>
  72. /// <param name="firstName"></param>
  73. /// <param name="lastName"></param>
  74. void AddUser(UUID uuid, string firstName, string lastName);
  75. /// <summary>
  76. /// Add a user.
  77. /// </summary>
  78. /// <remarks>
  79. /// The arguments apart from uuid are formed into a creatorData string and processing proceeds as for the
  80. /// AddUser(UUID uuid, string creatorData) method.
  81. /// </remarks>
  82. /// <param name="uuid"></param>
  83. /// <param name="firstName"></param>
  84. /// <param name="profileURL"></param>
  85. void AddUser(UUID uuid, string firstName, string lastName, string homeURL);
  86. bool IsLocalGridUser(UUID uuid);
  87. }
  88. }