protected LoginAPI getLoginAPI() { return getLoginAPI(LoginAPI.class); }
protected LoginAPI getLoginAPI() { return getLoginAPI(LoginAPI.class); }
/** * Connects a user, identified by his (her) username and password, in order to use API methods of a tenant. * * @param username * the user name * @param password * the password * @throws LoginException * occurs when an exception is thrown during the login (userName does not exist, or couple (userName, password) is incorrect) * @since 7.2 */ public void login(String username, String password) throws LoginException { session = getLoginAPI(LoginAPI.class).login(username, password); }
/** * Connects a user, identified by his (her) username and password, in order to use API methods of a tenant. * * @param username * the user name * @param password * the password * @throws LoginException * occurs when an exception is thrown during the login (userName does not exist, or couple (userName, password) is incorrect) * @since 7.2 */ public void login(String username, String password) throws LoginException { session = getLoginAPI(LoginAPI.class).login(username, password); }
/** * Disconnect user from tenant APIs. * * @since 7.2 */ public void logout() throws LogoutException { try { if (session != null) { getLoginAPI().logout(session); session = null; } } catch (SessionNotFoundException ignored) { // If the session is not found on server, then the client is already logged out. // Do nothing } }
/** * Disconnect user from tenant APIs. * * @since 7.2 */ public void logout() throws LogoutException { try { if (session != null) { getLoginAPI().logout(session); session = null; } } catch (SessionNotFoundException ignored) { // If the session is not found on server, then the client is already logged out. // Do nothing } }