net.sourceforge.atunes.kernel.handlers
Class ApplicationDataHandler

java.lang.Object
  extended by net.sourceforge.atunes.kernel.handlers.ApplicationDataHandler
All Implemented Interfaces:
ApplicationFinishListener

public class ApplicationDataHandler
extends java.lang.Object
implements ApplicationFinishListener

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


Method Summary
 void applicationFinish()
          Called when application finishes
 java.lang.Runnable getApplyStateRunnable()
          Process to apply state.
static ApplicationDataHandler getInstance()
          Gets the single instance of ApplicationDataHandler.
protected  void persistDeviceCache(java.lang.String deviceId, Repository deviceRepository)
           
 boolean readState()
          Read state stored.
protected  Repository retrieveDeviceCache(java.lang.String deviceId)
          Reads device cache.
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.
 
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

applicationFinish

public void applicationFinish()
Description copied from interface: ApplicationFinishListener
Called when application finishes

Specified by:
applicationFinish in interface ApplicationFinishListener

getApplyStateRunnable

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

Returns:
the apply state runnable

persistDeviceCache

protected void persistDeviceCache(java.lang.String deviceId,
                                  Repository deviceRepository)

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

retrieveDeviceCache

protected Repository retrieveDeviceCache(java.lang.String deviceId)
Reads device cache.

Returns:
The retrieved device


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