Skip to content

Commit

Permalink
bump okhttp to v3
Browse files Browse the repository at this point in the history
  • Loading branch information
tedli committed Jan 16, 2019
1 parent 52b65f8 commit fc5cdd5
Show file tree
Hide file tree
Showing 740 changed files with 455,340 additions and 287,938 deletions.
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<swagger-core-version>1.5.12</swagger-core-version>
<okhttp-version>2.7.5</okhttp-version>
<okhttp-version>3.12.1</okhttp-version>
<gson-version>2.6.2</gson-version>
<jodatime-version>2.9.3</jodatime-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
public class WatchExample {
public static void main(String[] args) throws IOException, ApiException {
ApiClient client = Config.defaultClient();
client.getHttpClient().setReadTimeout(60, TimeUnit.SECONDS);
client.setHttpClient(
client.getHttpClient().newBuilder().readTimeout(60, TimeUnit.SECONDS).build());
Configuration.setDefaultApiClient(client);

CoreV1Api api = new CoreV1Api();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*/
package io.kubernetes.client.examples;

import com.squareup.okhttp.ws.WebSocket;
import io.kubernetes.client.ApiClient;
import io.kubernetes.client.ApiException;
import io.kubernetes.client.util.Config;
Expand All @@ -21,6 +20,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import okhttp3.ws.WebSocket;

/**
* This is a pretty low level, most people won't need to use WebSockets directly.
Expand All @@ -44,7 +44,7 @@ public void open(String protocol, WebSocket socket) {}

public void close() {
// Trigger shutdown of the dispatcher's executor so this process can exit cleanly.
client.getHttpClient().getDispatcher().getExecutorService().shutdown();
client.getHttpClient().dispatcher().executorService().shutdown();
}

public void bytesMessage(InputStream is) {}
Expand Down
4 changes: 2 additions & 2 deletions kubernetes/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ if(hasProperty('target') && target == 'android') {

dependencies {
compile 'io.swagger:swagger-annotations:1.5.8'
compile 'com.squareup.okhttp:okhttp:2.7.5'
compile 'com.squareup.okhttp:logging-interceptor:2.7.5'
compile 'com.squareup.okhttp3:okhttp:3.12.1'
compile 'com.squareup.okhttp3:logging-interceptor:3.12.1'
compile 'com.google.code.gson:gson:2.6.2'
compile 'joda-time:joda-time:2.9.3'
compile 'io.sundr:builder-annotations:0.8.0'
Expand Down
6 changes: 3 additions & 3 deletions kubernetes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@
<version>${swagger-core-version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp</groupId>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>${okhttp-version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp</groupId>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>${okhttp-version}</version>
</dependency>
Expand Down Expand Up @@ -201,7 +201,7 @@
<maven.compiler.target>${java.version}</maven.compiler.target>
<swagger-core-version>1.5.12</swagger-core-version>
<sundrio.version>0.9.2</sundrio.version>
<okhttp-version>2.7.5</okhttp-version>
<okhttp-version>3.12.1</okhttp-version>
<gson-version>2.8.0</gson-version>
<jodatime-version>2.9.3</jodatime-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
Expand Down
77 changes: 37 additions & 40 deletions kubernetes/src/main/java/io/kubernetes/client/ApiCallback.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,57 @@
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: v1.12.2
*
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/


package io.kubernetes.client;

import java.io.IOException;

import java.util.Map;
import java.util.List;
import java.util.Map;

/**
* Callback for asynchronous API call.
*
* @param <T> The return type
*/
public interface ApiCallback<T> {
/**
* This is called when the API call fails.
*
* @param e The exception causing the failure
* @param statusCode Status code of the response if available, otherwise it would be 0
* @param responseHeaders Headers of the response if available, otherwise it would be null
*/
void onFailure(ApiException e, int statusCode, Map<String, List<String>> responseHeaders);

/**
* This is called when the API call succeeded.
*
* @param result The result deserialized from response
* @param statusCode Status code of the response
* @param responseHeaders Headers of the response
*/
void onSuccess(T result, int statusCode, Map<String, List<String>> responseHeaders);

/**
* This is called when the API upload processing.
*
* @param bytesWritten bytes Written
* @param contentLength content length of request body
* @param done write end
*/
void onUploadProgress(long bytesWritten, long contentLength, boolean done);

/**
* This is called when the API downlond processing.
*
* @param bytesRead bytes Read
* @param contentLength content lenngth of the response
* @param done Read end
*/
void onDownloadProgress(long bytesRead, long contentLength, boolean done);
/**
* This is called when the API call fails.
*
* @param e The exception causing the failure
* @param statusCode Status code of the response if available, otherwise it would be 0
* @param responseHeaders Headers of the response if available, otherwise it would be null
*/
void onFailure(ApiException e, int statusCode, Map<String, List<String>> responseHeaders);

/**
* This is called when the API call succeeded.
*
* @param result The result deserialized from response
* @param statusCode Status code of the response
* @param responseHeaders Headers of the response
*/
void onSuccess(T result, int statusCode, Map<String, List<String>> responseHeaders);

/**
* This is called when the API upload processing.
*
* @param bytesWritten bytes Written
* @param contentLength content length of request body
* @param done write end
*/
void onUploadProgress(long bytesWritten, long contentLength, boolean done);

/**
* This is called when the API downlond processing.
*
* @param bytesRead bytes Read
* @param contentLength content lenngth of the response
* @param done Read end
*/
void onDownloadProgress(long bytesRead, long contentLength, boolean done);
}
Loading

0 comments on commit fc5cdd5

Please sign in to comment.