Class FavoritesListV1
- java.lang.Object
-
- aero.panasonic.inflight.services.user.favorites.FavoritesListV1
-
public class FavoritesListV1 extends java.lang.ObjectPackage Starting Point - The Favorites List, 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 Favorites List can be used over multiple flights, if persisted, and passengers can add and remove media content at any time.
When used with the SeatPairing APIs, passengers can create and modify their Favorites List while on the ground. During the flight, passengers can playback their favorite content that is available on the flight. The content displays on the various inflight monitors, such as seatback, IPSC and secondary monitors.
After the flight, the Favorites List can be synchronized with the Favorites List on their personal device to ensure the passengers capture their latest favorite content.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceFavoritesListV1.RemoteFavoritesListUpdateListenerstatic interfaceFavoritesListV1.SeatFavoritesListUpdateListener
-
Constructor Summary
Constructors Constructor Description FavoritesListV1()Deprecated.FavoritesListV1(Context appContext)Creates a Favorites List of media content, such as movies, music and audio books.FavoritesListV1(JSONArray jsonArray)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(FavoriteItem favoriteItem)Adds a single item to the end of the media queue.intadd(java.util.List<FavoriteItem> favoriteItems)Adds all new media items to the end of the Favourite List, then returns the number of items on the Favorites List.voidclear()Clears all media content from the Favorites List.voidfromSerializedData(JSONArray jsonArray)Serializes the Favorites List prior to being sent to the inflight monitors.java.util.List<FavoriteItem>getItems()Gets a list of all media content, such as movies, music and audio books, in the Favorites List.java.util.ArrayList<FavoriteItem>getItemsByContentType(java.lang.String contentType)Returns a list of media items by contentType, such as AOD, VOD, TV or radio.static voidinitService(Context context, IInFlightCallback inFlightCallback, InFlight inFlight)This api is the starting point for FavoritesListV1.voidremove(int index)Removes the media content from the Favorites List at a specified index.booleanremove(FavoriteItem favoriteItem)Removes a media content from the Favorites List.booleanremove(java.lang.String mediaUr)Removes the specified media content from the Favorites List.booleanrestoreFromDisk(Context appContext)Gets a Favorites List that was persisted and saved to disk.voidsaveToDisk(Context appContext)Persists the Favorites List by saving it to disk on the device.voidsetRemoteFavoritesListUpdateListener(FavoritesListV1.RemoteFavoritesListUpdateListener listener)Sets a listener to listen for the favorites updates on the remote device.voidsetSeatFavoritesListUpdateListener(FavoritesListV1.SeatFavoritesListUpdateListener listener)Sets a listener to listen for the favorites updates on the seat.JSONArraytoSerializedData()Exports the Favorites List for synchronizing on the inflight monitors.java.lang.StringtoString()Exports the favorites list for logging purposes.
-
-
-
Constructor Detail
-
FavoritesListV1
public FavoritesListV1()
Deprecated.Creates a Favorites List of media content, such as movies, music and audio books, on a device.
This call does not retrieve a current Favorites List, if one exists.
-
FavoritesListV1
public FavoritesListV1(JSONArray jsonArray)
Deprecated.Serializes the Favorites List prior to being sent to the inflight monitors. This allows the Favorites List to be synchronized between the personal device and the inflight monitors.- Parameters:
jsonArray- serializes the data
-
FavoritesListV1
public FavoritesListV1(Context appContext)
Creates a Favorites List of media content, such as movies, music and audio books. If a previous Favorites List with the same name exists, that Favorites List will load.- Parameters:
appContext- The existing Favorites List
-
-
Method Detail
-
initService
public static void initService(Context context, IInFlightCallback inFlightCallback, InFlight inFlight)This api is the starting point for FavoritesListV1. 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:
FavoritesListV1.initService(context, inflightCallbackListener); public void onInitServiceComplete(Object serviceObj,String serviceName) { if(serviceName.equals(InFlightServices.FAVORITES_LIST_V1_SERVICE.getServiceName())) { mFavoritesListV1 = (FavoritesListV1) serviceObj; mFavoritesListV1.add(favoriteItem); } }
-
fromSerializedData
public void fromSerializedData(JSONArray jsonArray)
Serializes the Favorites List prior to being sent to the inflight monitors. This allows the Favorites List to be synchronized between the personal device and the inflight monitors.- Parameters:
jsonArray- serializes the data
-
getItems
public java.util.List<FavoriteItem> getItems()
Gets a list of all media content, such as movies, music and audio books, in the Favorites List.- Returns:
-
saveToDisk
public void saveToDisk(Context appContext)
Persists the Favorites List by saving it to disk on the device.
-
restoreFromDisk
public boolean restoreFromDisk(Context appContext)
Gets a Favorites List that was persisted and saved to disk.- Parameters:
appContext- The exisitng Favorites List.- Returns:
- True, if Favorites List retrieved successfully.
False, if no Favorites List is retrieved.
-
add
public int add(java.util.List<FavoriteItem> favoriteItems)
Adds all new media items to the end of the Favourite List, then returns the number of items on the Favorites List.- Parameters:
favoriteItems- A list of items to be added to the Favorites List- Returns:
- The number of items added
-
add
public boolean add(FavoriteItem favoriteItem)
Adds a single item to the end of the media queue. This call verifies the media content is not currently in the Favorites List. The list cannot contain identical media content.- Parameters:
favoriteItem- to be added- Returns:
- True, if added.
False, if the content is identical to content currently in the Favorites List.
-
remove
public boolean remove(FavoriteItem favoriteItem)
Removes a media content from the Favorites List.- Parameters:
favoriteItem- The favorite item removed. It's removed as an object/- Returns:
- True, if collection was modified
False, if not modified.
-
remove
public boolean remove(java.lang.String mediaUr)
Removes the specified media content from the Favorites List.- Parameters:
mediaUr- The media content to be removed- Returns:
- True, if collection was modified
False, if not modified.
-
remove
public void remove(int index)
Removes the media content from the Favorites List at a specified index.- Parameters:
index- of the media content to be removed.
-
clear
public void clear()
Clears all media content from the Favorites List.
-
getItemsByContentType
public java.util.ArrayList<FavoriteItem> getItemsByContentType(java.lang.String contentType)
Returns a list of media items by contentType, such as AOD, VOD, TV or radio.
If there are no matching items, it return an empty list.- Parameters:
contentType- The media content type, such as AOD, VOD, TV or radio- Returns:
- List of
FavoriteItem
-
toSerializedData
public JSONArray toSerializedData()
Exports the Favorites List for synchronizing on the inflight monitors. This function requires the personal device to be paired with the seatback monitor. For additional information, please refer to the Seat Pairing module.- Returns:
-
toString
public java.lang.String toString()
Exports the favorites list for logging purposes.- Overrides:
toStringin classjava.lang.Object- Returns:
-
setSeatFavoritesListUpdateListener
public void setSeatFavoritesListUpdateListener(FavoritesListV1.SeatFavoritesListUpdateListener listener)
Sets a listener to listen for the favorites updates on the seat.- Parameters:
listener-FavoritesListV1.SeatFavoritesListUpdateListenercallback invoked on update of favorites list on the seatback monitor. This listener is invoked only in seatback monitor when updates to FavoritesListV1 is carried out by invocation of "add", or "remove" APIs.- Since:
- v03.00.0.43
-
setRemoteFavoritesListUpdateListener
public void setRemoteFavoritesListUpdateListener(FavoritesListV1.RemoteFavoritesListUpdateListener listener)
Sets a listener to listen for the favorites updates on the remote device.- Parameters:
listener-FavoritesListV1.RemoteFavoritesListUpdateListenercallback invoked on update of favorites on the seatback monitor. This listener is invoked only in IFE devices connected to a seatback monitor say video handset or ipsc.- Since:
- v03.00.0.43
-
-