com.fatwire.assetapi.data
Class AssetDataImpl

java.lang.Object
  extended by com.fatwire.assetapi.data.AssetDataImpl
All Implemented Interfaces:
AssetData, MutableAssetData

public class AssetDataImpl
extends java.lang.Object
implements MutableAssetData

AssetData interface implementation class


Constructor Summary
protected AssetDataImpl(AssetData copy)
           
  AssetDataImpl(AssetId id)
          Create an AssetData object with asset id
  AssetDataImpl(AssetTypeDef assettype, AssetId id)
          Create an AssetData object with AssetTypeDef and asset id
 
Method Summary
 void addAssociation(java.lang.String associationName, java.util.List<AssetId> assets)
          Adds an associations by a given name
 void addAttributeData(AttributeData data)
          Adds an attribute data.
 AssetId getAssetId()
          Returns unique identification of the asset instance AssetId
 AssetTypeDef getAssetTypeDef()
          Returns AssetTypeDef this instance is based on.
 java.util.List<AssetId> getAssociatedAssets(java.lang.String name)
          this method is lazy loading associated assets
 java.lang.Iterable<java.lang.String> getAssociationNames()
          retreive the list of the association names that this asset contains data for
 java.util.List<AttributeData> getAttributeData()
          Returns a list of all attribute data associated with this instance of asset
 AttributeData getAttributeData(java.lang.String attributeName)
          Returns data associated with a given attribute.
 java.util.List<java.lang.String> getAttributeNames()
          Returns List of attribute names contained in this instance of AssetData.
 java.util.List<AssetId> getParents()
          Returns Asset identifiers of parent assets, if any.
 void removeAttributeData(java.lang.String attributeName)
          Removes an attribute data from collection
 void setAttributeData(java.util.List<AttributeData> data)
          Sets data for this instance of AssetData
 void setParents(java.util.List<AssetId> id)
          Sets parent assets for this instance of AssetData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssetDataImpl

public AssetDataImpl(AssetId id)
Create an AssetData object with asset id

Parameters:
id - - AssetId, the type and id of the asset

AssetDataImpl

public AssetDataImpl(AssetTypeDef assettype,
                     AssetId id)
Create an AssetData object with AssetTypeDef and asset id

Parameters:
assettype - - AssetTypeDef, the asset type definition of the asset
id - - AssetId, the asset type and id of the asset

AssetDataImpl

protected AssetDataImpl(AssetData copy)
Method Detail

setAttributeData

public void setAttributeData(java.util.List<AttributeData> data)
Description copied from interface: MutableAssetData
Sets data for this instance of AssetData

Specified by:
setAttributeData in interface MutableAssetData
Parameters:
data - data to set

addAttributeData

public void addAttributeData(AttributeData data)
Description copied from interface: MutableAssetData
Adds an attribute data.

Specified by:
addAttributeData in interface MutableAssetData
Parameters:
data - data to add

removeAttributeData

public void removeAttributeData(java.lang.String attributeName)
Description copied from interface: MutableAssetData
Removes an attribute data from collection

Specified by:
removeAttributeData in interface MutableAssetData
Parameters:
attributeName - attribute to remove

setParents

public void setParents(java.util.List<AssetId> id)
Description copied from interface: MutableAssetData
Sets parent assets for this instance of AssetData

Specified by:
setParents in interface MutableAssetData
Parameters:
id - ids of parents

addAssociation

public void addAssociation(java.lang.String associationName,
                           java.util.List<AssetId> assets)
Description copied from interface: MutableAssetData
Adds an associations by a given name

Specified by:
addAssociation in interface MutableAssetData
Parameters:
associationName - name of the association to add
assets - to be added as associations.

getAssetId

public AssetId getAssetId()
Description copied from interface: AssetData
Returns unique identification of the asset instance AssetId

Specified by:
getAssetId in interface AssetData
Returns:
AssetId associated with the instance

getAttributeNames

public java.util.List<java.lang.String> getAttributeNames()
Description copied from interface: AssetData
Returns List of attribute names contained in this instance of AssetData.

Specified by:
getAttributeNames in interface AssetData
Returns:
Attribute names that make this instance of AssetData. (note: the asset itself could have more attributes, use AssetTypeDef to get to those).

getAssetTypeDef

public AssetTypeDef getAssetTypeDef()
Description copied from interface: AssetData
Returns AssetTypeDef this instance is based on.

Specified by:
getAssetTypeDef in interface AssetData
Returns:
returns a AssetTypeDef handle to the asset type this instance is built upon.

getAttributeData

public AttributeData getAttributeData(java.lang.String attributeName)
Description copied from interface: AssetData
Returns data associated with a given attribute.

Specified by:
getAttributeData in interface AssetData
Parameters:
attributeName - name of the attribute
Returns:
AttributeData instance for an attribute of a given name.

getAttributeData

public java.util.List<AttributeData> getAttributeData()
Description copied from interface: AssetData
Returns a list of all attribute data associated with this instance of asset

Specified by:
getAttributeData in interface AssetData
Returns:
List of all attribute data

getAssociatedAssets

public java.util.List<AssetId> getAssociatedAssets(java.lang.String name)
this method is lazy loading associated assets

Specified by:
getAssociatedAssets in interface AssetData
Parameters:
name - The association name that try to retrieve
Returns:
list of associated assets with given name

getParents

public java.util.List<AssetId> getParents()
                                   throws AssetAccessException
Returns Asset identifiers of parent assets, if any.

Specified by:
getParents in interface AssetData
Returns:
List of asset identifiers for this asset instance.
Throws:
AssetAccessException - captures layer specific failures and wraps other internal exceptions.

getAssociationNames

public java.lang.Iterable<java.lang.String> getAssociationNames()
retreive the list of the association names that this asset contains data for

Returns:
the String list of existed association names