Class ServiceDiscoveryV1
- java.lang.Object
-
- aero.panasonic.inflight.services.servicediscovery.ServiceDiscoveryV1
-
public class ServiceDiscoveryV1 extends java.lang.ObjectPackage Starting Point - The ServiceDiscovery API allows passengers to quickly discover the services, such as media or hospitality, available on the aircraft.
For instance, passengers on the ground can access the movies available on their flight and create a playlist for viewing during their flight. This class lists all available services and their corresponding state.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceServiceDiscoveryV1.ServerStatusCallbackstatic interfaceServiceDiscoveryV1.ServerStatusChangedListenerThe ServerStatusChangedListener is invoked when the reachability to the server changes.static classServiceDiscoveryV1.ServiceCapabilityclass indicate the service capability.static interfaceServiceDiscoveryV1.ServiceDiscoveryListChangedListenerstatic interfaceServiceDiscoveryV1.ServiceDiscoveryListReadyListenerstatic classServiceDiscoveryV1.ServiceInfoThis class provides api to get information about a particular service and whether the service is enabled or disabled temporarily and/or the service is blocked for usage for the flight.static classServiceDiscoveryV1.ServiceStatestatic interfaceServiceDiscoveryV1.ServiceStateChangedListenerThe ServiceStateChangedListener is invoked when specific service state is changed.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSDK_VERSION
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<ServiceDiscoveryV1.ServiceInfo>getAvailableServices()This api can be used to get the list of available services.static voidgetServerStatus(ServiceDiscoveryV1.ServerStatusCallback callback)This is a convenience function that can be used to check whether the InFlight server is Available without initializing a ServiceDiscoveryV1 instance.ServiceDiscoveryV1.ServiceStategetServiceState(java.lang.String serviceName)This api can be used to get the State of the given service.static voidinitService(Context context, IInFlightCallback inFlightCallback, InFlight inFlight)Initialize a CatalogDataV1 object and return the object with the IInFlightCallback.booleanisServerAvailable()Returns whether InFlight server is available or not.voidsetServerStatusChangedListener(ServiceDiscoveryV1.ServerStatusChangedListener serverStatusChangedListener)voidsetServiceDiscoveryListChangedListener(ServiceDiscoveryV1.ServiceDiscoveryListChangedListener serviceDiscoveryListChangedListener)voidsetServiceStateChangedListener(ServiceDiscoveryV1.ServiceStateChangedListener serviceStateChangedListener)
-
-
-
Method Detail
-
initService
public static void initService(Context context, IInFlightCallback inFlightCallback, InFlight inFlight)Initialize a CatalogDataV1 object and return the object with the IInFlightCallback.- Parameters:
context- : provide a Context to initialize the object.inFlightCallback- : IInFlightCallback will be used to return the instance or providing the error message.inFlight- : provide an InFlight instance to initialize
-
getServerStatus
public static void getServerStatus(ServiceDiscoveryV1.ServerStatusCallback callback)
This is a convenience function that can be used to check whether the InFlight server is Available without initializing a ServiceDiscoveryV1 instance.
-
getAvailableServices
public java.util.List<ServiceDiscoveryV1.ServiceInfo> getAvailableServices()
This api can be used to get the list of available services.- Example:
ServiceDiscoveryV1.initService(activity, inflightCallbackListener, new InFlight()); public void onInitServiceComplete(Object service,String serviceName) { if (service instanceof ServiceDiscoveryV1) { mServiceDiscoveryV1 = (ServiceDiscoveryV1) service; List< SystemServiceInfo > availableServices = mServiceDiscoveryV1.getAvailableServices(); } }
-
getServiceState
public ServiceDiscoveryV1.ServiceState getServiceState(java.lang.String serviceName) throws ServiceDiscoveryInvalidServiceNameException
This api can be used to get the State of the given service.- Parameters:
serviceName-- Returns:
- ServiceState: State of the service
- Throws:
ServiceDiscoveryInvalidServiceNameException- See Also:
ServiceDiscoveryInvalidServiceNameException
-
isServerAvailable
public boolean isServerAvailable()
Returns whether InFlight server is available or not.- Returns:
- true if server is available and false otherwise.
-
setServiceStateChangedListener
public void setServiceStateChangedListener(ServiceDiscoveryV1.ServiceStateChangedListener serviceStateChangedListener)
-
setServerStatusChangedListener
public void setServerStatusChangedListener(ServiceDiscoveryV1.ServerStatusChangedListener serverStatusChangedListener)
-
setServiceDiscoveryListChangedListener
public void setServiceDiscoveryListChangedListener(ServiceDiscoveryV1.ServiceDiscoveryListChangedListener serviceDiscoveryListChangedListener)
-
-