Uh oh!
There was an error while loading. Please reload this page.
Http implementation - #361
Conversation
Codecov Report
@@ Coverage Diff @@## gax-httpjson #361 +/- ##
===============================================
Coverage 76.65% 76.65% Complexity 494 494 ===============================================
Files 114 114 Lines 2540 2540 Branches 185 185 ===============================================
Hits 1947 1947 Misses 522 522 Partials 71 71
Continue to review full report at Codecov.
|
…managedhttpjsonchannel
andreamlin
commented
Aug 25, 2017
PTAL |
| GoogleCredentials defaultCredentials = null; | ||
| if (googleCredentials == null) { | ||
| try { | ||
| defaultCredentials = GoogleCredentials.getApplicationDefault(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| responseFuture.set(response); | ||
| } catch (IOException e) { | ||
| e.printStackTrace(System.err); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| ResponseT response = | ||
| methodDescriptor.parseResponse( | ||
| new InputStreamReader(httpResponse.getContent())); | ||
| responseFuture.set(response); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| // Return a map where each entry is the name of a path param mapped to the value of the param. | ||
| Map<String, String> getPathParams(MessageFormatT apiMessage, Set<String> paramNames); | ||
| // Write out the inner request body of the given message. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| PATCH, | ||
| POST, | ||
| PUT, | ||
| TRACE; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| * [suffix] is any string; if length greater than 0, it should begin with '/'. | ||
| * This String format is applied to a serialized ResourceName to create the relative endpoint path. | ||
| */ | ||
| public abstract String endpointPathTemplate(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| Set<String> pathParams, | ||
| Set<String> queryParams, | ||
| HttpRequestFormatter httpRequestFormatter, | ||
| HttpMethod httpMethod) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| libraries.jsr305, | ||
| libraries.autovalue, | ||
| libraries.threetenbp, | ||
| libraries.apiClient, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| import java.util.Set; | ||
| /** Utility class to parse ApiMessages into various HTTP request parts. */ | ||
| public class ApiMessageHttpRequestFormatter implements HttpRequestFormatter<ApiMessage> { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| import java.util.Set; | ||
| /** Interface for classes that create parts of Http requests from a parameterized message. */ | ||
| public interface HttpRequestFormatter<MessageFormatT> { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
andreamlin
commented
Aug 25, 2017
Addressed comments. |
| return new Builder<>(); | ||
| } | ||
| public static class Builder<RequestT, ResponseT> { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| public final Builder<RequestT, ResponseT> toBuilder() { | ||
| return new Builder<>(); | ||
| } |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| private final ImmutableList<HttpJsonHeaderEnhancer> headerEnhancers; | ||
| private final SettableApiFuture responseFuture; | ||
| public HttpRequestRunnable( |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| } catch (IOException e) { | ||
| responseFuture.setException(e); | ||
| } | ||
| } catch (Exception e) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| import java.util.Map; | ||
| /** A runnable object that creates and executes an HTTP request. */ | ||
| public class HttpRequestRunnable<RequestT, ResponseT> implements Runnable { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| Set<String> pathParams, | ||
| Set<String> queryParams, | ||
| HttpRequestFormatter httpRequestFormatter, | ||
| String httpMethod) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| PATCH, | ||
| POST, | ||
| PUT, | ||
| TRACE; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| this.headerEnhancers = ImmutableList.copyOf(headerEnhancers); | ||
| HttpTransport httpTransport = new NetHttpTransport(); | ||
| this.httpTransport = httpTransport; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
andreamlin
commented
Aug 26, 2017
Addressed comments. |
Starting implementation for HTTP/JSON. This was tested by using the surface generated from https://github.com/googleapis/toolkit/tree/discogapic to list, get, insert, and delete Compute Address resources in a live Google Cloud project.
Starting implementation for HTTP/JSON. This was tested by using the surface generated from https://github.com/googleapis/toolkit/tree/discogapic to list, get, insert, and delete Compute Address resources in a live Google Cloud project.
Starting implementation for HTTP/JSON. This was tested by using the surface generated from https://github.com/googleapis/toolkit/tree/discogapic to list, get, insert, and delete Compute Address resources in a live Google Cloud project.
correct license on MockHttpService remove unused de/serialization methods in ApiMethodDescriptor comments comments for MockHttpService Bootstrapping gax-httpjson (googleapis#355) Http implementation (googleapis#361) Starting implementation for HTTP/JSON. This was tested by using the surface generated from https://github.com/googleapis/toolkit/tree/discogapic to list, get, insert, and delete Compute Address resources in a live Google Cloud project. Retry and failure-handling logic for http-json (googleapis#363) Exception handling and retry logic for http calls. Merge master (googleapis#364) Merge in updates from the master branch. new HttpApiExceptionFactory that uses googleapis/rpc/code.proto to map http status codes to wrapper exception types RetryTest passes removed HttpJsonApiException.java no longer need to check status code when catching specific apiexception ??? removed unused file adding Struct class comments moving ResourceName stuff to ApiMessage pushing ResourceNameStruct into ApiMethodDescriptor and out of ApiMessage add license getFieldValue() updated remove resourcenamestruct and replace with new resourcenamefactory class; this depends on api-common PR formatting apimessage.getFieldSTringValue doesn't throw IOException ResourseNameFactory uses parse() instead of parseFrom() no need to declare throws IllegalArgumentException" setSerializer->setMethodDescriptor fix license header
Starting implementation for HTTP/JSON.
This was tested by using the surface generated from https://github.com/googleapis/toolkit/tree/discogapic to list, get, insert, and delete Compute Address resources in a live Google Cloud project.