com.fatwire.assetapi.data
Class FlexFilterReadStrategy

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

public class FlexFilterReadStrategy
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
           
static java.util.List<java.lang.String> basicStandAttributes
           
protected  java.util.List<java.lang.String> specialAttributes
           
 
Constructor Summary
FlexFilterReadStrategy(ICS ics, java.lang.String assettype)
           
 
Method Summary
protected static void _checkElementCatalogPrivileges(ICS ics)
           
protected  Query _checkQuery(Query query)
           
protected static void _checkSiteCatalogPrivileges(ICS ics)
           
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  boolean allStandardAttributes(java.util.List<java.lang.String> attributeNames)
           
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)
          Reads asset data for the given AssetId from the IAsset specified
 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

specialAttributes

protected java.util.List<java.lang.String> specialAttributes

_def

protected AssetTypeDef _def

_ics

protected ICS _ics

_logger

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

basicStandAttributes

public static java.util.List<java.lang.String> basicStandAttributes
Constructor Detail

FlexFilterReadStrategy

public FlexFilterReadStrategy(ICS ics,
                              java.lang.String assettype)
Method Detail

_retrieveSpecialAttributes

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

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

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
Description copied from interface: AssetDataReadStrategy
Reads asset data for the given AssetId from the IAsset specified

Specified by:
read in interface AssetDataReadStrategy
Parameters:
asset - the asset where the asset will be read from
id - AssetId to read for
Returns:
a MutableAssetData
Throws:
AssetAccessException - is thrown when error met reading the data from the asset

read

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

Specified by:
read in interface AssetDataReadStrategy
Parameters:
ids - List of AssetIds
Returns:
Iterator 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.
AssetNotExistException

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.

_checkSiteCatalogPrivileges

protected static void _checkSiteCatalogPrivileges(ICS ics)
                                           throws AssetAccessException
Throws:
AssetAccessException

_checkElementCatalogPrivileges

protected static void _checkElementCatalogPrivileges(ICS ics)
                                              throws AssetAccessException
Throws:
AssetAccessException

_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

allStandardAttributes

protected boolean allStandardAttributes(java.util.List<java.lang.String> attributeNames)

_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)


Copyright (c) 2003 - 2011 FatWire Corporation All Rights Reserved.