OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest Class Reference
Collaboration diagram for OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest:
Collaboration graph
[legend]

Public Member Functions

 InventoryArchiveReadRequest (IInventoryService inv, IAssetService assets, IUserAccountService uacc, UserAccount userInfo, string invPath, string loadPath, bool merge)
 
 InventoryArchiveReadRequest (UUID id, InventoryArchiverModule module, IInventoryService inv, IAssetService assets, IUserAccountService uacc, UserAccount userInfo, string invPath, string loadPath, bool merge)
 
 InventoryArchiveReadRequest (UUID id, InventoryArchiverModule module, IInventoryService inv, IAssetService assets, IUserAccountService uacc, UserAccount userInfo, string invPath, Stream loadStream, bool merge)
 
HashSet< InventoryNodeBaseExecute ()
 Execute the request More...
 
void Close ()
 
InventoryFolderBase ReplicateArchivePathToUserInventory (string iarPath, InventoryFolderBase rootDestFolder, Dictionary< string, InventoryFolderBase > resolvedFolders, HashSet< InventoryNodeBase > loadedNodes)
 Replicate the inventory paths in the archive to the user's inventory as necessary. More...
 
void LoadControlFile (string path, byte[] data)
 Load control file More...
 

Static Public Attributes

static int MAX_MAJOR_VERSION = 1
 The maximum major version of archive that we can read. Minor versions shouldn't need a max number since version bumps here should be compatible. More...
 

Protected Member Functions

InventoryFolderBase ResolveDestinationFolder (InventoryFolderBase rootDestFolder, ref string archivePath, Dictionary< string, InventoryFolderBase > resolvedFolders)
 Resolve a destination folder More...
 
void CreateFoldersForPath (InventoryFolderBase destFolder, string iarPathExisting, string iarPathToReplicate, Dictionary< string, InventoryFolderBase > resolvedFolders, HashSet< InventoryNodeBase > loadedNodes)
 Create a set of folders for the given path. More...
 
InventoryItemBase LoadItem (byte[] data, InventoryFolderBase loadFolder)
 Load an item from the archive More...
 
void LoadInventoryFile (string path, TarArchiveReader.TarEntryType entryType, byte[] data)
 Load inventory file More...
 
void LoadAssetFile (string path, byte[] data)
 Load asset file More...
 

Protected Attributes

TarArchiveReader archive
 
UUID m_id
 
bool m_merge
 Do we want to merge this load with existing inventory? More...
 
IInventoryService m_InventoryService
 
IAssetService m_AssetService
 
IUserAccountService m_UserAccountService
 
bool m_assetsLoaded
 
bool m_inventoryNodesLoaded
 
int m_successfulAssetRestores
 
int m_failedAssetRestores
 
int m_successfulItemRestores
 
InventoryFolderBase m_rootDestinationFolder
 Root destination folder for the IAR load. More...
 
HashSet< InventoryNodeBasem_loadedNodes = new HashSet<InventoryNodeBase>()
 Inventory nodes loaded from the iar. More...
 
Dictionary< UUID, UUID > m_creatorIdForAssetId = new Dictionary<UUID, UUID>()
 Record the creator id that should be associated with an asset. This is used to adjust asset creator ids after OSP resolution (since OSP creators are only stored in the item More...
 

Properties

bool ControlFileLoaded [get, set]
 Has the control file been loaded for this archive? More...
 
bool EnforceControlFileCheck [get, set]
 Do we want to enforce the check. IAR versions before 0.2 and 1.1 do not guarantee this order, so we can't enforce. More...
 

Detailed Description

Definition at line 50 of file InventoryArchiveReadRequest.cs.

Constructor & Destructor Documentation

OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.InventoryArchiveReadRequest ( IInventoryService  inv,
IAssetService  assets,
IUserAccountService  uacc,
UserAccount  userInfo,
string  invPath,
string  loadPath,
bool  merge 
)
inline

Definition at line 126 of file InventoryArchiveReadRequest.cs.

OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.InventoryArchiveReadRequest ( UUID  id,
InventoryArchiverModule  module,
IInventoryService  inv,
IAssetService  assets,
IUserAccountService  uacc,
UserAccount  userInfo,
string  invPath,
string  loadPath,
bool  merge 
)
inline

Definition at line 139 of file InventoryArchiveReadRequest.cs.

OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.InventoryArchiveReadRequest ( UUID  id,
InventoryArchiverModule  module,
IInventoryService  inv,
IAssetService  assets,
IUserAccountService  uacc,
UserAccount  userInfo,
string  invPath,
Stream  loadStream,
bool  merge 
)
inline

Definition at line 154 of file InventoryArchiveReadRequest.cs.

Member Function Documentation

void OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.Close ( )
inline

Definition at line 251 of file InventoryArchiveReadRequest.cs.

void OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.CreateFoldersForPath ( InventoryFolderBase  destFolder,
string  iarPathExisting,
string  iarPathToReplicate,
Dictionary< string, InventoryFolderBase resolvedFolders,
HashSet< InventoryNodeBase loadedNodes 
)
inlineprotected

Create a set of folders for the given path.

Parameters
destFolderThe root folder from which the creation will take place.
iarPathExistingthe part of the iar path that already exists
iarPathToReplicateThe path to replicate in the user's inventory from iar
resolvedFoldersThe folders that we have resolved so far for a given archive path.
loadedNodesTrack the inventory nodes created.

Definition at line 390 of file InventoryArchiveReadRequest.cs.

HashSet<InventoryNodeBase> OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.Execute ( )
inline

Execute the request

Only call this once. To load another IAR, construct another request object.

Returns
A list of the inventory nodes loaded. If folders were loaded then only the root folders are returned
Exceptions
System.ExceptionThrown if load fails.

Definition at line 184 of file InventoryArchiveReadRequest.cs.

Here is the caller graph for this function:

void OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.LoadAssetFile ( string  path,
byte[]  data 
)
inlineprotected

Load asset file

Parameters
path
data

Definition at line 637 of file InventoryArchiveReadRequest.cs.

void OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.LoadControlFile ( string  path,
byte[]  data 
)
inline

Load control file

Parameters
path
data

Definition at line 564 of file InventoryArchiveReadRequest.cs.

void OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.LoadInventoryFile ( string  path,
TarArchiveReader.TarEntryType  entryType,
byte[]  data 
)
inlineprotected

Load inventory file

Parameters
path
entryType
data

Definition at line 590 of file InventoryArchiveReadRequest.cs.

InventoryItemBase OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.LoadItem ( byte[]  data,
InventoryFolderBase  loadFolder 
)
inlineprotected

Load an item from the archive

Parameters
filePathThe archive path for the item
dataThe raw item data
rootDestinationFolderThe root destination folder for loaded items
nodesLoadedAll the inventory nodes (items and folders) loaded so far

Definition at line 438 of file InventoryArchiveReadRequest.cs.

InventoryFolderBase OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.ReplicateArchivePathToUserInventory ( string  iarPath,
InventoryFolderBase  rootDestFolder,
Dictionary< string, InventoryFolderBase resolvedFolders,
HashSet< InventoryNodeBase loadedNodes 
)
inline

Replicate the inventory paths in the archive to the user's inventory as necessary.

Parameters
iarPathThe item archive path to replicate
rootDestinationFolderThe root folder for the inventory load
resolvedFoldersThe folders that we have resolved so far for a given archive path. This method will add more folders if necessary
loadedNodesTrack the inventory nodes created.
Returns
The last user inventory folder created or found for the archive path

Definition at line 270 of file InventoryArchiveReadRequest.cs.

InventoryFolderBase OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.ResolveDestinationFolder ( InventoryFolderBase  rootDestFolder,
ref string  archivePath,
Dictionary< string, InventoryFolderBase resolvedFolders 
)
inlineprotected

Resolve a destination folder

We require here a root destination folder (usually the root of the user's inventory) and the archive path. We also pass in a list of previously resolved folders in case we've found this one previously.

Parameters
archivePathThe item archive path to resolve. The portion of the path passed back is that which corresponds to the resolved desintation folder.
Parameters
rootDestinationFolderThe root folder for the inventory load
resolvedFoldersThe folders that we have resolved so far for a given archive path.
Returns
The folder in the user's inventory that matches best the archive path given. If no such folder was found then the passed in root destination folder is returned.

Definition at line 314 of file InventoryArchiveReadRequest.cs.

Member Data Documentation

TarArchiveReader OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.archive
protected

Definition at line 60 of file InventoryArchiveReadRequest.cs.

IAssetService OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.m_AssetService
protected

Definition at line 76 of file InventoryArchiveReadRequest.cs.

bool OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.m_assetsLoaded
protected

Definition at line 97 of file InventoryArchiveReadRequest.cs.

Dictionary<UUID, UUID> OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.m_creatorIdForAssetId = new Dictionary<UUID, UUID>()
protected

Record the creator id that should be associated with an asset. This is used to adjust asset creator ids after OSP resolution (since OSP creators are only stored in the item

Definition at line 124 of file InventoryArchiveReadRequest.cs.

int OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.m_failedAssetRestores
protected

Definition at line 101 of file InventoryArchiveReadRequest.cs.

UUID OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.m_id
protected

ID of this request

Definition at line 68 of file InventoryArchiveReadRequest.cs.

bool OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.m_inventoryNodesLoaded
protected

Definition at line 98 of file InventoryArchiveReadRequest.cs.

IInventoryService OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.m_InventoryService
protected

Definition at line 75 of file InventoryArchiveReadRequest.cs.

HashSet<InventoryNodeBase> OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.m_loadedNodes = new HashSet<InventoryNodeBase>()
protected

Inventory nodes loaded from the iar.

Definition at line 112 of file InventoryArchiveReadRequest.cs.

bool OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.m_merge
protected

Do we want to merge this load with existing inventory?

Definition at line 73 of file InventoryArchiveReadRequest.cs.

InventoryFolderBase OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.m_rootDestinationFolder
protected

Root destination folder for the IAR load.

Definition at line 107 of file InventoryArchiveReadRequest.cs.

int OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.m_successfulAssetRestores
protected

Definition at line 100 of file InventoryArchiveReadRequest.cs.

int OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.m_successfulItemRestores
protected

Definition at line 102 of file InventoryArchiveReadRequest.cs.

IUserAccountService OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.m_UserAccountService
protected

Definition at line 77 of file InventoryArchiveReadRequest.cs.

int OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.MAX_MAJOR_VERSION = 1
static

The maximum major version of archive that we can read. Minor versions shouldn't need a max number since version bumps here should be compatible.

Definition at line 58 of file InventoryArchiveReadRequest.cs.

Property Documentation

bool OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.ControlFileLoaded
getset

Has the control file been loaded for this archive?

Definition at line 89 of file InventoryArchiveReadRequest.cs.

bool OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.InventoryArchiveReadRequest.EnforceControlFileCheck
getset

Do we want to enforce the check. IAR versions before 0.2 and 1.1 do not guarantee this order, so we can't enforce.

Definition at line 95 of file InventoryArchiveReadRequest.cs.


The documentation for this class was generated from the following file: