Class PlaylistManager
- java.lang.Object
-
- aero.panasonic.inflight.services.user.v2.Sync
-
- aero.panasonic.inflight.services.user.v2.playlist.PlaylistManager
-
public class PlaylistManager extends Sync
Package Starting Point - The PlaylistManager, a component of the User module, allows passengers to create a list of media content, such as movies, music or audiobooks, on their personal electronic devices (PED).
The same Playlist can be used over multiple flights, if synchronized, and passengers can add and remove media content at any time.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classPlaylistManager.ConflictKeys-
Nested classes/interfaces inherited from class aero.panasonic.inflight.services.user.v2.Sync
Sync.SyncListener
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PlaylistcreatePlaylist(java.lang.String playlistName)java.util.List<PlaylistConflictItem>getConflicts()Gets a list of theConflictItemPlaylistgetFavoritesList()PlaylistgetPlaylistByName(java.lang.String playlistName)Returns the Playlist object for the playlist name givenjava.util.List<Playlist>getPlaylists()Returns all the playlistsstatic voidinitService(Context context, IInFlightCallback inFlightCallback, InFlight inFlight)This api is the starting point for Playlist.voidremovePlaylist(java.lang.String playlistName)voidsetConflictStrategy(ConflictStrategy strategy)Sets the strategy for resolving conflicts.voidsetSyncListener(Sync.SyncListener syncListener)Sets a listener to listen for the syncronization updates.voidsynchronize()Triggers the synchronization.Create new playlist with nameCreate new playlist with name
-
-
-
Method Detail
-
initService
public static void initService(Context context, IInFlightCallback inFlightCallback, InFlight inFlight)This api is the starting point for Playlist. The service object will be provided viaIInFlightCallbackonce it has been initialized.- Parameters:
context- - ContextinFlightCallback-IInFlightCallback- this callback will be invoked once service has been initialized.inFlight- - Reference of InFlight- Example:
FavoritesList.initService(context, inflightCallbackListener); public void onInitServiceComplete(Object serviceObj,String serviceName) { if(serviceName.equals(InFlightServices.USER_PLAYLIST_V1_SERVICE.getServiceName())) { playlistV1 = (Playlist) serviceObj; playlistV1.add(playlistItem); } }
-
createPlaylist
public Playlist createPlaylist(java.lang.String playlistName) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getPlaylistByName
public Playlist getPlaylistByName(java.lang.String playlistName)
Returns the Playlist object for the playlist name given- Parameters:
playlistName- name of the playlist- Returns:
- Playlist
-
getPlaylists
public java.util.List<Playlist> getPlaylists()
Returns all the playlists- Returns:
-
removePlaylist
public void removePlaylist(java.lang.String playlistName)
-
getFavoritesList
public Playlist getFavoritesList()
-
getConflicts
public java.util.List<PlaylistConflictItem> getConflicts()
Description copied from class:SyncGets a list of theConflictItem- Overrides:
getConflictsin classSync- Returns:
- List of synchronization conflicts
-
setSyncListener
public void setSyncListener(Sync.SyncListener syncListener)
Description copied from class:SyncSets a listener to listen for the syncronization updates.- Overrides:
setSyncListenerin classSync- Parameters:
syncListener-Sync.SyncListenercallback invoked indicating the result of sync operation performed.
-
setConflictStrategy
public void setConflictStrategy(ConflictStrategy strategy)
Description copied from class:SyncSets the strategy for resolving conflicts.ConflictStrategy
Default isConflictStrategy.USER_DEFINED- Overrides:
setConflictStrategyin classSync
-
synchronize
public void synchronize()
Description copied from class:SyncTriggers the synchronization.Create new playlist with nameCreate new playlist with name- Overrides:
synchronizein classSync
-
-