Skip navigation links


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)
          Create an AssetData by copying an existing one
  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.
 AttributeData getAttributeData(java.lang.String attributeName, boolean isMetaDataAttribute)
          Returns a 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> getImmediateParents()
          Returns the Asset Identifiers of immediate parents, if any.
 java.util.List<AssetId> getImmediateParents(java.lang.String parentDefName)
          Returns the Asset Identifiers of immediate parents, if any.
 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 setAssetId(AssetId assetId)
          Sets unique identification of the asset instance AssetId
 void setAssociation(java.lang.String associationName, java.util.List<AssetId> assets)
          Sets an associations by a given name.
 void setAssociationsLoaded()
           
 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)
                 throws AssetAccessException
Create an AssetData by copying an existing one
Parameters:
copy - the asset data where to copy the data from
Throws:
AssetAccessException - is thrown when error happens read the data

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)
                throws AssetAccessException
Description copied from interface: MutableAssetData
Sets parent assets for this instance of AssetData
Specified by:
setParents in interface MutableAssetData
Parameters:
id - ids of parents
Throws:
AssetAccessException - throw this Exception if error met

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.

setAssociation

public void setAssociation(java.lang.String associationName,
                           java.util.List<AssetId> assets)
Description copied from interface: MutableAssetData
Sets an associations by a given name. If association already exists, it is replaced.
Specified by:
setAssociation 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

setAssetId

public void setAssetId(AssetId assetId)
Description copied from interface: AssetData
Sets unique identification of the asset instance AssetId
Specified by:
setAssetId in interface AssetData
Parameters:
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. Returns null if no AttributeData of specified name

getAttributeData

public AttributeData getAttributeData(java.lang.String attributeName,
                                      boolean isMetaDataAttribute)
Description copied from interface: AssetData
Returns a data associated with a given attribute
Specified by:
getAttributeData in interface AssetData
Parameters:
attributeName - name of the attribute
isMetaDataAttribute - whether attribute is user defined, or it is system defined (for flex asset only)
Returns:
AttributeData instance for an attribute of given name and boolean property. Returns null if no AttributeData of specified name and specified user defined or not property.

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

getImmediateParents

public java.util.List<AssetId> getImmediateParents()
                                            throws AssetAccessException
Description copied from interface: AssetData
Returns the Asset Identifiers of immediate parents, if any.
Specified by:
getImmediateParents in interface AssetData
Returns:
List of parents asset ids
Throws:
AssetAccessException - captures layer specific failures and wraps other internal excetpions

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.

getImmediateParents

public java.util.List<AssetId> getImmediateParents(java.lang.String parentDefName)
                                            throws AssetAccessException
Description copied from interface: AssetData
Returns the Asset Identifiers of immediate parents, if any. The immediate parents are grouped with the flex parent definition id
Specified by:
getImmediateParents in interface AssetData
Parameters:
parentDefName - the name of the parent definition
Returns:
List of parents asset ids
Throws:
AssetAccessException - captures layer specific failures and wraps other internal excetpions

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

setAssociationsLoaded

public void setAssociationsLoaded()

Skip navigation links


Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.