info.magnolia.dam.api
Interface AssetProviderRegistry


public interface AssetProviderRegistry

Entry point to retrieve AssetProviders.


Nested Class Summary
static class AssetProviderRegistry.NoSuchAssetProviderException
          Thrown when no AssetProvider can be found for the given ItemKey or String id.
static class AssetProviderRegistry.NoSuchAssetRendererException
          Thrown when no AssetRenderer can be found for the given Asset to be converted to the given MediaType.
 
Method Summary
 Iterator<AssetProvider> getAllProviders()
           
 AssetProvider getProviderById(String providerId)
           
 AssetProvider getProviderFor(ItemKey itemKey)
          TODO The below is currently not implemented/implementable, we'd need a canHandle(ItemKey) method on providers Returns the first provider that declares it can handle this key.
 Iterator<AssetProvider> getProvidersFor(com.google.common.net.MediaType... mediaTypes)
          Returns a Iterator of AssetProvider that support the requested mediaTypes; returns an empty Iterator if none.
 AssetRenderer getRendererFor(Asset asset, com.google.common.net.MediaType to)
          Returns an appropriate AssetRenderer, or null if there is none.
 

Method Detail

getAllProviders

Iterator<AssetProvider> getAllProviders()

getProvidersFor

Iterator<AssetProvider> getProvidersFor(com.google.common.net.MediaType... mediaTypes)
Returns a Iterator of AssetProvider that support the requested mediaTypes; returns an empty Iterator if none. TODO - getProviders(Predicate) instead ? (might have a predicate for metadata...)


getProviderFor

AssetProvider getProviderFor(ItemKey itemKey)
                             throws AssetProviderRegistry.NoSuchAssetProviderException
TODO The below is currently not implemented/implementable, we'd need a canHandle(ItemKey) method on providers Returns the first provider that declares it can handle this key.

Throws:
AssetProviderRegistry.NoSuchAssetProviderException

getProviderById

AssetProvider getProviderById(String providerId)
                              throws AssetProviderRegistry.NoSuchAssetProviderException
Throws:
AssetProviderRegistry.NoSuchAssetProviderException

getRendererFor

AssetRenderer getRendererFor(Asset asset,
                             com.google.common.net.MediaType to)
                             throws AssetProviderRegistry.NoSuchAssetRendererException
Returns an appropriate AssetRenderer, or null if there is none. First checks if the asset's provider has a specific AssetRenderer, and if not checks in a "global" registry.

Throws:
AssetProviderRegistry.NoSuchAssetRendererException


Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.