diff options
author | lbsa71 | 2008-03-28 21:43:46 +0000 |
---|---|---|
committer | lbsa71 | 2008-03-28 21:43:46 +0000 |
commit | 7f11079f57faacedc2dc8e3f2005b483e7314726 (patch) | |
tree | 3df97ace353d92cea53fbaaf4063fa9b53c93730 /OpenSim/Grid/InventoryServer | |
parent | * Introduced common abstract UserDataBase provider (diff) | |
download | opensim-SC-7f11079f57faacedc2dc8e3f2005b483e7314726.zip opensim-SC-7f11079f57faacedc2dc8e3f2005b483e7314726.tar.gz opensim-SC-7f11079f57faacedc2dc8e3f2005b483e7314726.tar.bz2 opensim-SC-7f11079f57faacedc2dc8e3f2005b483e7314726.tar.xz |
* Refactored out common http handler operations
Diffstat (limited to 'OpenSim/Grid/InventoryServer')
-rw-r--r-- | OpenSim/Grid/InventoryServer/Main.cs | 28 |
1 files changed, 17 insertions, 11 deletions
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 | |||
72 | m_inventoryService.AddPlugin(m_config.DatabaseProvider); | 72 | m_inventoryService.AddPlugin(m_config.DatabaseProvider); |
73 | 73 | ||
74 | m_log.Info("[" + LogName + "]: Starting HTTP server ..."); | 74 | m_log.Info("[" + LogName + "]: Starting HTTP server ..."); |
75 | BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort); | 75 | |
76 | httpServer.AddStreamHandler( | 76 | m_httpServer = new BaseHttpServer(m_config.HttpPort); |
77 | AddHttpHandlers(); | ||
78 | m_httpServer.Start(); | ||
79 | |||
80 | m_log.Info("[" + LogName + "]: Started HTTP server"); | ||
81 | } | ||
82 | |||
83 | protected void AddHttpHandlers() | ||
84 | { | ||
85 | m_httpServer.AddStreamHandler( | ||
77 | new RestDeserialisehandler<Guid, InventoryCollection>("POST", "/GetInventory/", | 86 | new RestDeserialisehandler<Guid, InventoryCollection>("POST", "/GetInventory/", |
78 | m_inventoryService.GetUserInventory)); | 87 | m_inventoryService.GetUserInventory)); |
79 | httpServer.AddStreamHandler( | 88 | m_httpServer.AddStreamHandler( |
80 | new RestDeserialisehandler<Guid, bool>("POST", "/CreateInventory/", | 89 | new RestDeserialisehandler<Guid, bool>("POST", "/CreateInventory/", |
81 | m_inventoryService.CreateUsersInventory)); | 90 | m_inventoryService.CreateUsersInventory)); |
82 | httpServer.AddStreamHandler( | 91 | m_httpServer.AddStreamHandler( |
83 | new RestDeserialisehandler<InventoryFolderBase, bool>("POST", "/NewFolder/", | 92 | new RestDeserialisehandler<InventoryFolderBase, bool>("POST", "/NewFolder/", |
84 | m_inventoryService.AddInventoryFolder)); | 93 | m_inventoryService.AddInventoryFolder)); |
85 | 94 | ||
86 | httpServer.AddStreamHandler( | 95 | m_httpServer.AddStreamHandler( |
87 | new RestDeserialisehandler<InventoryFolderBase, bool>("POST", "/MoveFolder/", | 96 | new RestDeserialisehandler<InventoryFolderBase, bool>("POST", "/MoveFolder/", |
88 | m_inventoryService.MoveInventoryFolder)); | 97 | m_inventoryService.MoveInventoryFolder)); |
89 | 98 | ||
90 | httpServer.AddStreamHandler( | 99 | m_httpServer.AddStreamHandler( |
91 | new RestDeserialisehandler<InventoryItemBase, bool>("POST", "/NewItem/", | 100 | new RestDeserialisehandler<InventoryItemBase, bool>("POST", "/NewItem/", |
92 | m_inventoryService.AddInventoryItem)); | 101 | m_inventoryService.AddInventoryItem)); |
93 | httpServer.AddStreamHandler( | 102 | m_httpServer.AddStreamHandler( |
94 | new RestDeserialisehandler<InventoryItemBase, bool>("POST", "/DeleteItem/", | 103 | new RestDeserialisehandler<InventoryItemBase, bool>("POST", "/DeleteItem/", |
95 | m_inventoryService.DeleteInvItem)); | 104 | m_inventoryService.DeleteInvItem)); |
96 | 105 | ||
97 | httpServer.AddStreamHandler( | 106 | m_httpServer.AddStreamHandler( |
98 | new RestDeserialisehandler<Guid, List<InventoryFolderBase>>("POST", "/RootFolders/", | 107 | new RestDeserialisehandler<Guid, List<InventoryFolderBase>>("POST", "/RootFolders/", |
99 | m_inventoryService.RequestFirstLevelFolders)); | 108 | m_inventoryService.RequestFirstLevelFolders)); |
100 | 109 | ||
101 | // httpServer.AddStreamHandler(new InventoryManager.GetInventory(m_inventoryManager)); | 110 | // httpServer.AddStreamHandler(new InventoryManager.GetInventory(m_inventoryManager)); |
102 | |||
103 | httpServer.Start(); | ||
104 | m_log.Info("[" + LogName + "]: Started HTTP server"); | ||
105 | } | 111 | } |
106 | 112 | ||
107 | private void Work() | 113 | private void Work() |