From 7f11079f57faacedc2dc8e3f2005b483e7314726 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Fri, 28 Mar 2008 21:43:46 +0000 Subject: * Refactored out common http handler operations --- OpenSim/Grid/InventoryServer/Main.cs | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'OpenSim/Grid/InventoryServer') diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs index 9aa9adc..ea056a0 100644 --- a/OpenSim/Grid/InventoryServer/Main.cs +++ b/OpenSim/Grid/InventoryServer/Main.cs @@ -72,36 +72,42 @@ namespace OpenSim.Grid.InventoryServer m_inventoryService.AddPlugin(m_config.DatabaseProvider); m_log.Info("[" + LogName + "]: Starting HTTP server ..."); - BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort); - httpServer.AddStreamHandler( + + m_httpServer = new BaseHttpServer(m_config.HttpPort); + AddHttpHandlers(); + m_httpServer.Start(); + + m_log.Info("[" + LogName + "]: Started HTTP server"); + } + + protected void AddHttpHandlers() + { + m_httpServer.AddStreamHandler( new RestDeserialisehandler("POST", "/GetInventory/", m_inventoryService.GetUserInventory)); - httpServer.AddStreamHandler( + m_httpServer.AddStreamHandler( new RestDeserialisehandler("POST", "/CreateInventory/", m_inventoryService.CreateUsersInventory)); - httpServer.AddStreamHandler( + m_httpServer.AddStreamHandler( new RestDeserialisehandler("POST", "/NewFolder/", m_inventoryService.AddInventoryFolder)); - httpServer.AddStreamHandler( + m_httpServer.AddStreamHandler( new RestDeserialisehandler("POST", "/MoveFolder/", m_inventoryService.MoveInventoryFolder)); - httpServer.AddStreamHandler( + m_httpServer.AddStreamHandler( new RestDeserialisehandler("POST", "/NewItem/", m_inventoryService.AddInventoryItem)); - httpServer.AddStreamHandler( + m_httpServer.AddStreamHandler( new RestDeserialisehandler("POST", "/DeleteItem/", m_inventoryService.DeleteInvItem)); - httpServer.AddStreamHandler( + m_httpServer.AddStreamHandler( new RestDeserialisehandler>("POST", "/RootFolders/", m_inventoryService.RequestFirstLevelFolders)); // httpServer.AddStreamHandler(new InventoryManager.GetInventory(m_inventoryManager)); - - httpServer.Start(); - m_log.Info("[" + LogName + "]: Started HTTP server"); } private void Work() -- cgit v1.1