Renamed QueryItem/QueryFolder to GetItem/GetFolder. The word 'query' starting to get on my nerves.

arthursv
Diva Canto 2009-08-13 14:10:12 -07:00
parent 6b9cc6c48d
commit 5246dc33dc
21 changed files with 70 additions and 70 deletions

View File

@ -747,7 +747,7 @@ namespace OpenSim.Framework.Communications.Cache
InventoryItemBase itemInfo = null;
itemInfo = m_InventoryService.QueryItem(item);
itemInfo = m_InventoryService.GetItem(item);
if (itemInfo != null)
{
@ -784,7 +784,7 @@ namespace OpenSim.Framework.Communications.Cache
InventoryFolderBase folderInfo = null;
folderInfo = m_InventoryService.QueryFolder(folder);
folderInfo = m_InventoryService.GetFolder(folder);
if (folderInfo != null)
{

View File

@ -186,14 +186,14 @@ namespace OpenSim.Framework.Communications.Tests
Assert.That(
userInfo.CreateFolder("testFolder1", folderId, (ushort)AssetType.Animation, missingFolderId), Is.False);
Assert.That(myScene.InventoryService.QueryFolder(myFolder), Is.Null);
Assert.That(myScene.InventoryService.GetFolder(myFolder), Is.Null);
Assert.That(userInfo.RootFolder.ContainsChildFolder(missingFolderId), Is.False);
Assert.That(userInfo.RootFolder.FindFolder(folderId), Is.Null);
// 2: Try a folder create that should work
Assert.That(
userInfo.CreateFolder("testFolder2", folderId, (ushort)AssetType.Animation, userInfo.RootFolder.ID), Is.True);
Assert.That(myScene.InventoryService.QueryFolder(myFolder), Is.Not.Null);
Assert.That(myScene.InventoryService.GetFolder(myFolder), Is.Not.Null);
Assert.That(userInfo.RootFolder.ContainsChildFolder(folderId), Is.True);
}
@ -228,7 +228,7 @@ namespace OpenSim.Framework.Communications.Tests
Assert.That(newFolderName1, Is.EqualTo(folder1.Name));
Assert.That(folderType1, Is.EqualTo((ushort)folder1.Type));
InventoryFolderBase dataFolder1 = myScene.InventoryService.QueryFolder(myFolder);
InventoryFolderBase dataFolder1 = myScene.InventoryService.GetFolder(myFolder);
Assert.That(newFolderName1, Is.EqualTo(dataFolder1.Name));
Assert.That(folderType1, Is.EqualTo((ushort)dataFolder1.Type));
}
@ -254,7 +254,7 @@ namespace OpenSim.Framework.Communications.Tests
Assert.That(folder2.ContainsChildFolder(folder1Id), Is.True);
Assert.That(rootFolder.ContainsChildFolder(folder1Id), Is.False);
InventoryFolderBase dataFolder1 = myScene.InventoryService.QueryFolder(myFolder2);
InventoryFolderBase dataFolder1 = myScene.InventoryService.GetFolder(myFolder2);
Assert.That(newFolderName2, Is.EqualTo(dataFolder1.Name));
Assert.That(folderType2, Is.EqualTo((ushort)dataFolder1.Type));
Assert.That(folder2Id, Is.EqualTo(dataFolder1.ParentID));
@ -296,7 +296,7 @@ namespace OpenSim.Framework.Communications.Tests
InventoryFolderBase myFolder = new InventoryFolderBase();
myFolder.ID = folderToMoveId;
Assert.That(folder2.ContainsChildFolder(folderToMoveId), Is.True);
Assert.That(myScene.InventoryService.QueryFolder(myFolder).ParentID, Is.EqualTo(folder2Id));
Assert.That(myScene.InventoryService.GetFolder(myFolder).ParentID, Is.EqualTo(folder2Id));
Assert.That(folder1.ContainsChildFolder(folderToMoveId), Is.False);
}
@ -322,13 +322,13 @@ namespace OpenSim.Framework.Communications.Tests
myFolder.ID = folder1Id;
userInfo.CreateFolder("folder1", folder1Id, (ushort)AssetType.Animation, rootFolder.ID);
Assert.That(myScene.InventoryService.QueryFolder(myFolder), Is.Not.Null);
Assert.That(myScene.InventoryService.GetFolder(myFolder), Is.Not.Null);
// Test purge
userInfo.PurgeFolder(rootFolder.ID);
Assert.That(rootFolder.RequestListOfFolders(), Is.Empty);
Assert.That(myScene.InventoryService.QueryFolder(myFolder), Is.Null);
Assert.That(myScene.InventoryService.GetFolder(myFolder), Is.Null);
}
}
}

View File

@ -552,12 +552,12 @@ namespace OpenSim.Framework.Communications.Tests
return false;
}
public InventoryItemBase QueryItem(InventoryItemBase item)
public InventoryItemBase GetItem(InventoryItemBase item)
{
return null;
}
public InventoryFolderBase QueryFolder(InventoryFolderBase folder)
public InventoryFolderBase GetFolder(InventoryFolderBase folder)
{
return null;
}

View File

@ -6611,7 +6611,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
//InventoryItemBase assetRequestItem = userInfo.RootFolder.FindItem(itemID);
IInventoryService invService = m_scene.RequestModuleInterface<IInventoryService>();
InventoryItemBase assetRequestItem = invService.QueryItem(new InventoryItemBase(itemID));
InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(itemID));
if (assetRequestItem == null)
{
assetRequestItem = ((Scene)m_scene).CommsManager.UserProfileCacheService.LibraryRoot.FindItem(itemID);

View File

@ -130,7 +130,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
}
else
{
InventoryItemBase baseItem = invService.QueryItem(new InventoryItemBase(appearance.Wearables[i].ItemID));
InventoryItemBase baseItem = invService.GetItem(new InventoryItemBase(appearance.Wearables[i].ItemID));
if (baseItem != null)
{

View File

@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
{
IInventoryService invService = m_scene.InventoryService;
InventoryItemBase item = invService.QueryItem(new InventoryItemBase(gestureId));
InventoryItemBase item = invService.GetItem(new InventoryItemBase(gestureId));
if (item != null)
{
item.Flags = 1;
@ -80,7 +80,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
{
IInventoryService invService = m_scene.InventoryService;
InventoryItemBase item = invService.QueryItem(new InventoryItemBase(gestureId));
InventoryItemBase item = invService.GetItem(new InventoryItemBase(gestureId));
if (item != null)
{
item.Flags = 0;

View File

@ -258,7 +258,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip
InventoryItemBase item = invService.QueryItem(new InventoryItemBase(inventoryEntityID));
InventoryItemBase item = invService.GetItem(new InventoryItemBase(inventoryEntityID));
InventoryFolderBase folder = null;
if (item != null && trashFolder != null)
@ -271,7 +271,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
}
else
{
folder = invService.QueryFolder(new InventoryFolderBase(inventoryEntityID));
folder = invService.GetFolder(new InventoryFolderBase(inventoryEntityID));
if (folder != null & trashFolder != null)
{
@ -428,7 +428,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
// Fetch from service
//
folder = invService.QueryFolder(folder);
folder = invService.GetFolder(folder);
if (folder == null)
{
m_log.Debug("[INVENTORY TRANSFER] Can't find folder to give");
@ -458,7 +458,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
// Fetch from service
//
item = invService.QueryItem(item);
item = invService.GetItem(item);
if (item == null)
{
m_log.Debug("[INVENTORY TRANSFER] Can't find item to give");

View File

@ -184,9 +184,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
/// <returns>true if the item was successfully deleted</returns>
public abstract bool DeleteItem(InventoryItemBase item);
public abstract InventoryItemBase QueryItem(InventoryItemBase item);
public abstract InventoryItemBase GetItem(InventoryItemBase item);
public abstract InventoryFolderBase QueryFolder(InventoryFolderBase folder);
public abstract InventoryFolderBase GetFolder(InventoryFolderBase folder);
/// <summary>
/// Does the given user have an inventory structure?

View File

@ -387,13 +387,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
}
}
public override InventoryItemBase QueryItem(InventoryItemBase item)
public override InventoryItemBase GetItem(InventoryItemBase item)
{
if (item == null)
return null;
if (IsLocalGridUser(item.Owner))
return m_GridService.QueryItem(item);
return m_GridService.GetItem(item);
else
{
UUID sessionID = GetSessionID(item.Owner);
@ -402,13 +402,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
}
}
public override InventoryFolderBase QueryFolder(InventoryFolderBase folder)
public override InventoryFolderBase GetFolder(InventoryFolderBase folder)
{
if (folder == null)
return null;
if (IsLocalGridUser(folder.Owner))
return m_GridService.QueryFolder(folder);
return m_GridService.GetFolder(folder);
else
{
UUID sessionID = GetSessionID(folder.Owner);

View File

@ -292,14 +292,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
return m_InventoryService.DeleteItem(item);
}
public override InventoryItemBase QueryItem(InventoryItemBase item)
public override InventoryItemBase GetItem(InventoryItemBase item)
{
return m_InventoryService.QueryItem(item);
return m_InventoryService.GetItem(item);
}
public override InventoryFolderBase QueryFolder(InventoryFolderBase folder)
public override InventoryFolderBase GetFolder(InventoryFolderBase folder)
{
return m_InventoryService.QueryFolder(folder);
return m_InventoryService.GetFolder(folder);
}
/// <summary>

View File

@ -273,7 +273,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
return m_RemoteConnector.DeleteItem(item.Owner.ToString(), item, sessionID);
}
public override InventoryItemBase QueryItem(InventoryItemBase item)
public override InventoryItemBase GetItem(InventoryItemBase item)
{
if (item == null)
return null;
@ -282,7 +282,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
return m_RemoteConnector.QueryItem(item.Owner.ToString(), item, sessionID);
}
public override InventoryFolderBase QueryFolder(InventoryFolderBase folder)
public override InventoryFolderBase GetFolder(InventoryFolderBase folder)
{
if (folder == null)
return null;

View File

@ -966,7 +966,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (objectID == UUID.Zero) // User inventory
{
IInventoryService invService = m_scene.InventoryService;
InventoryItemBase assetRequestItem = invService.QueryItem(new InventoryItemBase(notecard));
InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(notecard));
if (assetRequestItem == null) // Library item
{
assetRequestItem = scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard);
@ -1385,7 +1385,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (objectID == UUID.Zero) // User inventory
{
IInventoryService invService = m_scene.InventoryService;
InventoryItemBase assetRequestItem = invService.QueryItem(new InventoryItemBase(script));
InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(script));
if (assetRequestItem == null) // Library item
{
assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(script);
@ -1479,7 +1479,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (objectID == UUID.Zero) // User inventory
{
IInventoryService invService = m_scene.InventoryService;
InventoryItemBase assetRequestItem = invService.QueryItem(new InventoryItemBase(notecard));
InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(notecard));
if (assetRequestItem == null) // Library item
{
assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard);

View File

@ -119,7 +119,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
{
InventoryItemBase item = new InventoryItemBase(itemID);
item.Owner = remoteClient.AgentId;
item = InventoryService.QueryItem(item);
item = InventoryService.GetItem(item);
//if (item == null)
//{ // Fetch the item
// item = new InventoryItemBase();

View File

@ -140,7 +140,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns></returns>
public virtual UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data)
{
InventoryItemBase item = InventoryService.QueryItem(new InventoryItemBase(itemID));
InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID));
if (item != null)
{
@ -315,7 +315,7 @@ namespace OpenSim.Region.Framework.Scenes
public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID,
UUID itemID, InventoryItemBase itemUpd)
{
InventoryItemBase item = InventoryService.QueryItem(new InventoryItemBase(itemID));
InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID));
if (item != null)
{
@ -408,7 +408,7 @@ namespace OpenSim.Region.Framework.Scenes
{
Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem");
InventoryItemBase item = InventoryService.QueryItem(new InventoryItemBase(itemId));
InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemId));
if ((item != null) && (item.Owner == senderId))
{
@ -505,7 +505,7 @@ namespace OpenSim.Region.Framework.Scenes
UUID recipientId, UUID senderId, UUID folderId, UUID recipientParentFolderId)
{
//// Retrieve the folder from the sender
InventoryFolderBase folder = InventoryService.QueryFolder(new InventoryFolderBase(folderId));
InventoryFolderBase folder = InventoryService.GetFolder(new InventoryFolderBase(folderId));
if (null == folder)
{
m_log.ErrorFormat(
@ -558,7 +558,7 @@ namespace OpenSim.Region.Framework.Scenes
if (item == null)
{
item = InventoryService.QueryItem(new InventoryItemBase(oldItemID));
item = InventoryService.GetItem(new InventoryItemBase(oldItemID));
if (item == null)
{
@ -636,7 +636,7 @@ namespace OpenSim.Region.Framework.Scenes
m_log.DebugFormat(
"[AGENT INVENTORY]: Moving item {0} to {1} for {2}", itemID, folderID, remoteClient.AgentId);
InventoryItemBase item = InventoryService.QueryItem(new InventoryItemBase(itemID));
InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID));
if (item != null)
{
@ -1224,7 +1224,7 @@ namespace OpenSim.Region.Framework.Scenes
UUID copyID = UUID.Random();
if (itemID != UUID.Zero)
{
InventoryItemBase item = InventoryService.QueryItem(new InventoryItemBase(itemID));
InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID));
// Try library
if (null == item)
@ -1287,7 +1287,7 @@ namespace OpenSim.Region.Framework.Scenes
if (itemID != UUID.Zero) // transferred from an avatar inventory to the prim's inventory
{
InventoryItemBase item = InventoryService.QueryItem(new InventoryItemBase(itemID));
InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID));
// Try library
// XXX clumsy, possibly should be one call
@ -1673,7 +1673,7 @@ namespace OpenSim.Region.Framework.Scenes
if (DeRezAction.SaveToExistingUserInventoryItem == action)
{
item = new InventoryItemBase(objectGroup.RootPart.FromUserInventoryItemID);
item = InventoryService.QueryItem(item);
item = InventoryService.GetItem(item);
//item = userInfo.RootFolder.FindItem(
// objectGroup.RootPart.FromUserInventoryItemID);
@ -1834,7 +1834,7 @@ namespace OpenSim.Region.Framework.Scenes
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup);
InventoryItemBase item = InventoryService.QueryItem(new InventoryItemBase(itemID));
InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID));
if (item != null)
{
@ -1984,7 +1984,7 @@ namespace OpenSim.Region.Framework.Scenes
BypassRayCast, bRayEndIsIntersection,true,scale, false);
// Rez object
InventoryItemBase item = InventoryService.QueryItem(new InventoryItemBase(itemID));
InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID));
if (item != null)
{

View File

@ -382,7 +382,7 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
InventoryItemBase item = InventoryService.QueryItem(new InventoryItemBase(itemID));
InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID));
if (item != null)
{
@ -516,7 +516,7 @@ namespace OpenSim.Region.Framework.Scenes
public void HandleMoveInventoryFolder(IClientAPI remoteClient, UUID folderID, UUID parentID)
{
InventoryFolderBase folder = new InventoryFolderBase(folderID);
folder = InventoryService.QueryFolder(folder);
folder = InventoryService.GetFolder(folder);
if (folder != null)
{
folder.ParentID = parentID;

View File

@ -1020,11 +1020,11 @@ namespace OpenSim.Region.Framework.Scenes
public bool WaitForCallback(UUID id)
{
int count = 20;
int count = 200;
while (m_agentsInTransit.Contains(id) && count-- > 0)
{
//m_log.Debug(" >>> Waiting... " + count);
Thread.Sleep(1000);
Thread.Sleep(100);
}
if (count > 0)
@ -1141,16 +1141,16 @@ namespace OpenSim.Region.Framework.Scenes
{
pos = pos + (agent.Velocity);
CachedUserInfo userInfo = m_commsProvider.UserProfileCacheService.GetUserDetails(agent.UUID);
if (userInfo != null)
{
userInfo.DropInventory();
}
else
{
m_log.WarnFormat("[SCENE COMM]: No cached user info found for {0} {1} on leaving region {2}",
agent.Name, agent.UUID, agent.Scene.RegionInfo.RegionName);
}
//CachedUserInfo userInfo = m_commsProvider.UserProfileCacheService.GetUserDetails(agent.UUID);
//if (userInfo != null)
//{
// userInfo.DropInventory();
//}
//else
//{
// m_log.WarnFormat("[SCENE COMM]: No cached user info found for {0} {1} on leaving region {2}",
// agent.Name, agent.UUID, agent.Scene.RegionInfo.RegionName);
//}
//bool crossingSuccessful =
// CrossToNeighbouringRegion(neighbourHandle, agent.ControllingClient.AgentId, pos,

View File

@ -110,11 +110,11 @@ namespace OpenSim.Server.Handlers.Inventory
m_httpServer.AddStreamHandler(
new RestDeserialiseSecureHandler<InventoryItemBase, InventoryItemBase>(
"POST", "/QueryItem/", m_InventoryService.QueryItem, CheckAuthSession));
"POST", "/QueryItem/", m_InventoryService.GetItem, CheckAuthSession));
m_httpServer.AddStreamHandler(
new RestDeserialiseSecureHandler<InventoryFolderBase, InventoryFolderBase>(
"POST", "/QueryFolder/", m_InventoryService.QueryFolder, CheckAuthSession));
"POST", "/QueryFolder/", m_InventoryService.GetFolder, CheckAuthSession));
m_httpServer.AddStreamHandler(
new RestDeserialiseTrustedHandler<Guid, bool>(

View File

@ -156,12 +156,12 @@ namespace OpenSim.Services.Connectors
return false;
}
public InventoryItemBase QueryItem(InventoryItemBase item)
public InventoryItemBase GetItem(InventoryItemBase item)
{
return null;
}
public InventoryFolderBase QueryFolder(InventoryFolderBase folder)
public InventoryFolderBase GetFolder(InventoryFolderBase folder)
{
return null;
}

View File

@ -149,9 +149,9 @@ namespace OpenSim.Services.Interfaces
/// <returns>true if the item was successfully deleted</returns>
bool DeleteItem(InventoryItemBase item);
InventoryItemBase QueryItem(InventoryItemBase item);
InventoryItemBase GetItem(InventoryItemBase item);
InventoryFolderBase QueryFolder(InventoryFolderBase folder);
InventoryFolderBase GetFolder(InventoryFolderBase folder);
/// <summary>
/// Does the given user have an inventory structure?

View File

@ -398,7 +398,7 @@ namespace OpenSim.Services.InventoryService
return true;
}
public virtual InventoryItemBase QueryItem(InventoryItemBase item)
public virtual InventoryItemBase GetItem(InventoryItemBase item)
{
InventoryItemBase result = m_Database.queryInventoryItem(item.ID);
if (result != null)
@ -407,7 +407,7 @@ namespace OpenSim.Services.InventoryService
return null;
}
public virtual InventoryFolderBase QueryFolder(InventoryFolderBase item)
public virtual InventoryFolderBase GetFolder(InventoryFolderBase item)
{
InventoryFolderBase result = m_Database.queryInventoryFolder(item.ID);
if (result != null)

View File

@ -148,12 +148,12 @@ namespace OpenSim.Tests.Common.Mock
return false;
}
public InventoryItemBase QueryItem(InventoryItemBase item)
public InventoryItemBase GetItem(InventoryItemBase item)
{
return null;
}
public InventoryFolderBase QueryFolder(InventoryFolderBase folder)
public InventoryFolderBase GetFolder(InventoryFolderBase folder)
{
return null;
}