Package com.tagtraum.beatunes.library
Class LibraryLoader
- java.lang.Object
-
- com.tagtraum.beatunes.library.LibraryLoader
-
- Direct Known Subclasses:
HibernateFileSystemLibraryLoader
,HibernateITunesLibraryLoader
,ITLibraryLoader
,PlainLibraryLoader
public abstract class LibraryLoader extends Object
Subclasses load or sync with a music library. This may be an
iTunes (Music) Library.xml
file or some other form of library like a simple folder structure.Loading is either synchronous or asynchronous.
- Author:
- Hendrik Schreiber
-
-
Constructor Summary
Constructors Constructor Description LibraryLoader()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description HibernateMediaLibrary<?>
getHibernateMediaLibrary()
abstract MediaLibrary
getMediaLibrary()
protected abstract MediaLibraryEvent
load(LibraryDescriptor libraryDescriptor, ProgressListener progressListener, boolean full)
Implement this method to establish the actual loading process.Future<MediaLibraryEvent>
load(LibraryDescriptor libraryDescriptor, ProgressListener progressListener, JDialog progressDialog, boolean full)
Loads the library asynchronously in a separate thread.
-
-
-
Method Detail
-
getMediaLibrary
public abstract MediaLibrary getMediaLibrary()
-
getHibernateMediaLibrary
public HibernateMediaLibrary<?> getHibernateMediaLibrary()
-
load
protected abstract MediaLibraryEvent load(LibraryDescriptor libraryDescriptor, ProgressListener progressListener, boolean full) throws Exception
Implement this method to establish the actual loading process. Do not call this method yourself. It will be called byAbstractMediaLibrary
. Note that loading includes loading tracks from an external source (e.g. iTunes or the file system) AND building playlists based on them. At the very least, a library playlist must be built.- Parameters:
libraryDescriptor
- describes the library we are supposed to loadprogressListener
- progress listener to notify of progress @see #load(com.tagtraum.core.ProgressListener, javax.swing.JDialog)full
- attempt full synchronization no matter what- Returns:
- event object describing the load results
- Throws:
Exception
- if something went wrong
-
load
public Future<MediaLibraryEvent> load(LibraryDescriptor libraryDescriptor, ProgressListener progressListener, JDialog progressDialog, boolean full)
Loads the library asynchronously in a separate thread.- Parameters:
libraryDescriptor
- describes the library we are supposed to loadprogressListener
- listenerprogressDialog
- dialog @see #loadSynchronously(com.tagtraum.core.ProgressListener, javax.swing.JDialog)full
- attempt full synchronization no matter what- Returns:
- a future that returns an event object describing the load results, may throw an
ExecutionException
. - See Also:
load(LibraryDescriptor, ProgressListener, boolean)
-
-