Class Custom
- java.lang.Object
-
- aero.panasonic.inflight.services.user.v2.Sync
-
- aero.panasonic.inflight.services.user.v2.custom.Custom
-
public class Custom extends Sync
Package Starting Point - Custom persists the custom value set by the seat.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classCustom.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 voidaddCustomSetting(java.lang.String settingName, JSONObject custom)Add a custom setting with a setting namejava.util.List<CustomConflictItem>getConflicts()Gets a list of theConflictItemJSONObjectgetCustomSetting()Get all the custom settings.JSONObjectgetCustomSetting(java.lang.String settingName)Get custom setting associate with settingName.static voidinitService(Context context, IInFlightCallback inFlightCallback, InFlight inFlight)This API is the starting point for Custom.voidremoveCustomSetting(java.lang.String settingName)Remove custom setting associate with settingName.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 Custom. 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:
Custom.initService(context, inflightCallbackListener); public void onInitServiceComplete(Object serviceObj,String serviceName) { if(serviceObj != null) { mCustom = (Custom) serviceObj; } }
-
addCustomSetting
public void addCustomSetting(java.lang.String settingName, JSONObject custom)Add a custom setting with a setting name- Parameters:
settingName- Setting name associate with the custom setting item.custom- Custom setting item store in the seat.This must be aJSONObject.- Example:
JSONObject display = new JSONObject(); display.put("brightness", 100); display.put("lighting", 100); custom.addCustomSetting("display", display);
-
removeCustomSetting
public void removeCustomSetting(java.lang.String settingName)
Remove custom setting associate with settingName.- Parameters:
settingName- custom setting key.
-
getCustomSetting
public JSONObject getCustomSetting(java.lang.String settingName)
Get custom setting associate with settingName.- Parameters:
settingName- custom setting key.- Returns:
-
getConflicts
public java.util.List<CustomConflictItem> getConflicts()
Description copied from class:SyncGets a list of theConflictItem- Overrides:
getConflictsin classSync- Returns:
- List of synchronization conflicts
-
getCustomSetting
public JSONObject getCustomSetting()
Get all the custom settings.- Returns:
-
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
-
-