@Override public AuthContext login() { super.login(); try { client.login(); } catch (SocketTimeoutException ste) { throw new AuthTimeoutException(ste); } catch (ConnectTimeoutException cte) { throw new AuthTimeoutException(cte); } catch (InterruptedIOException ie) { throw new AuthInterruptedException(ie); } catch (SwiftAuthClientException se) { throw new AuthException(se.getMessage(), se); } catch (Exception e) { throw new AuthException(e); } return createContext(); }
private AuthContext createContext() { AuthContext context = new AuthContext(); context.put(AUTH_TOKEN_KEY, client.getAuthToken()); context.put(STORAGE_URL_KEY, client.getStorageURL()); return context; }
@Override public void dispose() { super.dispose(); client.dispose(); }