Class Login
- java.lang.Object
-
- aero.panasonic.inflight.services.user.v2.login.Login
-
public class Login extends java.lang.ObjectPackage Starting Point - This class is used by client to make API calls to the Login service provided by User framework.
Login is single point of contact for application for session related services. Login class should be used for authenticating the user. Once authenticated, other user services supported by the SDK can be used.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceLogin.LoginCompleteListenerLogin state has changed.static interfaceLogin.LogoutCompleteListenerLogout state has changed.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSDK_VERSIONFor internal use
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LoginStategetLoginSate()Gets login state.static voidinitService(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.voidloginUserWithCredentials(UserLoginRequest userLoginRequest, Login.LoginCompleteListener listener)Logs in the user with credentials.voidlogout(Login.LogoutCompleteListener listener)Logs out the user.
-
-
-
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-IInFlightCallbackReturns the instance or error message.inFlight- Initializes an InFlight instance.- Example:
AnalyticsV1.initService(context, inflightCallbackListener); public void onInitServiceComplete(Object serviceObj,String serviceName) { if(serviceName.equals(InFlightServices.USER_LOGIN_V1_SERVICE.getServiceName()}) { mSessionV1 = (Login) serviceObj; } }
-
getLoginSate
public LoginState getLoginSate()
Gets login state.- Returns:
LoginState
-
loginUserWithCredentials
public void loginUserWithCredentials(UserLoginRequest userLoginRequest, Login.LoginCompleteListener listener)
Logs in the user with credentials.- Parameters:
userLoginRequest-UserLoginRequestlistener- callback invoked upon login completion.
-
logout
public void logout(Login.LogoutCompleteListener listener)
Logs out the user.- Parameters:
listener- callback invoked upon logout completion.
-
-