diff options
author | Justin Clarke Casey | 2008-05-01 20:47:33 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-05-01 20:47:33 +0000 |
commit | 1de6cffa28348975a2492ce1e8a85c365df4dfaf (patch) | |
tree | 6431e5598defd603a4b2a8c5020b65d7df5a56a7 /OpenSim/Region/Communications/OGS1 | |
parent | create pass through of UserManagerBase to plugin calls (diff) | |
download | opensim-SC_OLD-1de6cffa28348975a2492ce1e8a85c365df4dfaf.zip opensim-SC_OLD-1de6cffa28348975a2492ce1e8a85c365df4dfaf.tar.gz opensim-SC_OLD-1de6cffa28348975a2492ce1e8a85c365df4dfaf.tar.bz2 opensim-SC_OLD-1de6cffa28348975a2492ce1e8a85c365df4dfaf.tar.xz |
* Refactor: Remove the unused userID parameter that was being passed into almost every inventory method
* This allows lots of redundant inventory methods with only slightly different names to be eliminated.
Diffstat (limited to 'OpenSim/Region/Communications/OGS1')
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs index 8a35519..ba91f14 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs | |||
@@ -154,14 +154,12 @@ namespace OpenSim.Region.Communications.OGS1 | |||
154 | 154 | ||
155 | /// <summary> | 155 | /// <summary> |
156 | /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see> | 156 | /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see> |
157 | /// </summary> | 157 | /// </summary> |
158 | /// <param name="userID"></param> | 158 | public bool AddFolder(InventoryFolderBase folder) |
159 | /// <param name="folder"></param> | ||
160 | public void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder) | ||
161 | { | 159 | { |
162 | try | 160 | try |
163 | { | 161 | { |
164 | SynchronousRestObjectPoster.BeginPostObject<InventoryFolderBase, bool>( | 162 | return SynchronousRestObjectPoster.BeginPostObject<InventoryFolderBase, bool>( |
165 | "POST", _inventoryServerUrl + "/NewFolder/", folder); | 163 | "POST", _inventoryServerUrl + "/NewFolder/", folder); |
166 | } | 164 | } |
167 | catch (WebException e) | 165 | catch (WebException e) |
@@ -169,18 +167,19 @@ namespace OpenSim.Region.Communications.OGS1 | |||
169 | m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Add new inventory folder operation failed, {0} {1}", | 167 | m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Add new inventory folder operation failed, {0} {1}", |
170 | e.Source, e.Message); | 168 | e.Source, e.Message); |
171 | } | 169 | } |
170 | |||
171 | return false; | ||
172 | } | 172 | } |
173 | 173 | ||
174 | /// <summary> | 174 | /// <summary> |
175 | /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see> | 175 | /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see> |
176 | /// </summary> | 176 | /// </summary> |
177 | /// <param name="userID"></param> | ||
178 | /// <param name="folder"></param> | 177 | /// <param name="folder"></param> |
179 | public void MoveInventoryFolder(LLUUID userID, InventoryFolderBase folder) | 178 | public bool MoveFolder(InventoryFolderBase folder) |
180 | { | 179 | { |
181 | try | 180 | try |
182 | { | 181 | { |
183 | SynchronousRestObjectPoster.BeginPostObject<InventoryFolderBase, bool>( | 182 | return SynchronousRestObjectPoster.BeginPostObject<InventoryFolderBase, bool>( |
184 | "POST", _inventoryServerUrl + "/MoveFolder/", folder); | 183 | "POST", _inventoryServerUrl + "/MoveFolder/", folder); |
185 | } | 184 | } |
186 | catch (WebException e) | 185 | catch (WebException e) |
@@ -188,19 +187,18 @@ namespace OpenSim.Region.Communications.OGS1 | |||
188 | m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Move inventory folder operation failed, {0} {1}", | 187 | m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Move inventory folder operation failed, {0} {1}", |
189 | e.Source, e.Message); | 188 | e.Source, e.Message); |
190 | } | 189 | } |
190 | |||
191 | return false; | ||
191 | } | 192 | } |
192 | 193 | ||
193 | /// <summary> | 194 | /// <summary> |
194 | /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see> | 195 | /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see> |
195 | /// </summary> | 196 | /// </summary> |
196 | /// <param name="userID"></param> | 197 | public bool PurgeFolder(InventoryFolderBase folder) |
197 | /// <param name="folder"></param> | ||
198 | /// <returns></returns> | ||
199 | public void PurgeInventoryFolder(LLUUID userID, InventoryFolderBase folder) | ||
200 | { | 198 | { |
201 | try | 199 | try |
202 | { | 200 | { |
203 | SynchronousRestObjectPoster.BeginPostObject<InventoryFolderBase, bool>( | 201 | return SynchronousRestObjectPoster.BeginPostObject<InventoryFolderBase, bool>( |
204 | "POST", _inventoryServerUrl + "/PurgeFolder/", folder); | 202 | "POST", _inventoryServerUrl + "/PurgeFolder/", folder); |
205 | } | 203 | } |
206 | catch (WebException e) | 204 | catch (WebException e) |
@@ -208,33 +206,35 @@ namespace OpenSim.Region.Communications.OGS1 | |||
208 | m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Move inventory folder operation failed, {0} {1}", | 206 | m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Move inventory folder operation failed, {0} {1}", |
209 | e.Source, e.Message); | 207 | e.Source, e.Message); |
210 | } | 208 | } |
209 | |||
210 | return false; | ||
211 | } | 211 | } |
212 | 212 | ||
213 | /// <summary> | 213 | /// <summary> |
214 | /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see> | 214 | /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see> |
215 | /// </summary> | 215 | /// </summary> |
216 | /// <param name="userID"></param> | 216 | public bool AddItem(InventoryItemBase item) |
217 | /// <param name="folder"></param> | ||
218 | public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) | ||
219 | { | 217 | { |
220 | try | 218 | try |
221 | { | 219 | { |
222 | SynchronousRestObjectPoster.BeginPostObject<InventoryItemBase, bool>( | 220 | return SynchronousRestObjectPoster.BeginPostObject<InventoryItemBase, bool>( |
223 | "POST", _inventoryServerUrl + "/NewItem/", item); | 221 | "POST", _inventoryServerUrl + "/NewItem/", item); |
224 | } | 222 | } |
225 | catch (WebException e) | 223 | catch (WebException e) |
226 | { | 224 | { |
227 | m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Add new inventory item operation failed, {0} {1}", | 225 | m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Add new inventory item operation failed, {0} {1}", |
228 | e.Source, e.Message); | 226 | e.Source, e.Message); |
229 | } | 227 | } |
228 | |||
229 | return false; | ||
230 | } | 230 | } |
231 | 231 | ||
232 | // TODO: this is a temporary workaround, the UpdateInventoryItem method need to be implemented | 232 | // TODO: this is a temporary workaround, the UpdateInventoryItem method need to be implemented |
233 | public void UpdateInventoryItem(LLUUID userID, InventoryItemBase item) | 233 | public bool UpdateItem(InventoryItemBase item) |
234 | { | 234 | { |
235 | try | 235 | try |
236 | { | 236 | { |
237 | SynchronousRestObjectPoster.BeginPostObject<InventoryItemBase, bool>( | 237 | return SynchronousRestObjectPoster.BeginPostObject<InventoryItemBase, bool>( |
238 | "POST", _inventoryServerUrl + "/NewItem/", item); | 238 | "POST", _inventoryServerUrl + "/NewItem/", item); |
239 | } | 239 | } |
240 | catch (WebException e) | 240 | catch (WebException e) |
@@ -242,18 +242,18 @@ namespace OpenSim.Region.Communications.OGS1 | |||
242 | m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Update new inventory item operation failed, {0} {1}", | 242 | m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Update new inventory item operation failed, {0} {1}", |
243 | e.Source, e.Message); | 243 | e.Source, e.Message); |
244 | } | 244 | } |
245 | |||
246 | return false; | ||
245 | } | 247 | } |
246 | 248 | ||
247 | /// <summary> | 249 | /// <summary> |
248 | /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see> | 250 | /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see> |
249 | /// </summary> | 251 | /// </summary> |
250 | /// <param name="userID"></param> | 252 | public bool DeleteItem(InventoryItemBase item) |
251 | /// <param name="folder"></param> | ||
252 | public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) | ||
253 | { | 253 | { |
254 | try | 254 | try |
255 | { | 255 | { |
256 | SynchronousRestObjectPoster.BeginPostObject<InventoryItemBase, bool>( | 256 | return SynchronousRestObjectPoster.BeginPostObject<InventoryItemBase, bool>( |
257 | "POST", _inventoryServerUrl + "/DeleteItem/", item); | 257 | "POST", _inventoryServerUrl + "/DeleteItem/", item); |
258 | } | 258 | } |
259 | catch (WebException e) | 259 | catch (WebException e) |
@@ -261,6 +261,8 @@ namespace OpenSim.Region.Communications.OGS1 | |||
261 | m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Delete inventory item operation failed, {0} {1}", | 261 | m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Delete inventory item operation failed, {0} {1}", |
262 | e.Source, e.Message); | 262 | e.Source, e.Message); |
263 | } | 263 | } |
264 | |||
265 | return false; | ||
264 | } | 266 | } |
265 | 267 | ||
266 | public bool HasInventoryForUser(LLUUID userID) | 268 | public bool HasInventoryForUser(LLUUID userID) |