Media Authoring
with Java API

tv.amwa.maj.iface
Interface ContentStorage

All Superinterfaces:
InterchangeObject
All Known Implementing Classes:
ContentStorage

public interface ContentStorage
extends InterchangeObject

Specifies storage for content that has mob and essence data within it. An AAF file shall have exactly one content storage.

Note that there is no requirement for every mob stored in a content storage to have its essence data stored within the same content storage. However, it is likely that if some essence data is stored in this content storage, its associated metadata file source mob is also stored.

Author:
Richard Cartwright
See Also:
makeContentStorage(), Header.getContentStorage()

Method Summary
 void addEssenceData(EssenceData essenceData)
          Adds the given essence data item to the set of those stored in this content storage..
 void addMob(Mob mob)
          Adds the given mob to the set of mobs in this content storage.
 int countEssenceData()
          Returns the total number of essence data items in this content storage.
 int countMobs(MobKind mobKind)
          Find the number of matches for the given mob kind stored in this content storage.
 Set<? extends EssenceData> enumEssenceData()
          Returns the complete set of essence data contained within this content storage object.
 Set<? extends EssenceData> getEssenceData(CriteriaType mediaCriteria)
          Returns the set of essence data contained within this content storage object, filtered according to the media criteria provided.
 Set<? extends Mob> getMobs(SearchCriteria searchCriteria)
          Returns a set of mobs from this content storage according to a given search criteria.
 boolean isEssenceDataPresent(MobID fileMobId)
          Returns true if essence data identified by the given mob id is contained in this content storage.
 EssenceData lookupEssenceData(MobID mobId)
          Looks up and returns an essence data item stored in this content storage that matches the given mob id.
 Mob lookupMob(MobID mobId)
          Returns the mob that matches the given mob id from the set of mobs in this content storage.
 void removeEssenceData(EssenceData essenceData)
          Removes the given essence data item from the set stored in this content storage.
 void removeMob(Mob mob)
          Removes the given mob from the set stored in this content storage.
 
Methods inherited from interface tv.amwa.maj.iface.InterchangeObject
countProperties, createOptionalPropertyValue, disableGenerationTracking, enableGenerationTracking, getDefinition, getGeneration, getGenerationAUID, getProperties, getPropertyValue, isGenerationTracked, isPropertyPresent, omitOpionalProperty, setPropertyValue
 

Method Detail

lookupMob

Mob lookupMob(MobID mobId)
              throws NullPointerException,
                     MobNotFoundException

Returns the mob that matches the given mob id from the set of mobs in this content storage.

Parameters:
mobId - The identifier of the mob to find in this content storage.
Returns:
Mob with the given identifier from this content storage.
Throws:
NullPointerException - The given mob identifier is null.
MobNotFoundException - The requested mob is not stored in this content storage.

countMobs

@NumSlots
int countMobs(MobKind mobKind)
              throws NullPointerException

Find the number of matches for the given mob kind stored in this content storage.

Parameters:
mobKind - The kind of mob to count.
Returns:
Total number of mobs of the given mob kind stored in this content storage.
Throws:
NullPointerException - The given mob kind is null.

getMobs

Set<? extends Mob> getMobs(SearchCriteria searchCriteria)

Returns a set of mobs from this content storage according to a given search criteria. If the search criteria is null then all of the mobs in storage are returned.

Parameters:
searchCriteria - Search criteria to filter the set of stored mobs of this content storage with.
Returns:
Shallow copy of the set of all the mobs matching the given search criteria.
See Also:
SearchCriteria, Header.getMobs(SearchCriteria)

addMob

void addMob(Mob mob)
            throws NullPointerException,
                   DuplicateMobIDException

Adds the given mob to the set of mobs in this content storage.

Parameters:
mob - Mob to add to this content storage.
Throws:
NullPointerException - The given mob is null.
DuplicateMobIDException - The given mob is already contained in this content storage.

removeMob

void removeMob(Mob mob)
               throws NullPointerException,
                      MobNotFoundException

Removes the given mob from the set stored in this content storage.

Parameters:
mob - Mob to remove from this content storage.
Throws:
NullPointerException - The given mob to remove is null.
MobNotFoundException - The given mob is not current contained in this content storage.

countEssenceData

@UInt32
int countEssenceData()

Returns the total number of essence data items in this content storage.

Returns:
Total number of essence data items.

isEssenceDataPresent

@Bool
boolean isEssenceDataPresent(MobID fileMobId)
                             throws NullPointerException

Returns true if essence data identified by the given mob id is contained in this content storage.

Parameters:
fileMobId - Identifier of the essence data to check for within this content storage.
Returns:
True if the essence data is found in this content storage.
Throws:
NullPointerException - One or more of the arguments in null.

enumEssenceData

Set<? extends EssenceData> enumEssenceData()

Returns the complete set of essence data contained within this content storage object.

Calling this method produces the same result as calling getEssenceData(CriteriaType.AnyRepresentation).

Returns:
Shallow copy of the set of essence data stored in this content storage.
See Also:
Header.enumEssenceData()

getEssenceData

Set<? extends EssenceData> getEssenceData(CriteriaType mediaCriteria)

Returns the set of essence data contained within this content storage object, filtered according to the media criteria provided.

If the mediaCriteria is set to CriteriaType.AnyRepresentation, all essence data is returned.

Parameters:
mediaCriteria - Criteria to use to select the required essence data.
Returns:
Shallow copy of the set of essence stored in the content storage object.
See Also:
enumEssenceData(), Header.getEssenceData(CriteriaType)

addEssenceData

void addEssenceData(EssenceData essenceData)
                    throws DuplicateMobIDException,
                           NullPointerException

Adds the given essence data item to the set of those stored in this content storage..

Parameters:
essenceData - Essence data object to add to those stored in this content storage.
Throws:
DuplicateMobIDException - The given mob has already been added. The validation is done by comparing mob ids, which should be unique amongst all essence data in a content storage unit.
NullPointerException - The given essence data item is null.
See Also:
EssenceData.getFileMobID()

removeEssenceData

void removeEssenceData(EssenceData essenceData)
                       throws NullPointerException,
                              EssenceNotFoundException

Removes the given essence data item from the set stored in this content storage.

Parameters:
essenceData - Essence data to remove from this content storage.
Throws:
NullPointerException - The given essence data item is null.
EssenceNotFoundException - The given essence data item is not currently contained in this content storage.

lookupEssenceData

EssenceData lookupEssenceData(MobID mobId)
                              throws NullPointerException,
                                     MobNotFoundException

Looks up and returns an essence data item stored in this content storage that matches the given mob id.

Parameters:
mobId - The mob id identifying the essence data stored in this content storage.
Returns:
Essence data stored in this content storage with the given mob id.
Throws:
NullPointerException - The given essece data mob id is null.
MobNotFoundException - The requested essence data was not found stored in this content storage.

Media Authoring
with Java API

(c) 2007-2008 Richard Cartwright, all rights reserved. Subject to the terms of the AAF SDK Public Source License.