Skip to content

Commit 232c2c6

Browse files
Merge pull request #125 from mailjet/revert-124-timeout_to_client_options
Revert "Add timeout to ClientOptions Object"
2 parents db70381 + 6c1f4bc commit 232c2c6

5 files changed

Lines changed: 6 additions & 47 deletions

File tree

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,3 @@ target/*
44
/.settings/org.eclipse.core.resources.prefs
55
/.settings/org.eclipse.jdt.core.prefs
66
/.settings/org.eclipse.m2e.core.prefs
7-
/bin/
8-
/.idea
9-
mailjet-client.iml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Add the following in your `pom.xml`
5959
<dependency>
6060
<groupId>com.mailjet</groupId>
6161
<artifactId>mailjet-client</artifactId>
62-
<version>4.4.0</version>
62+
<version>4.2.0</version>
6363
</dependency>
6464
</dependencies>
6565
```

pom.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.mailjet</groupId>
55
<artifactId>mailjet-client</artifactId>
6-
<version>4.4.0</version>
6+
<version>4.2.1-SNAPSHOT</version>
77
<packaging>jar</packaging>
88
<name>Mailjet Client</name>
99
<description>A Mailjet API Client</description>
@@ -22,7 +22,7 @@
2222
<connection>scm:git:https://github.com/mailjet/mailjet-apiv3-java.git</connection>
2323
<developerConnection>scm:git:https://github.com/mailjet/mailjet-apiv3-java.git</developerConnection>
2424
<url>git@github.com:mailjet/mailjet-apiv3-java.git</url>
25-
<tag>v4.4.0</tag>
25+
<tag>mailjet-client-4.2.1</tag>
2626
</scm>
2727
<licenses>
2828
<license>
@@ -52,7 +52,7 @@
5252
<dependency>
5353
<groupId>org.json</groupId>
5454
<artifactId>json</artifactId>
55-
<version>20190722</version>
55+
<version>20140107</version>
5656
</dependency>
5757
<dependency>
5858
<groupId>junit</groupId>
@@ -98,7 +98,6 @@
9898
<plugin>
9999
<groupId>org.apache.maven.plugins</groupId>
100100
<artifactId>maven-source-plugin</artifactId>
101-
<version>3.0.0</version>
102101
<executions>
103102
<execution>
104103
<id>attach-sources</id>

src/main/java/com/mailjet/client/ClientOptions.java

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,66 +13,31 @@ public class ClientOptions {
1313

1414
private static String defaultBaseURL = "https://api.mailjet.com";
1515
private static String defaultVersion = "v3";
16-
private static Integer defaultTimeout = 10;
1716

1817
private String baseUrl;
1918
private String version;
20-
private Integer timeout;
2119

2220
public ClientOptions() {
2321
this.baseUrl = ClientOptions.defaultBaseURL;
2422
this.version = ClientOptions.defaultVersion;
25-
this.timeout = ClientOptions.defaultTimeout;
26-
}
27-
28-
public ClientOptions(String version, String baseUrl, Integer timeout) {
29-
this.baseUrl = baseUrl;
30-
this.version = version;
31-
this.timeout = timeout;
32-
33-
}
34-
35-
public ClientOptions(Integer timeout) {
36-
this.baseUrl = ClientOptions.defaultBaseURL;
37-
this.version = ClientOptions.defaultVersion;
38-
this.timeout = timeout;
39-
4023
}
4124

4225
public ClientOptions(String version, String baseUrl) {
4326
this.baseUrl = baseUrl;
4427
this.version = version;
45-
this.timeout = ClientOptions.defaultTimeout;
4628
}
4729

4830
public ClientOptions(String version) {
4931
this.baseUrl = ClientOptions.defaultBaseURL;
5032
this.version = version;
51-
this.timeout = ClientOptions.defaultTimeout;
5233
}
5334

5435
public String getBaseUrl() {
5536
return this.baseUrl;
5637
}
57-
58-
public void setBaseUrl(String baseUrl) {
59-
this.baseUrl = baseUrl;
60-
}
6138

6239
public String getVersion() {
6340
return this.version;
6441
}
65-
66-
public void setVersion(String version) {
67-
this.version = version;
68-
}
69-
70-
public Integer getTimeout() {
71-
return this.timeout;
72-
}
73-
74-
public void setTimeout(Integer timeout) {
75-
this.timeout = timeout;
76-
}
7742

7843
}

src/main/java/com/mailjet/client/MailjetClient.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public class MailjetClient {
5252
private String _apiKey;
5353
private String _apiSecret;
5454
private String _token;
55-
private static final String userAgent = "mailjet-apiv3-java/v4.4.0";
5655
private int _debug = 0;
5756

5857
/**
@@ -155,7 +154,7 @@ private void initBasicAuth(String apiKey, String apiSecret) {
155154

156155
_client
157156
.addHeader("Accept", "application/json")
158-
.addHeader("User-Agent", this.userAgent)
157+
.addHeader("user-agent", "mailjet-apiv3-java/v4.2.1")
159158
.addHeader("Authorization", "Basic " + authEncBytes);
160159

161160
}
@@ -165,7 +164,7 @@ private void initTokenAuth(String token) {
165164

166165
_client
167166
.addHeader("Accept", "application/json")
168-
.addHeader("User-Agent", this.userAgent)
167+
.addHeader("user-agent", "mailjet-apiv3-java/v4.2.1")
169168
.addHeader("Authorization", "Bearer " + token);
170169

171170
}
@@ -354,7 +353,6 @@ public MailjetResponse delete(MailjetRequest request) throws MailjetException, M
354353

355354
private void setOptions(ClientOptions options) {
356355
this._options = options;
357-
this._client.setReadTimeout(options.getTimeout());
358356
}
359357

360358
private String createUrl() {

0 commit comments

Comments
 (0)