Class ContentDiscovery
- java.lang.Object
-
- aero.panasonic.inflight.services.contentdiscovery.v1.ContentDiscovery
-
public class ContentDiscovery extends java.lang.ObjectPackage Starting Point - The Content Discovery module provides dynamic ways to browse the content metadata and increase the flexibility for searching, filtering and organizing the various content libraries. The content is airline specific.
* Categories can be retrieved by root content type, such as media or games.
Items can be retrieved by the specific content type, such as media.video.movie, media.video.tvepisode and media.audio.music. In addition, Items can be retrieved by descriptor sets, such as genres, languages, actor, director, ratings or a custom value defined by the airline.
This class includes a series of getRequest methods for the various types of data.
With the Request object, the application may call the executeSync or executeAsync method to retrieve data synchronously or asynchronously. For asynchronous calls, data are passed back inContentDiscovery.Listenercallbacks. If the data is retrieved successfully,ContentDiscovery.Listener.onDataReceived(List, RequestBase))} is called.
If an error occurs,ContentDiscovery.Listener.onError(Error, RequestBase))} is called.
To limit the responses, applications can specify request-specific filter parameters, such as seat class, by Set methods.- Since:
- v03.00.0.65
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classContentDiscovery.ErrorStandard Error class for Content Discovery.static classContentDiscovery.ExceptionTheRequestBase.executeSync()method throwsContentDiscovery.Exceptionwhen error occurs.static interfaceContentDiscovery.Listener<T extends ContentDiscoveryData>This interface is used by client to receive a response from the request.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSDK_VERSION
-
Method Summary
-
-
-
Method Detail
-
initService
public static void initService(Context context, IInFlightCallback inFlightCallback, InFlight inFlight)This API is the starting point for Content Discovery -- Initializes the service object and returns the object with the IInFlightCallback.- Parameters:
context- Provides access to resources and classes to initialize the object.inFlightCallback- Returns the instance or error message.inFlight- Initializes anInFlightinstance.- Example:
mInFlight = new InFlight(); mInFlight.setAppId(this, APP_ID); ContentDiscovery.initService(activity, new IInFlightCallback() { @Override public void onInitServiceComplete(Object o, String s) { Log.v(TAG, "onInitServiceComplete() " + s); ContentDiscovery cd = (ContentDiscovery) o; cd.setSeatClass(MetadataV1.SeatClass.ALL); cd.setLanguage("eng"); } @Override public void onInitServiceFailed(String s, InFlight.Error error) { Log.e(TAG, "onInitServiceFailed()", "Service initialization failed", Log.params("service", s, "error", error)); } }, mInFlight);
-
setSeatClass
public void setSeatClass(java.lang.String seatClass)
Sets the seat class, such as first or business.
If not specified, SeatClass.All will be used.- Parameters:
seatClass- Only accepts strings provided bySeatClass, such as first, business or all.
-
setLanguage
public void setLanguage(java.lang.String languageCode)
Sets the ISO 639-3 language code. For example, the language code for English is eng and for German is deu.
If not specified, the default language on the passenger's device is used.
If the specified language is not available, the default language for the airline is returned.- Parameters:
languageCode- ISO 639-3 language code.
-
getBundleRequest
public RequestBundle getBundleRequest()
Fetches aRequestBundleobject, then to retrieve bundles, executeRequestBundle.executeSync()orRequestBundle.executeAsync(ContentDiscovery.Listener)- Returns:
RequestBundlewhich provides methods to execute the request synchronously or asynchronously.
-
getContentTypeRequest
public RequestContentType getContentTypeRequest()
Fetches aRequestContentTypeobject, thenTypeListis retrieved byRequestContentType.executeSync()orRequestContentType.executeAsync(ContentDiscovery.Listener)- Returns:
RequestContentTypewhich provides methods to execute the request synchronously or asynchronously.
-
getCategoriesRequest
public RequestCategory getCategoriesRequest(java.lang.String rootContentType)
Fetches aRequestCategoryobject, thenCategoryis retrieved byRequestCategory.executeSync()orRequestCategory.executeAsync(ContentDiscovery.Listener)- Parameters:
rootContentType- Only accepts strings provided byRootContentType, such as media, games or ebooks.- Returns:
RequestCategorywhich provides methods to execute the request synchronously or asynchronously.
-
getLanguagesRequest
public RequestLanguage getLanguagesRequest()
Fetches aRequestLanguageobject, thenLanguageis retrieved byRequestLanguage.executeSync()orRequestLanguage.executeAsync(ContentDiscovery.Listener)- Returns:
RequestLanguagewhich provides methods to execute the request synchronously or asynchronously.
-
getTagsRequest
public RequestTagName getTagsRequest(java.lang.String contentType)
Fetches aRequestTagNameobject, then to retrieve tags, executeRequestTagName.executeSync()orRequestTagName.executeAsync(ContentDiscovery.Listener)- Parameters:
contentType- Only accepts strings provided byContentType.Type, such as media.*, media.video.* , media.audio.*.- Returns:
RequestTagNamewhich provides methods to execute the request synchronously or asynchronously.
-
getTagValuesRequest
public RequestTag getTagValuesRequest(java.lang.String contentType, java.util.Set<java.lang.String> tagNames)
Fetches aRequestTagobject, thenTagValueis retrieved byRequestTag.executeSync()orRequestTag.executeAsync(ContentDiscovery.Listener)- Parameters:
contentType- Only accepts strings provided byContentType.Type, such as media.*, media.video.* , media.audio.*.tagNames- Sets the pre-defined or custom tag names that can be specific to the airline.- Returns:
RequestTagwhich provides methods to execute the request synchronously or asynchronously.
-
getItemsByTagValueRequest
public RequestItem getItemsByTagValueRequest(java.lang.String contentType, java.util.Map<java.lang.String,java.lang.String> tagNamesToValue)
Fetches aRequestItemobject, thenItemis retrieved byRequestItem.executeSync()orRequestItem.executeAsync(ContentDiscovery.Listener). To get children content, callgetItemsDetailsRequest(java.util.Set<java.lang.String>)- Parameters:
contentType- Only accepts strings provided byContentType.Type, such as media.*, media.video.* , media.audio.*.tagNamesToValue- A map of tag names and values used to filter the items.- Returns:
RequestItemwhich provides methods to execute the request synchronously or asynchronously.
-
getItemsDetailsRequest
public RequestItemDetail getItemsDetailsRequest(java.util.Set<java.lang.String> contentUris)
Fetches aRequestItemDetailobject, thenItemis retrieved byRequestItemDetail.executeSync()orRequestItemDetail.executeAsync(ContentDiscovery.Listener)- Parameters:
contentUris- Content URI is retrieved from theRequestItem. Currently, contentUri and mediaUri are identical. Future plans include additional content URIs, such as shopping.- Returns:
RequestItemDetailwhich provides methods to execute the request synchronously or asynchronously.
-
searchByFieldRequest
public RequestSearchByField searchByFieldRequest(java.util.Map<java.lang.String,java.lang.String> filters)
Fetches aRequestItemDetailobject, thenItemis retrieved byRequestItemDetail.executeSync()orRequestItemDetail.executeAsync(ContentDiscovery.Listener)- Parameters:
filters- Sets the filters, such as duration, category and language code. "AND" operation is performed on multiple filters.- Returns:
RequestSearchByFieldwhich provides methods to execute the request synchronously or asynchronously.
-
searchByTextRequest
public RequestSearchByText searchByTextRequest(java.lang.String text)
Fetches aRequestItemDetailobject, thenItemis retrieved byRequestItemDetail.executeSync()orRequestItemDetail.executeAsync(ContentDiscovery.Listener)- Parameters:
text- Sets the filter text. This is free text that is searched in the Title, Genre, Year, Artist, Actor and Director fields.- Returns:
RequestSearchByTextwhich provides methods to execute the request synchronously or asynchronously.
-
-