Class SeatLogin


  • public class SeatLogin
    extends java.lang.Object

    Package Starting Point - This class is used by client to make API calls to Login service provided by User framework in the seat.



    This class is responsible for logging a seat device to the ground server for synchronization.
    • Field Detail

      • LOGIN_FIELD_EMAIL_ADDRESS

        public static final java.lang.String LOGIN_FIELD_EMAIL_ADDRESS
        Email address.
        See Also:
        Constant Field Values
      • LOGIN_FIELD_FREQUENT_FLYER_NUMBER

        public static final java.lang.String LOGIN_FIELD_FREQUENT_FLYER_NUMBER
        Frequent flyer number.
        See Also:
        Constant Field Values
      • LOGIN_FIELD_FREQUENT_FLYER_NUMBER_LAST_4_DIGITS

        public static final java.lang.String LOGIN_FIELD_FREQUENT_FLYER_NUMBER_LAST_4_DIGITS
        Last 4 digits of the frequent flyer number.
        See Also:
        Constant Field Values
      • LOGIN_FIELD_OPERATOR_AND

        public static final java.lang.String LOGIN_FIELD_OPERATOR_AND
        All the login fields listed were required.
        See Also:
        Constant Field Values
      • LOGIN_FIELD_OPERATOR_OR

        public static final java.lang.String LOGIN_FIELD_OPERATOR_OR
        Only on of the login fields was required.
        See Also:
        Constant Field Values
    • Method Detail

      • initService

        public static void initService​(Context context,
                                       IInFlightCallback inFlightCallback,
                                       InFlight inFlight)
        This API is the starting point for Login. Initializes the service object and returns the object with the IInFlightCallback.
        Parameters:
        context - Provides access to resources and classes to initialize the object.
        inFlightCallback - IInFlightCallback Returns the instance or error message.
        inFlight - Initializes an InFlight instance.
        Example:
         Login.initService(context, inflightCallbackListener);
         

        public void onInitServiceComplete(Object serviceObj,String serviceName) { if(serviceObj != null) { mLogin = (Login) serviceObj; } }

      • isLoginReady

        public boolean isLoginReady()
        Return whether login is available and the server is ready for user to login.
        Returns:
        true if login is available and the server is ready for user to login.
      • isPdiAvailable

        public boolean isPdiAvailable()
        Return whether server pdi data available.
        Returns:
        whether server pdi data available.
      • getLoginState

        public LoginState getLoginState()
        Return login state as LoginState
        Returns:
        login state.
      • getLoginFieldsNeeded

        public java.lang.String getLoginFieldsNeeded()
        Return seat login fields as a json string. If the duplicate error found during the login process, then again need to call the method to get the updated login field. For example:
         {
          "authFields": {
           "fields": [
             "email_address",
             "frequent_flyer_number"
           ],
           "operator": "or",
           "hashFields": null
           }
         }
         
        or
         {
          "authFields": {
          "operator": "and",
          "fields": [
             "pii.first_name",
             "pii.last_name",
             "travel_info.passenger_name_record"
           ]
          },
          "hashFields": [
             "pii.first_name",
             "pii.last_name"
           ]
          }
         
        Returns:
        a json formatted string.
      • login

        public void login​(java.util.Map<java.lang.String,​java.lang.String> loginFields,
                          boolean logoutPreviousSeat)
        Login from the seat with login fields. Must call getLoginFieldsNeeded() to determine what fields were required for login.
        Parameters:
        loginFields - A map of login fields and value associated with it.
      • logout

        public void logout()
        Logout from the seat.
      • resetLoginFieldsNeeded

        public void resetLoginFieldsNeeded()
        Reset login fields need.