magoffin.matt.ma2.dao
Interface MediaItemDao

All Superinterfaces:
magoffin.matt.dao.BatchableDao<MediaItem>, magoffin.matt.dao.GenericDao<MediaItem,java.lang.Long>
All Known Implementing Classes:
HibernateMediaItemDao

public interface MediaItemDao
extends magoffin.matt.dao.GenericDao<MediaItem,java.lang.Long>, magoffin.matt.dao.BatchableDao<MediaItem>

DAO for MediaItem objects.

Version:
$Revision: 43 $ $Date: 2007-10-21 11:10:01 +1300 (Sun, 21 Oct 2007) $
Author:
matt.magoffin

Nested Class Summary
 
Nested classes/interfaces inherited from interface magoffin.matt.dao.BatchableDao
magoffin.matt.dao.BatchableDao.BatchCallback<T>, magoffin.matt.dao.BatchableDao.BatchCallbackResult, magoffin.matt.dao.BatchableDao.BatchMode, magoffin.matt.dao.BatchableDao.BatchOptions, magoffin.matt.dao.BatchableDao.BatchResult
 
Field Summary
static java.lang.String BATCH_NAME_INDEX
          The batch processing name to index MediaItem objects.
static java.lang.String BATCH_NAME_PROCESS_MEDIA_IDS
          The batch processing name to process a list of MediaItem objects by ID.
static java.lang.String BATCH_PROCESS_PARAM_MEDIA_IDS_LIST
          The batch processing parameter key for a List of MediaItem IDs to process.
 
Method Summary
 java.util.List<MediaItem> findItemsForAlbum(java.lang.Long albumId)
          Find all MediaItems for a specific album.
 java.util.List<MediaItem> findItemsForCollection(java.lang.Long collectionId)
          Find all MediaItems for a specific collection.
 MediaItem getItemForPath(java.lang.Long collectionId, java.lang.String path)
          Find a MediaItem by its path and a specific collection.
 MediaItem getMediaItemWithInfo(java.lang.Long itemId)
          Get a MediaItem fully populated (with metadata, etc).
 java.util.List<MediaItem> removeItemsFromAlbums(java.lang.Long[] itemIds)
          Remove a set of MediaItems from any albums they reside in.
 java.util.List<MediaItem> removeItemsFromCollections(java.lang.Long[] itemIds)
          Remove a set of media items from the collections they are in.
 java.util.List<MediaItem> removeItemsOfCollectionFromAlbums(java.lang.Long collectionId)
          Find all MediaItems for a specific collection and then remove them from any album they reside in.
 
Methods inherited from interface magoffin.matt.dao.GenericDao
delete, get, store
 
Methods inherited from interface magoffin.matt.dao.BatchableDao
batchProcess
 

Field Detail

BATCH_NAME_PROCESS_MEDIA_IDS

static final java.lang.String BATCH_NAME_PROCESS_MEDIA_IDS
The batch processing name to process a list of MediaItem objects by ID.

See Also:
Constant Field Values

BATCH_NAME_INDEX

static final java.lang.String BATCH_NAME_INDEX
The batch processing name to index MediaItem objects.

See Also:
Constant Field Values

BATCH_PROCESS_PARAM_MEDIA_IDS_LIST

static final java.lang.String BATCH_PROCESS_PARAM_MEDIA_IDS_LIST
The batch processing parameter key for a List of MediaItem IDs to process.

See Also:
Constant Field Values
Method Detail

getItemForPath

MediaItem getItemForPath(java.lang.Long collectionId,
                         java.lang.String path)
Find a MediaItem by its path and a specific collection.

Parameters:
collectionId - the ID of the collection the item is in
path - the item's path
Returns:
the found item, or null if not found

findItemsForCollection

java.util.List<MediaItem> findItemsForCollection(java.lang.Long collectionId)
Find all MediaItems for a specific collection.

Parameters:
collectionId - the ID of the collection
Returns:
the MediaItems of the collection

findItemsForAlbum

java.util.List<MediaItem> findItemsForAlbum(java.lang.Long albumId)
Find all MediaItems for a specific album.

Parameters:
albumId - the ID of the album
Returns:
the MediaItems of the album

removeItemsOfCollectionFromAlbums

java.util.List<MediaItem> removeItemsOfCollectionFromAlbums(java.lang.Long collectionId)
Find all MediaItems for a specific collection and then remove them from any album they reside in.

Parameters:
collectionId - the ID of the collection
Returns:
the media items removed

removeItemsFromAlbums

java.util.List<MediaItem> removeItemsFromAlbums(java.lang.Long[] itemIds)
Remove a set of MediaItems from any albums they reside in.

Parameters:
itemIds - the IDs of the items to remove from albums
Returns:
the media items removed

removeItemsFromCollections

java.util.List<MediaItem> removeItemsFromCollections(java.lang.Long[] itemIds)
Remove a set of media items from the collections they are in.

Parameters:
itemIds - the IDs of the items to remove from collections
Returns:
the media items removed

getMediaItemWithInfo

MediaItem getMediaItemWithInfo(java.lang.Long itemId)
Get a MediaItem fully populated (with metadata, etc).

Parameters:
itemId - the ID of the item to get
Returns:
the media item