private static Client getClient() { return new UrlConnectionClient(); // OkHttpClient client = new OkHttpClient(); // client.setConnectTimeout(60, TimeUnit.SECONDS); // client.setWriteTimeout(60, TimeUnit.SECONDS); // client.setReadTimeout(60, TimeUnit.SECONDS); // return new OkClient(client); }
/** * generic runabove creation manager function. * * @param consumerKey the consumer key * @return the ${e.g(1).rsfl()} */ public RunAboveManager createManager(String consumerKey) { RestAdapter restAdapterSigned = new RestAdapter.Builder() .setEndpoint(RUNABOVE_API_URL) .setErrorHandler(config.getExceptionHandler()) .setClient( new SigningClient(new UrlConnectionClient(), config.getApplicationKey(), config.getApplicationSecret(), consumerKey, config .getExceptionHandler())).build(); // and now all our request are signed and the service can be requested RunAboveManager serviceRunAbove = restAdapterSigned.create(RunAboveManager.class); return serviceRunAbove; }
public AmbariRestClient() { client = new UrlConnectionClient(); //Default Retrofit client }
/** * generic internal signed client builder. * * @param consumerKey the consumer key * @return the signed client */ private SigningClient getSignedClient(String consumerKey) { return new SigningClient(new UrlConnectionClient(), config.getApplicationKey(), config.getApplicationSecret(), consumerKey, config.getExceptionHandler()); }
/** * auth manager builder. * * @return the auth manager */ public AuthManager createAuthManager() { return createAuthManager(new CredentialClient(new UrlConnectionClient(), config.getApplicationKey(), config.getExceptionHandler())); }