示例#1
0
 private Dictionary <string, string> GetAssetMetadata(OpenMetaverse.UUID assetId, CloudFilesAssetWorker worker)
 {
     try
     {
         return(worker.GetAssetMetadata(assetId));
     }
     catch (net.openstack.Core.Exceptions.Response.ItemNotFoundException)
     {
         return(null);
     }
 }
示例#2
0
        private Dictionary <string, string> RequestAssetMetadataInternal(OpenMetaverse.UUID assetID)
        {
            Dictionary <string, string> meta = null;

            Util.Retry(2, new List <Type> {
                typeof(UnrecoverableAssetServerException)
            }, () =>
            {
                CloudFilesAssetWorker worker = null;
                try
                {
                    try
                    {
                        //nothing in the cache. request from CF
                        worker = _asyncAssetWorkers.LeaseObject();
                    }
                    catch (Exception e)
                    {
                        //bail out now if we couldn't lease a connection
                        throw new UnrecoverableAssetServerException(e.Message, e);
                    }

                    meta = worker.GetAssetMetadata(assetID);
                }
                catch (net.openstack.Core.Exceptions.Response.ItemNotFoundException)
                {
                    //not an exceptional case. this will happen
                    meta = null;
                }
                finally
                {
                    if (worker != null)
                    {
                        _asyncAssetWorkers.ReturnObject(worker);
                    }
                }
            });

            return(meta);
        }
示例#3
0
 private Dictionary<string, string> GetAssetMetadata(OpenMetaverse.UUID assetId, CloudFilesAssetWorker worker)
 {
     try
     {
         return worker.GetAssetMetadata(assetId);
     }
     catch (net.openstack.Core.Exceptions.Response.ItemNotFoundException)
     {
         return null;
     }
 }