示例#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();
 }
示例#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;
 }
示例#3
0
 @Override
 public void dispose() {
   super.dispose();
   client.dispose();
 }