|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.atunes.kernel.handlers.RepositoryHandler
public class RepositoryHandler
The Class RepositoryHandler.
| Nested Class Summary | |
|---|---|
static class |
RepositoryHandler.SortType
The Enum SortType. |
| Field Summary | |
|---|---|
static java.lang.String |
INDEX_FIELD_ALBUM
The Constant INDEX_FIELD_ALBUM. |
static java.lang.String |
INDEX_FIELD_ALBUM_ARTIST
The Constant INDEX_FIELD_ALBUM_ARTIST. |
static java.lang.String |
INDEX_FIELD_ARTIST
The Constant INDEX_FIELD_ARTIST. |
static java.lang.String |
INDEX_FIELD_BITRATE
The Constant INDEX_FIELD_BITRATE. |
static java.lang.String |
INDEX_FIELD_COMPOSER
The Constant INDEX_FIELD_COMPOSER. |
static java.lang.String |
INDEX_FIELD_DURATION
The Constant INDEX_FIELD_DURATION. |
static java.lang.String |
INDEX_FIELD_FILENAME
The Constant INDEX_FIELD_FILENAME. |
static java.lang.String |
INDEX_FIELD_FREQUENCY
The Constant INDEX_FIELD_FREQUENCY. |
static java.lang.String |
INDEX_FIELD_GENRE
The Constant INDEX_FIELD_GENRE. |
static java.lang.String |
INDEX_FIELD_LYRICS
The Constant INDEX_FIELD_LYRICS. |
static java.lang.String |
INDEX_FIELD_SCORE
The Constant INDEX_FIELD_STARS. |
static java.lang.String |
INDEX_FIELD_TITLE
The Constant INDEX_FIELD_TITLE. |
static java.lang.String |
INDEX_FIELD_TRACK_NUMBER
The Constant INDEX_FIELD_NUMBER. |
static java.lang.String |
INDEX_FIELD_URL
The Constant INDEX_FIELD_URL. |
static java.lang.String |
INDEX_FIELD_YEAR
The Constant INDEX_FIELD_YEAR. |
| Method Summary | |
|---|---|
void |
addAndRefresh(java.util.List<java.io.File> files,
java.io.File folder)
Adds the and refresh. |
void |
addExternalPictureForAlbum(java.lang.String artistName,
java.lang.String albumName,
java.io.File picture)
Adds the external picture for album. |
void |
finish()
Finish. |
java.lang.Runnable |
getAfterStartActionsRunnable()
Returns a runnable object to be executed after application start |
java.util.Map<java.lang.String,java.lang.Integer> |
getAlbumMostPlayed()
Gets the album most played. |
java.util.List<Album> |
getAlbums()
Gets the albums. |
java.lang.Integer |
getAlbumTimesPlayed(AudioFile song)
Gets the album times played. |
java.util.Map<java.lang.String,Artist> |
getArtistAndAlbumStructure()
Gets the artist and album structure. |
java.util.Map<java.lang.String,java.lang.Integer> |
getArtistMostPlayed()
Gets the artist most played. |
java.util.List<Artist> |
getArtists()
Gets the artists. |
java.lang.Integer |
getArtistTimesPlayed(AudioFile song)
Gets the artist times played. |
int |
getDifferentSongsPlayed()
Gets the different songs played. |
Document |
getDocumentForElement(AudioObject audioObject)
Builds a Lucene Document for a given AudioObject. |
java.util.List<AudioObject> |
getElementsToIndex()
Returns elements to index. |
AudioFile |
getFileIfLoaded(java.lang.String fileName)
Gets the file if loaded. |
java.util.Map<java.lang.String,Folder> |
getFolderStructure()
Gets the folder structure. |
java.util.Map<java.lang.String,Genre> |
getGenreStructure()
Gets the genre structure. |
static RepositoryHandler |
getInstance()
Gets the single instance of RepositoryHandler. |
java.util.List<Album> |
getMostPlayedAlbums(int n)
Gets the most played albums. |
java.util.List<java.lang.Object[]> |
getMostPlayedAlbumsInRanking(int n)
Gets the most played albums in ranking. |
java.util.List<Artist> |
getMostPlayedArtists(int n)
Gets the most played artists. |
java.util.List<java.lang.Object[]> |
getMostPlayedArtistsInRanking(int n)
Gets the most played artists in ranking. |
java.util.List<AudioFile> |
getMostPlayedSongs(int n)
Gets the most played songs. |
java.util.List<java.lang.Object[]> |
getMostPlayedSongsInRanking(int n)
Gets the most played songs in ranking. |
java.lang.String |
getPathForNewSongsRipped()
Gets the path for new songs ripped. |
java.lang.String |
getPathToIndex()
Returns path to index. |
java.lang.Runnable |
getReadRepositoryFromCacheRunnable()
Process to read repository from cache. |
Repository |
getRepository()
Gets the repository. |
java.io.File |
getRepositoryFolderContainingFile(AudioFile file)
Returns repository root folder that contains file. |
java.lang.String |
getRepositoryPath()
Gets the repository path. |
long |
getRepositoryTotalSize()
Gets the repository total size. |
java.util.List<java.lang.String> |
getSearchableAttributes()
Returns a list of attributes that can be used in queries. |
java.lang.String |
getSearchableObjectName()
Returns string representation of this searchable object. |
java.util.List<SearchResult> |
getSearchResult(Hits hits)
Returns result from hits. |
SearchResultTableModel |
getSearchResultsTableModel(java.util.List<SearchResult> results)
Returns a table model to show search results. |
java.util.Map<AudioFile,java.lang.Integer> |
getSongMostPlayed()
Gets the song most played. |
java.util.List<AudioFile> |
getSongs()
Gets the songs. |
java.util.List<AudioFile> |
getSongsForAlbums(java.util.Map<java.lang.String,Album> albums)
Gets the songs for albums. |
java.util.List<AudioFile> |
getSongsForArtists(java.util.Map<java.lang.String,Artist> artists)
Gets the songs for artists. |
java.lang.String |
getSongsPlayed()
Gets the songs played. |
SongStats |
getSongStatistics(AudioFile song)
Gets the song statistics. |
int |
getTotalSongsPlayed()
Gets the total songs played. |
java.util.List<AudioFile> |
getUnplayedSongs()
Gets the unplayed songs. |
boolean |
isRepository(java.io.File folder)
Returns true if folder is in repository. |
void |
notifyCancel()
Notify cancel. |
void |
notifyCurrentPath(java.lang.String dir)
Notify current path. |
void |
notifyFileLoaded()
Notify file loaded. |
void |
notifyFilesInRepository(int totalFiles)
Notify files in repository. |
void |
notifyFinishRead(RepositoryLoader loader)
Notify finish read. |
void |
notifyFinishRefresh(RepositoryLoader loader)
Notify finish refresh. |
void |
notifyRemainingTime(long millis)
Notify remaining time. |
void |
refreshFile(AudioFile file)
Refresh file. |
void |
refreshRepository()
Refresh repository. |
void |
removePhysically(java.util.List<AudioFile> filesToRemove)
Removes a list of files permanently from disk. |
boolean |
repositoryIsNull()
Repository is null. |
boolean |
retrieve(java.util.List<java.io.File> folders)
Retrieve. |
boolean |
selectRepository()
Select repository. |
boolean |
selectRepository(boolean repositoryNotFound)
Select repository. |
void |
setRepository()
Sets the repository. |
void |
setSongStatistics(AudioFile song)
Sets the song statistics. |
java.util.List<AudioObject> |
sort(java.util.List<? extends AudioObject> songs)
Sort. |
java.util.List<AudioObject> |
sort(java.util.List<? extends AudioObject> songs,
RepositoryHandler.SortType type)
Sort. |
void |
transferStatsFrom(Repository newRepository,
Repository oldRepository)
Gets stats from a repository. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String INDEX_FIELD_TITLE
public static final java.lang.String INDEX_FIELD_TRACK_NUMBER
public static final java.lang.String INDEX_FIELD_ARTIST
public static final java.lang.String INDEX_FIELD_ALBUM_ARTIST
public static final java.lang.String INDEX_FIELD_ALBUM
public static final java.lang.String INDEX_FIELD_COMPOSER
public static final java.lang.String INDEX_FIELD_YEAR
public static final java.lang.String INDEX_FIELD_GENRE
public static final java.lang.String INDEX_FIELD_DURATION
public static final java.lang.String INDEX_FIELD_BITRATE
public static final java.lang.String INDEX_FIELD_FREQUENCY
public static final java.lang.String INDEX_FIELD_SCORE
public static final java.lang.String INDEX_FIELD_LYRICS
public static final java.lang.String INDEX_FIELD_FILENAME
public static final java.lang.String INDEX_FIELD_URL
| Method Detail |
|---|
public static RepositoryHandler getInstance()
public java.lang.Runnable getAfterStartActionsRunnable()
public void addAndRefresh(java.util.List<java.io.File> files,
java.io.File folder)
files - the filesfolder - the folder
public void addExternalPictureForAlbum(java.lang.String artistName,
java.lang.String albumName,
java.io.File picture)
artistName - the artist namealbumName - the album namepicture - the picturepublic void finish()
public java.util.Map<java.lang.String,java.lang.Integer> getAlbumMostPlayed()
public java.util.List<Album> getAlbums()
public java.lang.Integer getAlbumTimesPlayed(AudioFile song)
song - the song
public java.util.Map<java.lang.String,Artist> getArtistAndAlbumStructure()
public java.util.Map<java.lang.String,java.lang.Integer> getArtistMostPlayed()
public java.util.List<Artist> getArtists()
public java.lang.Integer getArtistTimesPlayed(AudioFile song)
song - the song
public int getDifferentSongsPlayed()
public AudioFile getFileIfLoaded(java.lang.String fileName)
fileName - the file name
public java.util.Map<java.lang.String,Folder> getFolderStructure()
public java.util.Map<java.lang.String,Genre> getGenreStructure()
public java.util.List<Album> getMostPlayedAlbums(int n)
n - the n
public java.util.List<java.lang.Object[]> getMostPlayedAlbumsInRanking(int n)
n - the n
public java.util.List<Artist> getMostPlayedArtists(int n)
n - the n
public java.util.List<java.lang.Object[]> getMostPlayedArtistsInRanking(int n)
n - the n
public java.util.List<AudioFile> getMostPlayedSongs(int n)
n - the n
public java.util.List<java.lang.Object[]> getMostPlayedSongsInRanking(int n)
n - the n
public java.lang.String getPathForNewSongsRipped()
public Repository getRepository()
public java.io.File getRepositoryFolderContainingFile(AudioFile file)
file - the file
public java.lang.String getRepositoryPath()
public long getRepositoryTotalSize()
public java.util.Map<AudioFile,java.lang.Integer> getSongMostPlayed()
public java.util.List<AudioFile> getSongs()
public java.util.List<AudioFile> getSongsForAlbums(java.util.Map<java.lang.String,Album> albums)
albums - the albums
public java.util.List<AudioFile> getSongsForArtists(java.util.Map<java.lang.String,Artist> artists)
artists - the artists
public java.lang.String getSongsPlayed()
public SongStats getSongStatistics(AudioFile song)
song - the song
public int getTotalSongsPlayed()
public java.util.List<AudioFile> getUnplayedSongs()
public boolean isRepository(java.io.File folder)
folder - the folder
public void notifyCancel()
public void notifyCurrentPath(java.lang.String dir)
LoaderListener
notifyCurrentPath in interface LoaderListenerdir - the pathpublic void notifyFileLoaded()
LoaderListener
notifyFileLoaded in interface LoaderListenerpublic void notifyFilesInRepository(int totalFiles)
LoaderListener
notifyFilesInRepository in interface LoaderListenertotalFiles - the filespublic void notifyFinishRead(RepositoryLoader loader)
LoaderListener
notifyFinishRead in interface LoaderListenerloader - the loaderpublic void notifyFinishRefresh(RepositoryLoader loader)
LoaderListener
notifyFinishRefresh in interface LoaderListenerloader - the loaderpublic void notifyRemainingTime(long millis)
LoaderListener
notifyRemainingTime in interface LoaderListenermillis - the timepublic java.lang.Runnable getReadRepositoryFromCacheRunnable()
public void setRepository()
public void refreshFile(AudioFile file)
file - the filepublic void refreshRepository()
public void removePhysically(java.util.List<AudioFile> filesToRemove)
filesToRemove - Files that should be removedpublic boolean repositoryIsNull()
public boolean retrieve(java.util.List<java.io.File> folders)
folders - the folders
public boolean selectRepository()
public boolean selectRepository(boolean repositoryNotFound)
repositoryNotFound - the repository not found
public void setSongStatistics(AudioFile song)
song - the new song statisticspublic java.util.List<AudioObject> sort(java.util.List<? extends AudioObject> songs)
songs - the songs
public java.util.List<AudioObject> sort(java.util.List<? extends AudioObject> songs,
RepositoryHandler.SortType type)
songs - the songstype - the type
public void transferStatsFrom(Repository newRepository,
Repository oldRepository)
oldRepository - the old repositorynewRepository - the new repositorypublic java.util.List<java.lang.String> getSearchableAttributes()
SearchableObject
getSearchableAttributes in interface SearchableObjectpublic java.lang.String getSearchableObjectName()
SearchableObject
getSearchableObjectName in interface SearchableObjectpublic java.lang.String getPathToIndex()
SearchableObject
getPathToIndex in interface SearchableObject
public java.util.List<SearchResult> getSearchResult(Hits hits)
throws CorruptIndexException,
java.io.IOException
SearchableObject
getSearchResult in interface SearchableObjecthits - the hits
CorruptIndexException - the corrupt index exception
java.io.IOException - Signals that an I/O exception has occurred.public java.util.List<AudioObject> getElementsToIndex()
SearchableObject
getElementsToIndex in interface SearchableObjectpublic Document getDocumentForElement(AudioObject audioObject)
SearchableObject
getDocumentForElement in interface SearchableObjectaudioObject - the audio object
public SearchResultTableModel getSearchResultsTableModel(java.util.List<SearchResult> results)
SearchableObject
getSearchResultsTableModel in interface SearchableObjectresults - the results
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||