private synchronized Swift getSwiftClient ( ) throws CStorageException { if ( swiftClient != null ) { return swiftClient ; } // Only a single thread should create this client String url = ENDPOINT + "/account/credentials" ; RequestInvoker < CResponse > ri = getApiRequestInvoker ( new HttpGet ( url ) ) ; JSONObject info = retryStrategy . invokeRetry ( ri ) . asJSONObject ( ) ; swiftClient = new Swift ( info . getString ( "endpoint" ) , info . getString ( "token" ) , new NoRetryStrategy ( ) , true , // useDirectoryMarkers httpExecutor ) ; swiftClient . useFirstContainer ( ) ; return swiftClient ; }
Return current swift client or create one if none exists yet . The internal swift client does NOT retry its requests . Retries are performed by this class .