net.sourceforge.atunes.kernel.handlers
Class ApplicationDataHandler

java.lang.Object
  extended by net.sourceforge.atunes.kernel.handlers.ApplicationDataHandler

public class ApplicationDataHandler
extends java.lang.Object

This class is responsible of read, write and apply application state, and caches.


Method Summary
 java.lang.Runnable getApplyStateRunnable()
          Process to apply state.
static ApplicationDataHandler getInstance()
          Gets the single instance of ApplicationDataHandler.
 void persistFavoritesCache(Favorites favorites)
          Stores favorites cache.
 void persistPlayList()
          Stores play lists.
 void persistPodcastFeedCache(java.util.List<PodcastFeed> podcastFeeds)
          Stores podcast feeds.
 void persistPresetRadioCache(java.util.List<Radio> radios)
          Persist preset radio cache.
 void persistRadioCache(java.util.List<Radio> radios)
          Stores radios.
 void persistRepositoryCache(Repository repository)
          Stores repository cache.
 boolean readState()
          Read state stored.
protected  Favorites retrieveFavoritesCache()
          Reads repository cache.
protected  ListOfPlayLists retrievePlayListCache()
          Reads play list cache.
protected  java.util.List<PodcastFeed> retrievePodcastFeedCache()
          Reads podcast feed cache.
protected  java.util.List<Radio> retrieveRadioCache()
          Reads radio cache.
protected  java.util.List<Radio> retrieveRadioPreset()
          Reads radio cache.
protected  Repository retrieveRepositoryCache()
          Reads repository cache.
 void storeState()
          Stores state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ApplicationDataHandler getInstance()
Gets the single instance of ApplicationDataHandler.

Returns:
single instance of ApplicationDataHandler

getApplyStateRunnable

public java.lang.Runnable getApplyStateRunnable()
Process to apply state.

Returns:
the apply state runnable

persistFavoritesCache

public void persistFavoritesCache(Favorites favorites)
Stores favorites cache.

Parameters:
favorites - Favorites that should be persisted

persistPlayList

public void persistPlayList()
Stores play lists.


persistPodcastFeedCache

public void persistPodcastFeedCache(java.util.List<PodcastFeed> podcastFeeds)
Stores podcast feeds.

Parameters:
podcastFeeds - Podcast feeds that should be persist

persistRadioCache

public void persistRadioCache(java.util.List<Radio> radios)
Stores radios.

Parameters:
radios - Radios that should be persisted

persistPresetRadioCache

public void persistPresetRadioCache(java.util.List<Radio> radios)
Persist preset radio cache.

Parameters:
radios - the radios

persistRepositoryCache

public void persistRepositoryCache(Repository repository)
Stores repository cache.

Parameters:
repository - The retrieved repository

readState

public boolean readState()
Read state stored.

Returns:
if the state could be read

retrieveFavoritesCache

protected Favorites retrieveFavoritesCache()
Reads repository cache.

Returns:
The retrieved favorites

retrievePlayListCache

protected ListOfPlayLists retrievePlayListCache()
Reads play list cache.

Returns:
The retrieved play list

retrievePodcastFeedCache

protected java.util.List<PodcastFeed> retrievePodcastFeedCache()
Reads podcast feed cache.

Returns:
The retrieved podcast feeds

retrieveRadioCache

protected java.util.List<Radio> retrieveRadioCache()
Reads radio cache.

Returns:
The retrieved radios

retrieveRadioPreset

protected java.util.List<Radio> retrieveRadioPreset()
Reads radio cache. Preset stations. This file is not meant to be edited.

Returns:
The retrieved radios

retrieveRepositoryCache

protected Repository retrieveRepositoryCache()
Reads repository cache.

Returns:
The retrieved repository

storeState

public void storeState()
Stores state.



Copyright © 2006-2008 The aTunes Team. All Rights Reserved.