aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-07-24 17:10:07 +0000
committerJustin Clarke Casey2008-07-24 17:10:07 +0000
commit918c0a482663cbda9f75901e894d463b7f7c2b0b (patch)
treeefebc66be58f9fd5683bf7ade1ba8dd2aace2658
parent* minor: eliminate warnings from LindenUDP (diff)
downloadopensim-SC_OLD-918c0a482663cbda9f75901e894d463b7f7c2b0b.zip
opensim-SC_OLD-918c0a482663cbda9f75901e894d463b7f7c2b0b.tar.gz
opensim-SC_OLD-918c0a482663cbda9f75901e894d463b7f7c2b0b.tar.bz2
opensim-SC_OLD-918c0a482663cbda9f75901e894d463b7f7c2b0b.tar.xz
* refactor: move remaining user service -> inventory service OGS1 calls into the specific inter service class
-rwxr-xr-xOpenSim/Grid/Communications/OGS1/OGS1InterServiceInventoryService.cs10
-rw-r--r--OpenSim/Grid/UserServer/Main.cs6
-rw-r--r--OpenSim/Grid/UserServer/UserLoginService.cs30
3 files changed, 21 insertions, 25 deletions
diff --git a/OpenSim/Grid/Communications/OGS1/OGS1InterServiceInventoryService.cs b/OpenSim/Grid/Communications/OGS1/OGS1InterServiceInventoryService.cs
index 92a6ad8..6aa1440 100755
--- a/OpenSim/Grid/Communications/OGS1/OGS1InterServiceInventoryService.cs
+++ b/OpenSim/Grid/Communications/OGS1/OGS1InterServiceInventoryService.cs
@@ -46,6 +46,11 @@ namespace OpenSim.Grid.Communications.OGS1
46 m_inventoryServerUrl = inventoryServerUrl; 46 m_inventoryServerUrl = inventoryServerUrl;
47 } 47 }
48 48
49 /// <summary>
50 /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/>
51 /// </summary>
52 /// <param name="userId"></param>
53 /// <returns></returns>
49 public bool CreateNewUserInventory(LLUUID userId) 54 public bool CreateNewUserInventory(LLUUID userId)
50 { 55 {
51 return SynchronousRestObjectPoster.BeginPostObject<Guid, bool>( 56 return SynchronousRestObjectPoster.BeginPostObject<Guid, bool>(
@@ -59,9 +64,8 @@ namespace OpenSim.Grid.Communications.OGS1
59 /// <returns></returns> 64 /// <returns></returns>
60 public List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId) 65 public List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId)
61 { 66 {
62 //m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: The GetInventorySkeleton() method here should never be called!"); 67 return SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>(
63 68 "POST", m_inventoryServerUrl + "RootFolders/", userId.UUID);
64 return new List<InventoryFolderBase>();
65 } 69 }
66 } 70 }
67} 71}
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs
index 6e970d5..1338d68 100644
--- a/OpenSim/Grid/UserServer/Main.cs
+++ b/OpenSim/Grid/UserServer/Main.cs
@@ -100,10 +100,10 @@ namespace OpenSim.Grid.UserServer
100 m_userManager._config = Cfg; 100 m_userManager._config = Cfg;
101 m_userManager.AddPlugin(Cfg.DatabaseProvider, Cfg.DatabaseConnect); 101 m_userManager.AddPlugin(Cfg.DatabaseProvider, Cfg.DatabaseConnect);
102 102
103 m_loginService = new UserLoginService( 103 m_interServiceInventoryService = new OGS1InterServiceInventoryService(m_userManager._config.InventoryUrl);
104 m_userManager, new LibraryRootFolder(), Cfg, Cfg.DefaultStartupMsg);
105 104
106 m_interServiceInventoryService = new OGS1InterServiceInventoryService(m_userManager._config.InventoryUrl); 105 m_loginService = new UserLoginService(
106 m_userManager, m_interServiceInventoryService, new LibraryRootFolder(), Cfg, Cfg.DefaultStartupMsg);
107 107
108 m_messagesService = new MessageServersConnector(); 108 m_messagesService = new MessageServersConnector();
109 109
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs
index 78f6e7c..6575b13 100644
--- a/OpenSim/Grid/UserServer/UserLoginService.cs
+++ b/OpenSim/Grid/UserServer/UserLoginService.cs
@@ -46,6 +46,8 @@ namespace OpenSim.Grid.UserServer
46 public class UserLoginService : LoginService 46 public class UserLoginService : LoginService
47 { 47 {
48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49
50 protected IInterServiceInventoryServices m_inventoryService;
49 51
50 public event UserLoggedInAtLocation OnUserLoggedInAtLocation; 52 public event UserLoggedInAtLocation OnUserLoggedInAtLocation;
51 53
@@ -54,12 +56,14 @@ namespace OpenSim.Grid.UserServer
54 public UserConfig m_config; 56 public UserConfig m_config;
55 57
56 public UserLoginService( 58 public UserLoginService(
57 UserManagerBase userManager, LibraryRootFolder libraryRootFolder, 59 UserManagerBase userManager, IInterServiceInventoryServices inventoryService, LibraryRootFolder libraryRootFolder,
58 UserConfig config, string welcomeMess) 60 UserConfig config, string welcomeMess)
59 : base(userManager, libraryRootFolder, welcomeMess) 61 : base(userManager, libraryRootFolder, welcomeMess)
60 { 62 {
61 m_config = config; 63 m_config = config;
64 m_inventoryService = inventoryService;
62 } 65 }
66
63 public override void LogOffUser(UserProfileData theUser, string message) 67 public override void LogOffUser(UserProfileData theUser, string message)
64 { 68 {
65 RegionProfileData SimInfo = null; 69 RegionProfileData SimInfo = null;
@@ -96,6 +100,7 @@ namespace OpenSim.Grid.UserServer
96 m_log.InfoFormat( 100 m_log.InfoFormat(
97 "[ASSUMED CRASH]: Telling region {0} @ {1},{2} ({3}) that their agent is dead: {4}", 101 "[ASSUMED CRASH]: Telling region {0} @ {1},{2} ({3}) that their agent is dead: {4}",
98 SimInfo.regionName, SimInfo.regionLocX, SimInfo.regionLocY, SimInfo.httpServerURI, theUser.FirstName + " " + theUser.SurName); 102 SimInfo.regionName, SimInfo.regionLocX, SimInfo.regionLocY, SimInfo.httpServerURI, theUser.FirstName + " " + theUser.SurName);
103
99 try 104 try
100 { 105 {
101 XmlRpcRequest GridReq = new XmlRpcRequest("logoff_user", SendParams); 106 XmlRpcRequest GridReq = new XmlRpcRequest("logoff_user", SendParams);
@@ -420,20 +425,12 @@ namespace OpenSim.Grid.UserServer
420 425
421 // See LoginService 426 // See LoginService
422 protected override InventoryData GetInventorySkeleton(LLUUID userID, string serverUrl) 427 protected override InventoryData GetInventorySkeleton(LLUUID userID, string serverUrl)
423 { 428 {
424 string invUrl = m_config.InventoryUrl;
425 //if (!String.IsNullOrEmpty(serverUrl))
426 //{
427 // invUrl = serverUrl+"/";
428 //}
429
430 m_log.DebugFormat( 429 m_log.DebugFormat(
431 "[LOGIN]: Contacting inventory service at {0} for inventory skeleton of user {1}", 430 "[LOGIN]: Contacting inventory service at {0} for inventory skeleton of user {1}",
432 m_config.InventoryUrl, userID); 431 m_config.InventoryUrl, userID);
433 432
434 List<InventoryFolderBase> folders 433 List<InventoryFolderBase> folders = m_inventoryService.GetInventorySkeleton(userID);
435 = SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>(
436 "POST", invUrl + "RootFolders/", userID.UUID);
437 434
438 if (null == folders || folders.Count == 0) 435 if (null == folders || folders.Count == 0)
439 { 436 {
@@ -444,11 +441,7 @@ namespace OpenSim.Grid.UserServer
444 // tools are creating the user profile directly in the database without creating the inventory. At 441 // tools are creating the user profile directly in the database without creating the inventory. At
445 // this time we'll accomodate them by lazily creating the user inventory now if it doesn't already 442 // this time we'll accomodate them by lazily creating the user inventory now if it doesn't already
446 // exist. 443 // exist.
447 bool created = 444 if (!m_inventoryService.CreateNewUserInventory(userID))
448 SynchronousRestObjectPoster.BeginPostObject<Guid, bool>(
449 "POST", invUrl + "CreateInventory/", userID.UUID);
450
451 if (!created)
452 { 445 {
453 throw new Exception( 446 throw new Exception(
454 String.Format( 447 String.Format(
@@ -461,8 +454,7 @@ namespace OpenSim.Grid.UserServer
461 m_log.InfoFormat("[LOGIN]: A new inventory skeleton was successfully created for user {0}", userID); 454 m_log.InfoFormat("[LOGIN]: A new inventory skeleton was successfully created for user {0}", userID);
462 } 455 }
463 456
464 folders = SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>( 457 folders = m_inventoryService.GetInventorySkeleton(userID);
465 "POST", invUrl + "RootFolders/", userID.UUID);
466 } 458 }
467 459
468 if (folders != null && folders.Count > 0) 460 if (folders != null && folders.Count > 0)