aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs32
1 files changed, 28 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 9963521..2730b3f 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -61,6 +61,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
61 61
62 private UserAccount m_userInfo; 62 private UserAccount m_userInfo;
63 private string m_invPath; 63 private string m_invPath;
64
65 /// <value>
66 /// ID of this request
67 /// </value>
68 protected UUID m_id;
64 69
65 /// <summary> 70 /// <summary>
66 /// Do we want to merge this load with existing inventory? 71 /// Do we want to merge this load with existing inventory?
@@ -71,6 +76,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
71 protected IAssetService m_AssetService; 76 protected IAssetService m_AssetService;
72 protected IUserAccountService m_UserAccountService; 77 protected IUserAccountService m_UserAccountService;
73 78
79 private InventoryArchiverModule m_module;
80
74 /// <value> 81 /// <value>
75 /// The stream from which the inventory archive will be loaded. 82 /// The stream from which the inventory archive will be loaded.
76 /// </value> 83 /// </value>
@@ -117,9 +124,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
117 protected Dictionary<UUID, UUID> m_creatorIdForAssetId = new Dictionary<UUID, UUID>(); 124 protected Dictionary<UUID, UUID> m_creatorIdForAssetId = new Dictionary<UUID, UUID>();
118 125
119 public InventoryArchiveReadRequest( 126 public InventoryArchiveReadRequest(
120 IInventoryService inv, IAssetService assets, IUserAccountService uacc, UserAccount userInfo, string invPath, string loadPath, bool merge) 127 UUID id, IInventoryService inv, InventoryArchiverModule module, IAssetService assets, IUserAccountService uacc, UserAccount userInfo, string invPath, string loadPath, bool merge)
121 : this( 128 : this(
129 id,
122 inv, 130 inv,
131 module,
123 assets, 132 assets,
124 uacc, 133 uacc,
125 userInfo, 134 userInfo,
@@ -130,8 +139,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
130 } 139 }
131 140
132 public InventoryArchiveReadRequest( 141 public InventoryArchiveReadRequest(
133 IInventoryService inv, IAssetService assets, IUserAccountService uacc, UserAccount userInfo, string invPath, Stream loadStream, bool merge) 142 UUID id, IInventoryService inv, InventoryArchiverModule module, IAssetService assets, IUserAccountService uacc, UserAccount userInfo, string invPath, Stream loadStream, bool merge)
134 { 143 {
144 m_id = id;
135 m_InventoryService = inv; 145 m_InventoryService = inv;
136 m_AssetService = assets; 146 m_AssetService = assets;
137 m_UserAccountService = uacc; 147 m_UserAccountService = uacc;
@@ -139,6 +149,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
139 m_userInfo = userInfo; 149 m_userInfo = userInfo;
140 m_invPath = invPath; 150 m_invPath = invPath;
141 m_loadStream = loadStream; 151 m_loadStream = loadStream;
152 m_module = module;
142 153
143 // FIXME: Do not perform this check since older versions of OpenSim do save the control file after other things 154 // FIXME: Do not perform this check since older versions of OpenSim do save the control file after other things
144 // (I thought they weren't). We will need to bump the version number and perform this check on all 155 // (I thought they weren't). We will need to bump the version number and perform this check on all
@@ -161,6 +172,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
161 { 172 {
162 try 173 try
163 { 174 {
175 Exception reportedException = null;
176
164 string filePath = "ERROR"; 177 string filePath = "ERROR";
165 178
166 List<InventoryFolderBase> folderCandidates 179 List<InventoryFolderBase> folderCandidates
@@ -197,14 +210,25 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
197 } 210 }
198 211
199 archive.Close(); 212 archive.Close();
200 213
201 m_log.DebugFormat( 214 m_log.DebugFormat(
202 "[INVENTORY ARCHIVER]: Successfully loaded {0} assets with {1} failures", 215 "[INVENTORY ARCHIVER]: Successfully loaded {0} assets with {1} failures",
203 m_successfulAssetRestores, m_failedAssetRestores); 216 m_successfulAssetRestores, m_failedAssetRestores);
204 m_log.InfoFormat("[INVENTORY ARCHIVER]: Successfully loaded {0} items", m_successfulItemRestores); 217
218 //Alicia: When this is called by LibraryModule or Tests, m_module will be null as event is not required
219 if(m_module != null)
220 m_module.TriggerInventoryArchiveLoaded(m_id, true, m_userInfo, m_invPath, m_loadStream, reportedException, m_successfulItemRestores);
205 221
206 return m_loadedNodes; 222 return m_loadedNodes;
207 } 223 }
224 catch(Exception Ex)
225 {
226 // Trigger saved event with failed result and exception data
227 if (m_module != null)
228 m_module.TriggerInventoryArchiveLoaded(m_id, false, m_userInfo, m_invPath, m_loadStream, Ex, 0);
229
230 return m_loadedNodes;
231 }
208 finally 232 finally
209 { 233 {
210 m_loadStream.Close(); 234 m_loadStream.Close();