org.jdesktop.wonderland.client.assetmgr
Class AssetRepositoryFactory

java.lang.Object
  extended by org.jdesktop.wonderland.client.assetmgr.AssetRepositoryFactory
Direct Known Subclasses:
ModuleAssetRepositoryFactory, WlContentAssetRepositoryFactory, WlHttpAssetRepositoryFactory

public abstract class AssetRepositoryFactory
extends java.lang.Object

The AssetRepositoryFactory class is an abstract base class that is used by the Asset Manager to fetch a list of repositories from which to attempt to download an asset. This class returns an ordered list of asset repositories to try.

This class is typically extended to support loading assets from a particular kind of location. For example, this class is subclassed to load assets from modules on a server, or from HTTP URLs over the network

Author:
Jordan Slott

Field Summary
protected  boolean isAlwaysDownload
           
protected static java.util.logging.Logger logger
           
 
Constructor Summary
AssetRepositoryFactory(AssetURI assetURI)
          Constructor that takes the AssetURI to be downloaded
 
Method Summary
abstract  AssetRepository[] getAssetRepositories()
          Returns an ordered list of AssetRepository objects that can be used to fetch assets.
 AssetURI getAssetURI()
          Returns the asset URI to download using this factory.
abstract  java.lang.String getDesiredChecksum()
          Returns the desired checksum information of the asset.
 boolean isAlwaysDownload()
          Returns true if the asset should always be attempted to be re-downloaded even if there is a loaded asset with the desired checksum.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static java.util.logging.Logger logger

isAlwaysDownload

protected boolean isAlwaysDownload
Constructor Detail

AssetRepositoryFactory

public AssetRepositoryFactory(AssetURI assetURI)
Constructor that takes the AssetURI to be downloaded

Method Detail

getAssetURI

public AssetURI getAssetURI()
Returns the asset URI to download using this factory.

Returns:
An AssetURI object

isAlwaysDownload

public boolean isAlwaysDownload()
Returns true if the asset should always be attempted to be re-downloaded even if there is a loaded asset with the desired checksum. This is used in cases such as HTTP if-modified-since where the only way to tell whether we have the latest version is to actually open up the URL and find out.

Note that if it turns out the Asset Manager really does have the latest, it will not re-download the bits.

Returns:
True if the asset should be downloaded even if we think we have the latest

getDesiredChecksum

public abstract java.lang.String getDesiredChecksum()
Returns the desired checksum information of the asset. The "desired" checksum is a String that describes the "version" of the asset that should be downloaded. The "version" can be an actual checksum or it can be an HTTP if-modified-since value.

Returns:
The desired checksum of the asset

getAssetRepositories

public abstract AssetRepository[] getAssetRepositories()
Returns an ordered list of AssetRepository objects that can be used to fetch assets.

Parameters:
An - array of AssetRepository objects


Open Wonderland - http://openwonderland.org