com.fatwire.assetapi.def
Class AssetTypeDefManagerImpl

java.lang.Object
  extended by com.fatwire.assetapi.def.AssetTypeDefManagerImpl
All Implemented Interfaces:
AssetTypeDefManager

public final class AssetTypeDefManagerImpl
extends java.lang.Object
implements AssetTypeDefManager

Sample implementation for Asset type definitions.


Constructor Summary
AssetTypeDefManagerImpl(ICS ics)
           
 
Method Summary
 void create(AssetTypeDef def)
          Creates an assetTypeDef in the database
 void delete(java.util.List<java.lang.String> assetTypeNames)
          Deletes asset types from the database and all their instances.
 AssetTypeDef findByName(java.lang.String assetTypeName, java.lang.String subtype)
          Finds an asset type definition by its name
 java.util.List<java.lang.String> getAssetTypes()
          Returns all asset type names in the system.
 java.util.List<java.lang.String> getSubTypes(java.lang.String assetType)
          Returns subtype names given the asset type name If the asset type name specified is not existed in System, the method would return an empty List and will not throw exception.
 AssetTypeDef newAssetTypeDef()
          Create an empty AssetTypeDef
 AssetAssociationDef newAssociationDef()
          Creates a new instance of Association by a given name.
 AttributeDef newAttributeDef()
          Creates a new instance of AttributeTypeDefinition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssetTypeDefManagerImpl

public AssetTypeDefManagerImpl(ICS ics)
Method Detail

findByName

public AssetTypeDef findByName(java.lang.String assetTypeName,
                               java.lang.String subtype)
                        throws AssetAccessException
Finds an asset type definition by its name

Specified by:
findByName in interface AssetTypeDefManager
Parameters:
assetTypeName - name of the asset type definition.
subtype - Subtype of asset definition, if any.
Returns:
AssetTypeDef if the asset type by that name can be found.
Throws:
AssetAccessException - captures layer specific failures and wraps other internal exceptions.

getAssetTypes

public java.util.List<java.lang.String> getAssetTypes()
                                               throws AssetAccessException
Description copied from interface: AssetTypeDefManager
Returns all asset type names in the system.

Specified by:
getAssetTypes in interface AssetTypeDefManager
Returns:
List of asset type names.
Throws:
AssetAccessException - wraps any internal exceptions generated by the framework.

getSubTypes

public java.util.List<java.lang.String> getSubTypes(java.lang.String assetType)
                                             throws AssetAccessException
Description copied from interface: AssetTypeDefManager
Returns subtype names given the asset type name If the asset type name specified is not existed in System, the method would return an empty List and will not throw exception.

Specified by:
getSubTypes in interface AssetTypeDefManager
Parameters:
assetType - name of the asset type to get subtypes for
Returns:
List of valid subtype names.
Throws:
AssetAccessException - wraps any internal exceptions generated by the framework.

create

public void create(AssetTypeDef def)
            throws AssetAccessException
Creates an assetTypeDef in the database

Specified by:
create in interface AssetTypeDefManager
Parameters:
def -
Throws:
AssetAccessException - captures layer specific failures and wraps other internal exceptions.

delete

public void delete(java.util.List<java.lang.String> assetTypeNames)
            throws AssetAccessException
Deletes asset types from the database and all their instances.

Specified by:
delete in interface AssetTypeDefManager
Parameters:
assetTypeNames - name of the asset types to be deleted.
Throws:
AssetAccessException - captures layer specific failures and wraps other internal exceptions.

newAttributeDef

public AttributeDef newAttributeDef()
Creates a new instance of AttributeTypeDefinition

Specified by:
newAttributeDef in interface AssetTypeDefManager
Returns:
new (blank) AttributeTypeDef

newAssetTypeDef

public AssetTypeDef newAssetTypeDef()
Create an empty AssetTypeDef

Specified by:
newAssetTypeDef in interface AssetTypeDefManager
Returns:
empty asset type definition.

newAssociationDef

public AssetAssociationDef newAssociationDef()
Creates a new instance of Association by a given name.

Specified by:
newAssociationDef in interface AssetTypeDefManager
Returns:
AssetAssociationDef