Ejemplo n.º 1
0
 @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();
 }
Ejemplo n.º 2
0
 private AuthContext createContext() {
   AuthContext context = new AuthContext();
   context.put(AUTH_TOKEN_KEY, client.getAuthToken());
   context.put(STORAGE_URL_KEY, client.getStorageURL());
   return context;
 }
Ejemplo n.º 3
0
 @Override
 public void dispose() {
   super.dispose();
   client.dispose();
 }