Skip to content

Broke up UrlConnectionHttpClient into multiple classes. Hopefully this is an improvement? #3054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

millems
Copy link
Contributor

@millems millems commented Feb 23, 2022

No description provided.

@millems millems requested a review from a team as a code owner February 23, 2022 18:11
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability D 3 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 7 Code Smells

91.9% 91.9% Coverage
0.0% 0.0% Duplication

Comment on lines +22 to +27
/**
* A logger used by classes in the URL connection HTTP client package.
*/
@SdkInternalApi
public class UrlConnectionLogger {
public static final Logger LOG = Logger.loggerFor(UrlConnectionHttpClient.class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? Is there any harm in exposing the underlying class name that's logging, even if it's an internal class? It somewhat unifies logs from a user perspective but it also makes things a little bit more difficult to trace.

Comment on lines +28 to +31
* An implementation of {@link HttpConnection} that delegates calls to a {@link HttpURLConnection}.
*/
@SdkInternalApi
public class DefaultHttpConnection implements HttpConnection {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a HttpURLConnectionToHttpConnectionAdapter, or just HttpURLConnectionAdapter?

/**
* Invoke {@link HttpURLConnection#getHeaderField(String)}
*/
String getResponseHeader(String header);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this return List<String>? Esp. since getResponseHeaders() uses a list.

Comment on lines +60 to +68
/**
* Invoke {@link HttpURLConnection#getInputStream()}
*/
InputStream getResponseStream();

/**
* Invoke {@link HttpURLConnection#getErrorStream()}
*/
InputStream getResponseErrorStream();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we feel it offers value to distinguish between these two streams? If not, could our own interface just normalize to getResponseStream()?

* An abstract HTTP connection. Implemented with a {@link HttpURLConnection} in {@link DefaultHttpConnection}.
*/
@SdkInternalApi
public interface HttpConnection {
Copy link
Contributor

@Bennett-Lynch Bennett-Lynch Feb 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any value in extending Abortable/AutoCloseable?

Comment on lines +62 to +65
HttpConnection connection = new DefaultHttpConnection(httpUrlConnection);
connection = new ResponseCodeBugHttpConnection(connection);
connection = new Expect100BugHttpConnection(connection, executeRequest.httpRequest());
this.connection = connection;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very elegant usage of wrapping!

@debora-ito
Copy link
Member

Closing as it got stale.

@debora-ito debora-ito closed this Apr 25, 2022
@millems millems deleted the millem/url-connection-refactor branch October 19, 2022 19:35
@millems millems restored the millem/url-connection-refactor branch October 19, 2022 19:35
@millems millems deleted the millem/url-connection-refactor branch October 19, 2022 19:35
@millems millems restored the millem/url-connection-refactor branch October 19, 2022 19:35
@millems millems deleted the millem/url-connection-refactor branch October 19, 2022 19:39
aws-sdk-java-automation added a commit that referenced this pull request May 31, 2024
…de602d052

Pull request: release <- staging/7c012b4d-fe04-4805-bcb0-b56de602d052
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants