com.fatwire.assetapi.data
Class CSElementReadStrategy

java.lang.Object
  extended by com.fatwire.assetapi.data.CSElementReadStrategy
All Implemented Interfaces:
AssetDataReadStrategy

public final class CSElementReadStrategy
extends java.lang.Object
implements AssetDataReadStrategy

TODO: Add class/interface details


Field Summary
protected  AssetTypeDef _def
           
protected  ICS _ics
           
protected static org.apache.commons.logging.Log _logger
           
 
Constructor Summary
CSElementReadStrategy(ICS ics)
           
 
Method Summary
protected  Query _checkQuery(Query query)
           
protected  AssetTypeDef _getAssetTypeDef(java.lang.String assettype, java.lang.String subtype)
          returnt the AssetTypeDef given asset type and subtype
protected  void _retrieveSpecialAttributes(MutableAssetData data, IAsset asset, java.util.List<java.lang.String> attributeNames)
          Each special assets that is not flex assets would most go through the Basic Asset Strategy and then calls its own retrieving special attribute to handles the specially available attributes for themselves
protected  java.lang.String performQuery(Query query, java.lang.String assettype, java.lang.String subtype, AssetTypeDef def, boolean isFlex, java.util.List<java.lang.String> uniqIds)
           
 MutableAssetData read(IAsset asset, AssetId id)
           
 java.lang.Iterable<MutableAssetData> read(java.util.List<AssetId> ids)
          Reads asset data for all given AssetIds.
 java.lang.Iterable<MutableAssetData> read(Query query)
          Reads all asset data that satisfies a given Query
 MutableAssetData readAttributes(AssetId id, java.util.List<java.lang.String> attributeNames)
          Reads given set attribute data and returns an AssetData instance containing them.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.fatwire.assetapi.data.AssetDataReadStrategy
read, read, read, readAttributes
 

Field Detail

_def

protected AssetTypeDef _def

_ics

protected ICS _ics

_logger

protected static final org.apache.commons.logging.Log _logger
Constructor Detail

CSElementReadStrategy

public CSElementReadStrategy(ICS ics)
Method Detail

_retrieveSpecialAttributes

protected void _retrieveSpecialAttributes(MutableAssetData data,
                                          IAsset asset,
                                          java.util.List<java.lang.String> attributeNames)
                                   throws AssetAccessException
Each special assets that is not flex assets would most go through the Basic Asset Strategy and then calls its own retrieving special attribute to handles the specially available attributes for themselves

Parameters:
data - the half constructed AssetData
asset - the IAsset object
attributeNames - the names of the attributes that user requested, null indicates all are requested.
Throws:
AssetAccessException

read

public java.lang.Iterable<MutableAssetData> read(Query query)
                                          throws AssetAccessException
Description copied from interface: AssetDataReadStrategy
Reads all asset data that satisfies a given Query

Specified by:
read in interface AssetDataReadStrategy
Parameters:
query - Query to be satisfied.
Returns:
Iterator of AssetData instances.
Throws:
AssetAccessException - is thrown when Query is invalid by the way of incorrect attributes or invalid operation given the choice of query algorithm. AssetAccessException also wraps any AssetExcptions thrown by the internal implementation.

read

public MutableAssetData read(IAsset asset,
                             AssetId id)
                      throws AssetAccessException
Specified by:
read in interface AssetDataReadStrategy
Throws:
AssetAccessException

read

public java.lang.Iterable<MutableAssetData> read(java.util.List<AssetId> ids)
                                          throws AssetAccessException
Description copied from interface: AssetDataReadStrategy
Reads asset data for all given AssetIds.

Specified by:
read in interface AssetDataReadStrategy
Parameters:
ids - List of AssetIds
Returns:
List of AssetData instances belonging to AssetIds
Throws:
AssetAccessException - is thrown when any of the AssetIds passed in does not exist. AssetAccessException also wraps any AssetExcptions thrown by the internal implementation.

readAttributes

public MutableAssetData readAttributes(AssetId id,
                                       java.util.List<java.lang.String> attributeNames)
                                throws AssetAccessException
Description copied from interface: AssetDataReadStrategy
Reads given set attribute data and returns an AssetData instance containing them.

Specified by:
readAttributes in interface AssetDataReadStrategy
Parameters:
id - AssetId to read attributes for
attributeNames - names of the attributes
Returns:
AssetData containing values for requested attributes.
Throws:
AssetAccessException - if thrown if the AssetId does not exist or attrbute names passed are incorrect for the asset. AssetAccessException also wraps any AssetExcptions thrown by the internal implementation.

_checkQuery

protected Query _checkQuery(Query query)
                     throws AssetAccessException
Throws:
AssetAccessException

performQuery

protected java.lang.String performQuery(Query query,
                                        java.lang.String assettype,
                                        java.lang.String subtype,
                                        AssetTypeDef def,
                                        boolean isFlex,
                                        java.util.List<java.lang.String> uniqIds)
                                 throws AssetAccessException
Throws:
AssetAccessException

_getAssetTypeDef

protected AssetTypeDef _getAssetTypeDef(java.lang.String assettype,
                                        java.lang.String subtype)
                                 throws AssetAccessException
returnt the AssetTypeDef given asset type and subtype

Parameters:
assettype - the type of the asset
subtype - the subtype of the asset
Returns:
AssetTypeDef the asset type defintion of the given asset type and subtype
Throws:
AssetAccessException - exception will be thrown from AssetTypeDefManager.findByName(assettype, subtype)