Skip to content

Commit 8f94b5c

Browse files
committed
New deploy
1 parent 94da26f commit 8f94b5c

File tree

63 files changed

+2568
-1434
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2568
-1434
lines changed

pom.xml

Lines changed: 11 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@
4646
</plugins>
4747
</pluginManagement>
4848
<plugins>
49+
<plugin>
50+
<groupId>org.codehaus.mojo</groupId>
51+
<artifactId>versions-maven-plugin</artifactId>
52+
<version>2.5</version>
53+
<configuration>
54+
<rulesUri>file://${project.basedir}/version-rules.xml</rulesUri>
55+
</configuration>
56+
</plugin>
4957
<plugin>
5058
<groupId>org.apache.maven.plugins</groupId>
5159
<artifactId>maven-enforcer-plugin</artifactId>
@@ -76,55 +84,12 @@
7684
<appendAssemblyId>false</appendAssemblyId>
7785
</configuration>
7886
</plugin>
79-
<plugin>
80-
<groupId>org.apache.maven.plugins</groupId>
81-
<artifactId>maven-source-plugin</artifactId>
82-
<version>3.1.0</version>
83-
<executions>
84-
<execution>
85-
<id>attach-sources</id>
86-
<goals>
87-
<goal>jar</goal>
88-
</goals>
89-
</execution>
90-
</executions>
91-
</plugin>
92-
<plugin>
93-
<groupId>org.apache.maven.plugins</groupId>
94-
<artifactId>maven-gpg-plugin</artifactId>
95-
<version>1.5</version>
96-
<executions>
97-
<execution>
98-
<id>sign-artifacts</id>
99-
<phase>verify</phase>
100-
<goals>
101-
<goal>sign</goal>
102-
</goals>
103-
</execution>
104-
</executions>
105-
</plugin>
106-
<plugin>
107-
<groupId>org.apache.maven.plugins</groupId>
108-
<artifactId>maven-javadoc-plugin</artifactId>
109-
<version>3.1.1</version>
110-
<configuration>
111-
<failOnError>false</failOnError>
112-
</configuration>
113-
<executions>
114-
<execution>
115-
<id>attach-javadocs</id>
116-
<goals>
117-
<goal>jar</goal>
118-
</goals>
119-
</execution>
120-
</executions>
121-
</plugin>
12287
</plugins>
12388
</build>
12489

12590
<properties>
12691
<jackson.version>2.9.10</jackson.version>
127-
<jackson.databind.version>2.9.10.7</jackson.databind.version>
92+
<jackson.databind.version>2.9.10.5</jackson.databind.version>
12893
<maven.compiler.source>1.8</maven.compiler.source>
12994
<maven.compiler.target>1.8</maven.compiler.target>
13095
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -156,7 +121,7 @@
156121
<dependency>
157122
<groupId>com.squareup.okhttp3</groupId>
158123
<artifactId>okhttp</artifactId>
159-
<version>3.12.1</version>
124+
<version>[3.12, 4.9.1]</version>
160125
</dependency>
161126
<dependency>
162127
<groupId>com.fasterxml.jackson.core</groupId>
@@ -180,41 +145,4 @@
180145
<scope>test</scope>
181146
</dependency>
182147
</dependencies>
183-
<distributionManagement>
184-
<snapshotRepository>
185-
<id>ossrh</id>
186-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
187-
</snapshotRepository>
188-
<repository>
189-
<id>ossrh</id>
190-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
191-
</repository>
192-
</distributionManagement>
193-
<parent>
194-
<groupId>org.sonatype.oss</groupId>
195-
<artifactId>oss-parent</artifactId>
196-
<version>7</version>
197-
</parent>
198-
<licenses>
199-
<license>
200-
<name>Apache License, Version 2.0</name>
201-
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
202-
<distribution>repo</distribution>
203-
</license>
204-
</licenses>
205-
<scm>
206-
<url>https://github.com/Bandwidth/java-sdk</url>
207-
<connection>scm:git:[email protected]:Bandwidth/java-sdk.git</connection>
208-
<developerConnection>scm:git:[email protected]:Bandwidth/java-sdk.git</developerConnection>
209-
</scm>
210-
<developers>
211-
<developer>
212-
<id>support</id>
213-
<name>Bandwidth Support</name>
214-
<email>[email protected]</email>
215-
<organization>Bandwidth, Inc.</organization>
216-
<organizationUrl>http://bandwidth.com</organizationUrl>
217-
<timezone>-5</timezone>
218-
</developer>
219-
</developers>
220-
</project>
148+
</project>

src/main/java/com/bandwidth/ApiHelper.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import com.bandwidth.http.request.MultipartWrapper;
1212
import com.fasterxml.jackson.annotation.JsonFormat;
1313
import com.fasterxml.jackson.annotation.JsonGetter;
14-
import com.fasterxml.jackson.annotation.JsonInclude;
1514
import com.fasterxml.jackson.core.JsonProcessingException;
1615
import com.fasterxml.jackson.core.type.TypeReference;
1716
import com.fasterxml.jackson.databind.DeserializationFeature;
@@ -52,7 +51,6 @@ public class ApiHelper {
5251
private static final long serialVersionUID = -174113593500315394L;
5352
{
5453
configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
55-
setSerializationInclusion(JsonInclude.Include.NON_NULL);
5654
configOverride(BigDecimal.class).setFormat(
5755
JsonFormat.Value.forShape(JsonFormat.Shape.STRING));
5856
}

src/main/java/com/bandwidth/BandwidthClient.java

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public final class BandwidthClient implements Configuration {
2626
* Private store for clients.
2727
*/
2828
private MessagingClient messagingClient;
29-
private TwoFactorAuthClient twoFactorAuthClient;
29+
private MultiFactorAuthClient multiFactorAuthClient;
3030
private VoiceClient voiceClient;
3131
private WebRtcClient webRtcClient;
3232

@@ -61,9 +61,9 @@ public final class BandwidthClient implements Configuration {
6161
private MessagingBasicAuthManager messagingBasicAuthManager;
6262

6363
/**
64-
* TwoFactorAuthBasicAuthManager.
64+
* MultiFactorAuthBasicAuthManager.
6565
*/
66-
private TwoFactorAuthBasicAuthManager twoFactorAuthBasicAuthManager;
66+
private MultiFactorAuthBasicAuthManager multiFactorAuthBasicAuthManager;
6767

6868
/**
6969
* VoiceBasicAuthManager.
@@ -88,7 +88,7 @@ public final class BandwidthClient implements Configuration {
8888
private BandwidthClient(Environment environment, String baseUrl, HttpClient httpClient,
8989
long timeout, ReadonlyHttpClientConfiguration httpClientConfig,
9090
String messagingBasicAuthUserName, String messagingBasicAuthPassword,
91-
String twoFactorAuthBasicAuthUserName, String twoFactorAuthBasicAuthPassword,
91+
String multiFactorAuthBasicAuthUserName, String multiFactorAuthBasicAuthPassword,
9292
String voiceBasicAuthUserName, String voiceBasicAuthPassword,
9393
String webRtcBasicAuthUserName, String webRtcBasicAuthPassword,
9494
Map<String, AuthManager> authManagers, HttpCallback httpCallback) {
@@ -113,17 +113,17 @@ private BandwidthClient(Environment environment, String baseUrl, HttpClient http
113113
this.authManagers.put("messaging", messagingBasicAuthManager);
114114
}
115115

116-
if (this.authManagers.containsKey("twoFactorAuth")) {
117-
this.twoFactorAuthBasicAuthManager =
118-
(TwoFactorAuthBasicAuthManager) this.authManagers.get("twoFactorAuth");
116+
if (this.authManagers.containsKey("multiFactorAuth")) {
117+
this.multiFactorAuthBasicAuthManager =
118+
(MultiFactorAuthBasicAuthManager) this.authManagers.get("multiFactorAuth");
119119
}
120120

121-
if (!this.authManagers.containsKey("twoFactorAuth")
122-
|| !getTwoFactorAuthBasicAuthCredentials().equals(twoFactorAuthBasicAuthUserName,
123-
twoFactorAuthBasicAuthPassword)) {
124-
this.twoFactorAuthBasicAuthManager = new TwoFactorAuthBasicAuthManager(
125-
twoFactorAuthBasicAuthUserName, twoFactorAuthBasicAuthPassword);
126-
this.authManagers.put("twoFactorAuth", twoFactorAuthBasicAuthManager);
121+
if (!this.authManagers.containsKey("multiFactorAuth")
122+
|| !getMultiFactorAuthBasicAuthCredentials().equals(
123+
multiFactorAuthBasicAuthUserName, multiFactorAuthBasicAuthPassword)) {
124+
this.multiFactorAuthBasicAuthManager = new MultiFactorAuthBasicAuthManager(
125+
multiFactorAuthBasicAuthUserName, multiFactorAuthBasicAuthPassword);
126+
this.authManagers.put("multiFactorAuth", multiFactorAuthBasicAuthManager);
127127
}
128128

129129
if (this.authManagers.containsKey("voice")) {
@@ -152,7 +152,7 @@ private BandwidthClient(Environment environment, String baseUrl, HttpClient http
152152

153153

154154
messagingClient = new MessagingClient(this);
155-
twoFactorAuthClient = new TwoFactorAuthClient(this);
155+
multiFactorAuthClient = new MultiFactorAuthClient(this);
156156
voiceClient = new VoiceClient(this);
157157
webRtcClient = new WebRtcClient(this);
158158
}
@@ -173,11 +173,11 @@ public MessagingClient getMessagingClient() {
173173
}
174174

175175
/**
176-
* Provides access to twoFactorAuthClient Client.
177-
* @return Returns the TwoFactorAuthClient instance
176+
* Provides access to multiFactorAuthClient Client.
177+
* @return Returns the MultiFactorAuthClient instance
178178
*/
179-
public TwoFactorAuthClient getTwoFactorAuthClient() {
180-
return twoFactorAuthClient;
179+
public MultiFactorAuthClient getMultiFactorAuthClient() {
180+
return multiFactorAuthClient;
181181
}
182182

183183
/**
@@ -245,11 +245,11 @@ public MessagingBasicAuthCredentials getMessagingBasicAuthCredentials() {
245245
}
246246

247247
/**
248-
* The credentials to use with TwoFactorAuthBasicAuth.
249-
* @return twoFactorAuthBasicAuthCredentials
248+
* The credentials to use with MultiFactorAuthBasicAuth.
249+
* @return multiFactorAuthBasicAuthCredentials
250250
*/
251-
public TwoFactorAuthBasicAuthCredentials getTwoFactorAuthBasicAuthCredentials() {
252-
return twoFactorAuthBasicAuthManager;
251+
public MultiFactorAuthBasicAuthCredentials getMultiFactorAuthBasicAuthCredentials() {
252+
return multiFactorAuthBasicAuthManager;
253253
}
254254

255255
/**
@@ -312,7 +312,7 @@ private static String environmentMapper(Environment environment, Server server)
312312
if (server.equals(Server.MESSAGINGDEFAULT)) {
313313
return "https://messaging.bandwidth.com/api/v2";
314314
}
315-
if (server.equals(Server.TWOFACTORAUTHDEFAULT)) {
315+
if (server.equals(Server.MULTIFACTORAUTHDEFAULT)) {
316316
return "https://mfa.bandwidth.com/api/v1";
317317
}
318318
if (server.equals(Server.VOICEDEFAULT)) {
@@ -329,7 +329,7 @@ private static String environmentMapper(Environment environment, Server server)
329329
if (server.equals(Server.MESSAGINGDEFAULT)) {
330330
return "{base_url}";
331331
}
332-
if (server.equals(Server.TWOFACTORAUTHDEFAULT)) {
332+
if (server.equals(Server.MULTIFACTORAUTHDEFAULT)) {
333333
return "{base_url}";
334334
}
335335
if (server.equals(Server.VOICEDEFAULT)) {
@@ -367,10 +367,10 @@ public Builder newBuilder() {
367367
getMessagingBasicAuthCredentials().getBasicAuthUserName();
368368
builder.messagingBasicAuthPassword =
369369
getMessagingBasicAuthCredentials().getBasicAuthPassword();
370-
builder.twoFactorAuthBasicAuthUserName =
371-
getTwoFactorAuthBasicAuthCredentials().getBasicAuthUserName();
372-
builder.twoFactorAuthBasicAuthPassword =
373-
getTwoFactorAuthBasicAuthCredentials().getBasicAuthPassword();
370+
builder.multiFactorAuthBasicAuthUserName =
371+
getMultiFactorAuthBasicAuthCredentials().getBasicAuthUserName();
372+
builder.multiFactorAuthBasicAuthPassword =
373+
getMultiFactorAuthBasicAuthCredentials().getBasicAuthPassword();
374374
builder.voiceBasicAuthUserName = getVoiceBasicAuthCredentials().getBasicAuthUserName();
375375
builder.voiceBasicAuthPassword = getVoiceBasicAuthCredentials().getBasicAuthPassword();
376376
builder.webRtcBasicAuthUserName = getWebRtcBasicAuthCredentials().getBasicAuthUserName();
@@ -391,8 +391,8 @@ public static class Builder {
391391
private long timeout = 0;
392392
private String messagingBasicAuthUserName = "TODO: Replace";
393393
private String messagingBasicAuthPassword = "TODO: Replace";
394-
private String twoFactorAuthBasicAuthUserName = "TODO: Replace";
395-
private String twoFactorAuthBasicAuthPassword = "TODO: Replace";
394+
private String multiFactorAuthBasicAuthUserName = "TODO: Replace";
395+
private String multiFactorAuthBasicAuthPassword = "TODO: Replace";
396396
private String voiceBasicAuthUserName = "TODO: Replace";
397397
private String voiceBasicAuthPassword = "TODO: Replace";
398398
private String webRtcBasicAuthUserName = "TODO: Replace";
@@ -421,21 +421,21 @@ public Builder messagingBasicAuthCredentials(String basicAuthUserName,
421421
}
422422

423423
/**
424-
* Credentials setter for TwoFactorAuthBasicAuth.
425-
* @param basicAuthUserName String value for twoFactorAuthBasicAuthUserName.
426-
* @param basicAuthPassword String value for twoFactorAuthBasicAuthPassword.
424+
* Credentials setter for MultiFactorAuthBasicAuth.
425+
* @param basicAuthUserName String value for multiFactorAuthBasicAuthUserName.
426+
* @param basicAuthPassword String value for multiFactorAuthBasicAuthPassword.
427427
* @return Builder
428428
*/
429-
public Builder twoFactorAuthBasicAuthCredentials(String basicAuthUserName,
429+
public Builder multiFactorAuthBasicAuthCredentials(String basicAuthUserName,
430430
String basicAuthPassword) {
431431
if (basicAuthUserName == null) {
432432
throw new NullPointerException("BasicAuthUserName cannot be null.");
433433
}
434434
if (basicAuthPassword == null) {
435435
throw new NullPointerException("BasicAuthPassword cannot be null.");
436436
}
437-
this.twoFactorAuthBasicAuthUserName = basicAuthUserName;
438-
this.twoFactorAuthBasicAuthPassword = basicAuthPassword;
437+
this.multiFactorAuthBasicAuthUserName = basicAuthUserName;
438+
this.multiFactorAuthBasicAuthPassword = basicAuthPassword;
439439
return this;
440440
}
441441

@@ -535,7 +535,7 @@ public BandwidthClient build() {
535535

536536
return new BandwidthClient(environment, baseUrl, httpClient, timeout, httpClientConfig,
537537
messagingBasicAuthUserName, messagingBasicAuthPassword,
538-
twoFactorAuthBasicAuthUserName, twoFactorAuthBasicAuthPassword,
538+
multiFactorAuthBasicAuthUserName, multiFactorAuthBasicAuthPassword,
539539
voiceBasicAuthUserName, voiceBasicAuthPassword, webRtcBasicAuthUserName,
540540
webRtcBasicAuthPassword, authManagers, httpCallback);
541541
}

src/main/java/com/bandwidth/Configuration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ public interface Configuration {
4444
MessagingBasicAuthCredentials getMessagingBasicAuthCredentials();
4545

4646
/**
47-
* The credentials to use with TwoFactorAuthBasicAuth.
48-
* @return twoFactorAuthBasicAuthCredentials
47+
* The credentials to use with MultiFactorAuthBasicAuth.
48+
* @return multiFactorAuthBasicAuthCredentials
4949
*/
50-
TwoFactorAuthBasicAuthCredentials getTwoFactorAuthBasicAuthCredentials();
50+
MultiFactorAuthBasicAuthCredentials getMultiFactorAuthBasicAuthCredentials();
5151

5252
/**
5353
* The credentials to use with VoiceBasicAuth.

0 commit comments

Comments
 (0)