Class Bookmarks
- java.lang.Object
-
- aero.panasonic.inflight.services.user.v2.Sync
-
- aero.panasonic.inflight.services.user.v2.bookmark.Bookmarks
-
public class Bookmarks extends Sync
Package Starting Point - Bookmarks, a component of the User module, manages the bookmarks that passengers can create.
A bookmark allows passengers to return to a location in a specific mediaUri without scrolling. For example, the position of the playback when the media was stopped. When playback resumes, the media starts playing from that specific location.
If synchronized, the same bookmark list can be used over multiple flights and passengers can add and removeBookmarkat any time.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classBookmarks.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 booleanadd(Bookmark bookmark)Adds a single bookmark item to the end of the bookmark list.voidclear()Clears the bookmark list.java.util.List<BookmarkConflictItem>getConflicts()Gets a list of theConflictItemjava.util.Map<java.lang.String,java.util.List<Bookmark>>getItems()Gets a map of items with their associatedBookmark.static voidinitService(Context context, IInFlightCallback inFlightCallback, InFlight inFlight)This API is the starting point for Bookmarks -- Initializes the service object and returns the object with the IInFlightCallback.booleanremove(Bookmark bookmark)Removes an item from the bookmark list.booleanremove(java.lang.String mediaUri)Removes the specified item from the bookmark list.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 namejava.lang.StringtoString()For internal use
-
-
-
Method Detail
-
initService
public static void initService(Context context, IInFlightCallback inFlightCallback, InFlight inFlight)This API is the starting point for Bookmarks -- Initializes the service object and returns the object with the IInFlightCallback.- Parameters:
context- Provides access to resources and classes to initialize the object.inFlightCallback-IInFlightCallbackReturns the instance or error message.inFlight- Initializes an InFlight instance.- Example:
Bookmarks.initService(context, inflightCallbackListener); public void onInitServiceComplete(Object serviceObj,String serviceName) { if(serviceName.equals(InFlightServices.USER_BOOKMARK_V1_SERVICE.getServiceName())) { mBookmarkV1 = (Bookmarks) serviceObj; mBookmarkV1.add(bookmark); } }
-
getItems
public java.util.Map<java.lang.String,java.util.List<Bookmark>> getItems()
Gets a map of items with their associatedBookmark.- Returns:
- Media URIs with their associated bookmarks.
-
add
public boolean add(Bookmark bookmark) throws UserOperationException
Adds a single bookmark item to the end of the bookmark list.
If the media URI is identical to a media URI currently in the playlist, the media URI will not be added.- Parameters:
bookmark- to be added- Returns:
- True, if bookmark is added. If not added, the value is False.
- Throws:
UserOperationException
-
remove
public boolean remove(Bookmark bookmark) throws UserOperationException
Removes an item from the bookmark list.
The media URI is removed as an object.- Parameters:
bookmark- Bookmark item removed as an object.- Returns:
- True, if the bookmark object was removed. If not removed, value is False.
- Throws:
UserOperationException
-
remove
public boolean remove(java.lang.String mediaUri) throws UserOperationExceptionRemoves the specified item from the bookmark list.- Parameters:
mediaUri- The media content to be removed- Returns:
- True, if collection was modified
False, if not modified. - Throws:
UserOperationException
-
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
-
getConflicts
public java.util.List<BookmarkConflictItem> getConflicts()
Description copied from class:SyncGets a list of theConflictItem- Overrides:
getConflictsin classSync- Returns:
- List of synchronization conflicts
-
clear
public void clear() throws UserOperationExceptionClears the bookmark list.- Throws:
UserOperationException
-
toString
public java.lang.String toString()
For internal use- Overrides:
toStringin classjava.lang.Object
-
-