Class PlainLibraryDescriptor
- java.lang.Object
-
- com.tagtraum.beatunes.library.LibraryDescriptor
-
- com.tagtraum.beatunes.library.plain.PlainLibraryDescriptor
-
public class PlainLibraryDescriptor extends LibraryDescriptor
Plain library descriptor that does not wrap any song or playlist objects to apply side-effects like file or iTunes/Music manipulations.- Author:
- Hendrik Schreiber
-
-
Constructor Summary
Constructors Constructor Description PlainLibraryDescriptor(String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LibraryLoadercreateLibraryLoader()Creates a library loader appropriate for this kind of library.StringgetIdAsString()Library id asString.longgetLastModified()If this library descriptor describes a document or is capable of determining the last modification of the library as a whole, this method returns the date.StringgetName()Name.booleanneedsRefresh(long lastSync)Indicates whether we might want to sync this library.AudioSongwrap(AudioSong audioSong)Wraps an internal database song into anotherAudioSongthat is capable of writing/reading data to external databases or files (e.g.PlayListwrap(PlayList playList)Wraps an internal database playlist into anotherPlayListthat is capable of writing/reading data to external databases or files.-
Methods inherited from class com.tagtraum.beatunes.library.LibraryDescriptor
exists, getId, getMediaLibrary, setMediaLibrary
-
-
-
-
Constructor Detail
-
PlainLibraryDescriptor
public PlainLibraryDescriptor(String id)
-
-
Method Detail
-
getLastModified
public long getLastModified() throws IOExceptionDescription copied from class:LibraryDescriptorIf this library descriptor describes a document or is capable of determining the last modification of the library as a whole, this method returns the date.- Specified by:
getLastModifiedin classLibraryDescriptor- Returns:
- date of last modification or 0 if unknown
- Throws:
IOException
-
needsRefresh
public boolean needsRefresh(long lastSync) throws IOExceptionDescription copied from class:LibraryDescriptorIndicates whether we might want to sync this library. If this cannot determined accurately, this method returnstrue.- Specified by:
needsRefreshin classLibraryDescriptor- Parameters:
lastSync- date of last sync- Returns:
- true, if we should probably sync
- Throws:
IOException
-
getIdAsString
public String getIdAsString()
Description copied from class:LibraryDescriptorLibrary id asString.- Specified by:
getIdAsStringin classLibraryDescriptor- Returns:
- id
- See Also:
PersistentId.idStringToLong(String)
-
getName
public String getName()
Description copied from class:LibraryDescriptorName. E.g. "iTunes".- Specified by:
getNamein classLibraryDescriptor- Returns:
- library name
-
createLibraryLoader
public LibraryLoader createLibraryLoader()
Description copied from class:LibraryDescriptorCreates a library loader appropriate for this kind of library.- Specified by:
createLibraryLoaderin classLibraryDescriptor- Returns:
- library loader
-
wrap
public AudioSong wrap(AudioSong audioSong)
Description copied from class:LibraryDescriptorWraps an internal database song into anotherAudioSongthat is capable of writing/reading data to external databases or files (e.g.TrackorAudioMetaData). Depending on the kind of library, this wrapper might be quite different.- Specified by:
wrapin classLibraryDescriptor- Parameters:
audioSong- song object to be wrapped, e.g.Song- Returns:
- wrapper
-
wrap
public PlayList wrap(PlayList playList)
Description copied from class:LibraryDescriptorWraps an internal database playlist into anotherPlayListthat is capable of writing/reading data to external databases or files. Depending on the kind of library, this wrapper might be quite different.- Specified by:
wrapin classLibraryDescriptor- Parameters:
playList- song object to be wrapped, e.g.HibernatePlayList- Returns:
- wrapper
-
-