OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Protected Attributes | List of all members
OpenSim.Services.FSAssetService.FSAssetConnector Class Reference
Inheritance diagram for OpenSim.Services.FSAssetService.FSAssetConnector:
Inheritance graph
[legend]
Collaboration diagram for OpenSim.Services.FSAssetService.FSAssetConnector:
Collaboration graph
[legend]

Public Member Functions

 FSAssetConnector (IConfigSource config)
 
 FSAssetConnector (IConfigSource config, string configName)
 
string HashToPath (string hash)
 
virtual bool[] AssetsExist (string[] ids)
 Check if assets exist in the database. More...
 
string HashToFile (string hash)
 
virtual AssetBase Get (string id)
 Get an asset synchronously. More...
 
virtual AssetMetadata GetMetadata (string id)
 Get an asset's metadata More...
 
virtual byte[] GetData (string id)
 Get an asset's data, ignoring the metadata. More...
 
bool Get (string id, Object sender, AssetRetrieved handler)
 Get an asset synchronously or asynchronously (depending on whether it is locally cached) and fire a callback with the fetched asset More...
 
byte[] GetFsData (string hash)
 
virtual string Store (AssetBase asset)
 Creates a new asset More...
 
bool UpdateContent (string id, byte[] data)
 Update an asset's content More...
 
virtual bool Delete (string id)
 Delete an asset More...
 
AssetBase GetCached (string id)
 Synchronously fetches an asset from the local cache only. More...
 
- Public Member Functions inherited from OpenSim.Services.Base.ServiceBase
LoadPlugin< T > (string dllName)
 
LoadPlugin< T > (string dllName, Object[] args)
 
LoadPlugin< T > (string dllName, string className, Object[] args)
 
 ServiceBase (IConfigSource config)
 

Protected Attributes

IAssetLoader m_AssetLoader = null
 
IFSAssetDataPlugin m_DataConnector = null
 
IAssetService m_FallbackService
 
Thread m_WriterThread
 
Thread m_StatsThread
 
string m_SpoolDirectory
 
object m_readLock = new object()
 
object m_statsLock = new object()
 
int m_readCount = 0
 
int m_readTicks = 0
 
int m_missingAssets = 0
 
int m_missingAssetsFS = 0
 
string m_FSBase
 
bool m_useOsgridFormat = false
 

Detailed Description

Definition at line 50 of file FSAssetService.cs.

Constructor & Destructor Documentation

OpenSim.Services.FSAssetService.FSAssetConnector.FSAssetConnector ( IConfigSource  config)
inline

Definition at line 84 of file FSAssetService.cs.

OpenSim.Services.FSAssetService.FSAssetConnector.FSAssetConnector ( IConfigSource  config,
string  configName 
)
inline

Definition at line 89 of file FSAssetService.cs.

Member Function Documentation

virtual bool [] OpenSim.Services.FSAssetService.FSAssetConnector.AssetsExist ( string[]  ids)
inlinevirtual

Check if assets exist in the database.

Parameters
idsThe assets' IDs
Returns
For each asset: true if it exists, false otherwise

Implements OpenSim.Services.Interfaces.IAssetService.

Definition at line 397 of file FSAssetService.cs.

virtual bool OpenSim.Services.FSAssetService.FSAssetConnector.Delete ( string  id)
inlinevirtual

Delete an asset

Parameters
id
Returns

Implements OpenSim.Services.Interfaces.IAssetService.

Reimplemented in OpenSim.Services.HypergridService.HGFSAssetService.

Definition at line 684 of file FSAssetService.cs.

virtual AssetBase OpenSim.Services.FSAssetService.FSAssetConnector.Get ( string  id)
inlinevirtual

Get an asset synchronously.

Parameters
id
Returns

Implements OpenSim.Services.Interfaces.IAssetService.

Reimplemented in OpenSim.Services.HypergridService.HGFSAssetService.

Definition at line 408 of file FSAssetService.cs.

bool OpenSim.Services.FSAssetService.FSAssetConnector.Get ( string  id,
Object  sender,
AssetRetrieved  handler 
)
inline

Get an asset synchronously or asynchronously (depending on whether it is locally cached) and fire a callback with the fetched asset

Parameters
idThe asset id
senderRepresents the requester. Passed back via the handler
handlerThe handler to call back once the asset has been retrieved. This will be called back with a null AssetBase if the asset could not be found for some reason (e.g. if it does not exist, if a remote asset service was not contactable, if it is not in the database, etc.).
Returns
True if the id was parseable, false otherwise

Implements OpenSim.Services.Interfaces.IAssetService.

Definition at line 527 of file FSAssetService.cs.

AssetBase OpenSim.Services.FSAssetService.FSAssetConnector.GetCached ( string  id)
inline

Synchronously fetches an asset from the local cache only.

Parameters
idAsset ID
Returns
The fetched asset, or null if it did not exist in the local cache

Implements OpenSim.Services.Interfaces.IAssetService.

Definition at line 793 of file FSAssetService.cs.

virtual byte [] OpenSim.Services.FSAssetService.FSAssetConnector.GetData ( string  id)
inlinevirtual

Get an asset's data, ignoring the metadata.

Parameters
id
Returns
null if there is no such asset

Implements OpenSim.Services.Interfaces.IAssetService.

Reimplemented in OpenSim.Services.HypergridService.HGFSAssetService.

Definition at line 518 of file FSAssetService.cs.

byte [] OpenSim.Services.FSAssetService.FSAssetConnector.GetFsData ( string  hash)
inline

Definition at line 536 of file FSAssetService.cs.

virtual AssetMetadata OpenSim.Services.FSAssetService.FSAssetConnector.GetMetadata ( string  id)
inlinevirtual

Get an asset's metadata

Parameters
id
Returns

Implements OpenSim.Services.Interfaces.IAssetService.

Reimplemented in OpenSim.Services.HypergridService.HGFSAssetService.

Definition at line 512 of file FSAssetService.cs.

string OpenSim.Services.FSAssetService.FSAssetConnector.HashToFile ( string  hash)
inline

Definition at line 403 of file FSAssetService.cs.

string OpenSim.Services.FSAssetService.FSAssetConnector.HashToPath ( string  hash)
inline

Definition at line 358 of file FSAssetService.cs.

virtual string OpenSim.Services.FSAssetService.FSAssetConnector.Store ( AssetBase  asset)
inlinevirtual

Creates a new asset

Returns a random ID if none is passed via the asset argument.

Parameters
asset
Returns
The Asset ID, or string.Empty if an error occurred

Implements OpenSim.Services.Interfaces.IAssetService.

Reimplemented in OpenSim.Services.HypergridService.HGFSAssetService.

Definition at line 599 of file FSAssetService.cs.

bool OpenSim.Services.FSAssetService.FSAssetConnector.UpdateContent ( string  id,
byte[]  data 
)
inline

Update an asset's content

Attachments and bare scripts need this!!

Parameters
id
data
Returns

Implements OpenSim.Services.Interfaces.IAssetService.

Definition at line 665 of file FSAssetService.cs.

Member Data Documentation

IAssetLoader OpenSim.Services.FSAssetService.FSAssetConnector.m_AssetLoader = null
protected

Definition at line 66 of file FSAssetService.cs.

IFSAssetDataPlugin OpenSim.Services.FSAssetService.FSAssetConnector.m_DataConnector = null
protected

Definition at line 67 of file FSAssetService.cs.

IAssetService OpenSim.Services.FSAssetService.FSAssetConnector.m_FallbackService
protected

Definition at line 68 of file FSAssetService.cs.

string OpenSim.Services.FSAssetService.FSAssetConnector.m_FSBase
protected

Definition at line 78 of file FSAssetService.cs.

int OpenSim.Services.FSAssetService.FSAssetConnector.m_missingAssets = 0
protected

Definition at line 76 of file FSAssetService.cs.

int OpenSim.Services.FSAssetService.FSAssetConnector.m_missingAssetsFS = 0
protected

Definition at line 77 of file FSAssetService.cs.

int OpenSim.Services.FSAssetService.FSAssetConnector.m_readCount = 0
protected

Definition at line 74 of file FSAssetService.cs.

object OpenSim.Services.FSAssetService.FSAssetConnector.m_readLock = new object()
protected

Definition at line 72 of file FSAssetService.cs.

int OpenSim.Services.FSAssetService.FSAssetConnector.m_readTicks = 0
protected

Definition at line 75 of file FSAssetService.cs.

string OpenSim.Services.FSAssetService.FSAssetConnector.m_SpoolDirectory
protected

Definition at line 71 of file FSAssetService.cs.

object OpenSim.Services.FSAssetService.FSAssetConnector.m_statsLock = new object()
protected

Definition at line 73 of file FSAssetService.cs.

Thread OpenSim.Services.FSAssetService.FSAssetConnector.m_StatsThread
protected

Definition at line 70 of file FSAssetService.cs.

bool OpenSim.Services.FSAssetService.FSAssetConnector.m_useOsgridFormat = false
protected

Definition at line 79 of file FSAssetService.cs.

Thread OpenSim.Services.FSAssetService.FSAssetConnector.m_WriterThread
protected

Definition at line 69 of file FSAssetService.cs.


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