com.fatwire.assetapi.data
Interface AssetDataManager

All Known Implementing Classes:
AssetDataManagerImpl

public interface AssetDataManager

This interface is the primary access point for getting to Asset's data.

An asset data can be looked up either by its AssetId using AssetDataManager.read(List) or by using a Query in AssetDataManager.read(Query).

A Query is an abstract construct that defines user's request for asset's data. Query can be considered as an object representation of SQL.

Using Query one would be able to specify Condition (a set of matching criterion) to limit the assets returned as well as the sorting order in which the results are to be read.

A Query also limits the number of attributes to be retrived. Limiting the Query to contain only a few attributes limits the amount of data that read into memory.

Query also contains an accessory set of properties, QueryProperties. QueryProperties can be used, among other things, to specify the type of query algorithm to use.

For more details about Query, its construct and limitations please see Query

Note: Only read methods are implemented in CS version 7.0. Methods for which implementation does not exist throw UnsupportedOperationException.


Method Summary
 void delete(java.util.List<AssetId> data)
          Deletes a given Iterator of AssetIds from database.
 void insert(java.util.List<AssetData> data)
          NOTE: This method is not implemented yet.
 AssetData newAssetData(java.lang.String assetTypeName, AssetData example)
          NOTE: This method is not implemented yet.
 AttributeData newAttribiteData(java.lang.String attributeName, java.lang.String assetTypeName, java.lang.String subtype)
          NOTE: This method is not implemented yet.
 java.lang.Iterable<AssetData> read(java.util.List<AssetId> ids)
          Reads asset data for all given AssetIds.
 java.lang.Iterable<AssetData> read(Query query)
          Reads all asset data that satisfies a given Query
 AssetData readAttributes(AssetId id, java.util.List<java.lang.String> attributeNames)
          Reads given set attribute data and returns an AssetData instance containing them.
 java.lang.Iterable<MutableAssetData> readForUpdate(java.util.List<AssetId> ids)
          NOTE: This method is not implemented yet.
 java.lang.Iterable<MutableAssetData> readForUpdate(Query query)
          NOTE: This method is not implemented yet.
 void update(java.util.List<AssetData> data)
          NOTE: This method is not implemented yet.
 

Method Detail

read

java.lang.Iterable<AssetData> read(Query query)
                                   throws AssetAccessException
Reads all asset data that satisfies a given Query

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.

readForUpdate

java.lang.Iterable<MutableAssetData> readForUpdate(Query query)
                                                   throws AssetAccessException
NOTE: This method is not implemented yet. Reads all asset data that satisfies a given Query and results in mutable results.

Parameters:
query - Query to be satisfied.
Returns:
Iterator of MutableAssetData instances.
Throws:
AssetAccessException - is the layer specific failures and wraps other internal exceptions.

read

java.lang.Iterable<AssetData> read(java.util.List<AssetId> ids)
                                   throws AssetAccessException
Reads asset data for all given AssetIds.

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.

readForUpdate

java.lang.Iterable<MutableAssetData> readForUpdate(java.util.List<AssetId> ids)
                                                   throws AssetAccessException
NOTE: This method is not implemented yet. Reads asset data for all given AssetIds and results in mutable results.

Parameters:
ids - List of AssetIds
Returns:
List of MutableAssetData instances belonging to AssetIds
Throws:
AssetAccessException - captures layer specific failures and wraps other internal exceptions.

readAttributes

AssetData readAttributes(AssetId id,
                         java.util.List<java.lang.String> attributeNames)
                         throws AssetAccessException
Reads given set attribute data and returns an AssetData instance containing them.

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.

insert

void insert(java.util.List<AssetData> data)
            throws AssetAccessException
NOTE: This method is not implemented yet. Inserts a given Iterator of AssetData instances in the database.

Parameters:
data - AssetData to be inserted.
Throws:
AssetAccessException - captures layer specific failures and wraps other internal exceptions.

update

void update(java.util.List<AssetData> data)
            throws AssetAccessException
NOTE: This method is not implemented yet. Updates a given Iterator of AssetData in the database.

Parameters:
data - AssetData to be updated.
Throws:
AssetAccessException - captures layer specific failures and wraps other internal exceptions.

delete

void delete(java.util.List<AssetId> data)
            throws AssetAccessException
Deletes a given Iterator of AssetIds from database.

Parameters:
data - AssetIds to be deleted.
Throws:
AssetAccessException - captures layer specific failures and wraps other internal exceptions.

newAttribiteData

AttributeData newAttribiteData(java.lang.String attributeName,
                               java.lang.String assetTypeName,
                               java.lang.String subtype)
NOTE: This method is not implemented yet. Creates an empty instance of AttributeData (of appropriate type and default)

Parameters:
attributeName - name of the attribute
assetTypeName - name of asset type
subtype - subtype of asset type.
Returns:
empty AttributeData for a given attribute name and attribute type.

newAssetData

AssetData newAssetData(java.lang.String assetTypeName,
                       AssetData example)
NOTE: This method is not implemented yet. Creates an empty instance of AssetData (with empty instances of AttributeData)

Parameters:
assetTypeName - name of the asset type
example - optional example AsetData the returned will be based on.
Returns:
empty instance of AssetData