diff --git a/ChangeLog.txt b/ChangeLog.txt
index 96abc6d10607..ef40f7e203ed 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,2 +1,8 @@
+2.0.0-beta2 (2018-04-23)
+- Major refinements to HTTP content streaming, in large part thanks to contributions by [David Moten](https://github.com/davidmoten).
+- Removed Joda Time in favor of Java 8 DateTime classes
+- NettyClient.Factory now accepts a Netty Bootstrap object allowing for more user configuration of channel attributes, such as the receive buffer size and low/high write watermarks. Currently, specifying an EventLoopGroup or `Class extends Channel>` is not supported.
+- Various other minor improvements
+
2.0.0-beta1 (2018-03-08)
- First beta featuring Netty and RxJava 2.
diff --git a/README.md b/README.md
index 7696bbf7e0c2..0f6494e2284d 100644
--- a/README.md
+++ b/README.md
@@ -33,12 +33,30 @@ The runtime libraries for [AutoRest](https://github.com/azure/autorest) generate
2.0.0-beta1
-
+
+
+
- com.microsoft.rest.v2
- client-runtime-native
- 2.0.0-SNAPSHOT
- pom
+ io.netty
+ netty-tcnative-boringssl-static
+ 2.0.8.Final
+ ${os.detected.classifier}
+
+
+
+
+ io.netty
+ netty-transport-native-epoll
+ 4.1.23.Final
+ ${os.detected.classifier}
+
+
+
+
+ io.netty
+ netty-transport-native-kqueue
+ 4.1.23.Final
+ ${os.detected.classifier}
```
diff --git a/azure-client-authentication/src/main/java/com/microsoft/azure/v2/credentials/ApplicationTokenCredentials.java b/azure-client-authentication/src/main/java/com/microsoft/azure/v2/credentials/ApplicationTokenCredentials.java
index 2e0c2af1f5cd..e907e8e7a2fb 100644
--- a/azure-client-authentication/src/main/java/com/microsoft/azure/v2/credentials/ApplicationTokenCredentials.java
+++ b/azure-client-authentication/src/main/java/com/microsoft/azure/v2/credentials/ApplicationTokenCredentials.java
@@ -6,18 +6,19 @@
package com.microsoft.azure.v2.credentials;
-import com.google.common.io.BaseEncoding;
import com.microsoft.aad.adal4j.AsymmetricKeyCredential;
import com.microsoft.aad.adal4j.AuthenticationContext;
import com.microsoft.aad.adal4j.AuthenticationException;
import com.microsoft.aad.adal4j.AuthenticationResult;
import com.microsoft.aad.adal4j.ClientCredential;
import com.microsoft.azure.v2.AzureEnvironment;
+import com.microsoft.rest.v2.util.Base64Util;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
@@ -171,7 +172,7 @@ private PrivateKey privateKeyFromPem(String pem) {
.replace("-----END PRIVATE KEY-----", "")
.replace("\n", "")
.replace("\r", "");
- byte[] key = BaseEncoding.base64().decode(base64);
+ byte[] key = Base64Util.decode(base64.getBytes(StandardCharsets.UTF_8));
PKCS8EncodedKeySpec spec = new PKCS8EncodedKeySpec(key);
try {
KeyFactory kf = KeyFactory.getInstance("RSA");
diff --git a/azure-client-runtime/src/main/java/com/microsoft/azure/v2/AzureProxy.java b/azure-client-runtime/src/main/java/com/microsoft/azure/v2/AzureProxy.java
index 23ebbf630998..a8de76559119 100644
--- a/azure-client-runtime/src/main/java/com/microsoft/azure/v2/AzureProxy.java
+++ b/azure-client-runtime/src/main/java/com/microsoft/azure/v2/AzureProxy.java
@@ -26,8 +26,6 @@
import com.microsoft.rest.v2.policy.CookiePolicyFactory;
import com.microsoft.rest.v2.policy.CredentialsPolicyFactory;
import com.microsoft.rest.v2.policy.DecodingPolicyFactory;
-import com.microsoft.rest.v2.policy.HttpLogDetailLevel;
-import com.microsoft.rest.v2.policy.HttpLoggingPolicyFactory;
import com.microsoft.rest.v2.policy.RequestPolicyFactory;
import com.microsoft.rest.v2.policy.RetryPolicyFactory;
import com.microsoft.rest.v2.protocol.SerializerAdapter;
@@ -184,7 +182,6 @@ public static HttpPipeline createDefaultPipeline(Class> swaggerInterface, Requ
if (credentialsPolicy != null) {
builder.withRequestPolicy(credentialsPolicy);
}
- builder.withRequestPolicy(new HttpLoggingPolicyFactory(HttpLogDetailLevel.HEADERS));
return builder.build();
}
diff --git a/client-runtime-native/pom.xml b/client-runtime-native/pom.xml
deleted file mode 100644
index 68b4efe11ce3..000000000000
--- a/client-runtime-native/pom.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
- com.microsoft.rest.v2
- client-runtime-native
-
- 4.0.0
-
- autorest-clientruntime-for-java
- com.microsoft.azure.v2
- 2.0.0-SNAPSHOT
-
- pom
-
- Native Modules for AutoRest Client Runtime for Java
-
- This package contains native dependencies for the AutoRest Client Runtime for Java which can improve performance.
- Including this package in your dependencies will cause all native modules available on your OS to be used.
- Currently, only x86_64 architectures are supported.
-
- https://github.com/Azure/autorest-clientruntime-for-java
-
-
- 2.0.7.Final
-
-
-
-
- kr.motd.maven
- os-maven-plugin
- 1.5.0.Final
-
-
-
-
-
- boringssl
-
- true
-
-
-
-
- io.netty
- netty-tcnative-boringssl-static
- ${netty-boringssl.version}
- ${os.detected.name}-${os.detected.arch}
-
-
-
-
-
- osx
-
-
- os.detected.name
- osx
-
-
-
-
-
- io.netty
- netty-transport-native-kqueue
- ${netty.version}
- ${os.detected.name}-${os.detected.arch}
-
-
-
- io.netty
- netty-tcnative-boringssl-static
- ${netty-boringssl.version}
- ${os.detected.name}-${os.detected.arch}
-
-
-
-
-
- linux
-
-
- os.detected.name
- linux
-
-
-
-
- io.netty
- netty-transport-native-epoll
- ${netty.version}
- ${os.detected.name}-${os.detected.arch}
-
-
-
- io.netty
- netty-tcnative-boringssl-static
- ${netty-boringssl.version}
- ${os.detected.name}-${os.detected.arch}
-
-
-
-
-
\ No newline at end of file
diff --git a/client-runtime/pom.xml b/client-runtime/pom.xml
index bbf3cc569c4e..a4a8b1564207 100644
--- a/client-runtime/pom.xml
+++ b/client-runtime/pom.xml
@@ -71,10 +71,6 @@
com.fasterxml.jackson.dataformat
jackson-dataformat-xml
-
- org.apache.commons
- commons-lang3
-
io.reactivex.rxjava2
rxjava
@@ -87,6 +83,7 @@
com.microsoft.azure
azure-annotations
+
junit
junit
@@ -97,13 +94,6 @@
slf4j-simple
test
-
- com.microsoft.rest.v2
- client-runtime-native
- 2.0.0-SNAPSHOT
- pom
- test
-
com.github.tomakehurst
wiremock-standalone
diff --git a/client-runtime/src/main/java/com/microsoft/rest/v2/Base64Url.java b/client-runtime/src/main/java/com/microsoft/rest/v2/Base64Url.java
index e8a37d9d68f8..9e859c506f26 100644
--- a/client-runtime/src/main/java/com/microsoft/rest/v2/Base64Url.java
+++ b/client-runtime/src/main/java/com/microsoft/rest/v2/Base64Url.java
@@ -6,7 +6,7 @@
package com.microsoft.rest.v2;
-import com.google.common.io.BaseEncoding;
+import com.microsoft.rest.v2.util.Base64Util;
import java.util.Arrays;
@@ -73,7 +73,7 @@ public static Base64Url encode(byte[] bytes) {
if (bytes == null) {
return new Base64Url((String) null);
} else {
- return new Base64Url(BaseEncoding.base64Url().omitPadding().encode(bytes));
+ return new Base64Url(Base64Util.encodeURLWithoutPadding(bytes));
}
}
@@ -95,8 +95,8 @@ public byte[] decodedBytes() {
if (this.bytes == null) {
return null;
}
- final String bytesString = new String(bytes);
- final byte[] decodedBytes = BaseEncoding.base64Url().decode(bytesString);
+
+ final byte[] decodedBytes = Base64Util.decodeURL(bytes);
return decodedBytes;
}
diff --git a/client-runtime/src/main/java/com/microsoft/rest/v2/RestProxy.java b/client-runtime/src/main/java/com/microsoft/rest/v2/RestProxy.java
index 1c6a01d006fd..93c6bde901a9 100644
--- a/client-runtime/src/main/java/com/microsoft/rest/v2/RestProxy.java
+++ b/client-runtime/src/main/java/com/microsoft/rest/v2/RestProxy.java
@@ -36,7 +36,6 @@
import io.reactivex.Single;
import io.reactivex.exceptions.Exceptions;
import io.reactivex.functions.Function;
-import org.reactivestreams.Publisher;
import java.io.IOException;
import java.lang.reflect.Constructor;
@@ -48,7 +47,6 @@
import java.net.URL;
import java.nio.ByteBuffer;
import java.util.Map;
-import java.util.NoSuchElementException;
/**
* This class can be used to create a proxy implementation for a provided Swagger generated
@@ -409,16 +407,17 @@ private Single> handleRestResponseReturnTypeAsync(HttpResponse response, Swagg
final int responseStatusCode = response.statusCode();
try {
- final Single> asyncResult;
+ Single> asyncResult;
if (entityTypeToken.isSubtypeOf(RestResponse.class)) {
- final Constructor extends RestResponse, ?>> responseConstructor = getRestResponseConstructor(entityTypeToken);
+ Constructor extends RestResponse, ?>> responseConstructor = getRestResponseConstructor(entityTypeToken);
- final Type[] deserializedTypes = getTypeArguments(entityTypeToken.getSupertype(RestResponse.class).getType());
- final Type bodyType = deserializedTypes[1];
- final HttpHeaders responseHeaders = response.headers();
- final Object deserializedHeaders = response.deserializedHeaders();
+ Type[] deserializedTypes = getTypeArguments(entityTypeToken.getSupertype(RestResponse.class).getType());
- final TypeToken bodyTypeToken = TypeToken.of(bodyType);
+ HttpHeaders responseHeaders = response.headers();
+ Object deserializedHeaders = response.deserializedHeaders();
+
+ Type bodyType = deserializedTypes[1];
+ TypeToken bodyTypeToken = TypeToken.of(bodyType);
if (bodyTypeToken.isSubtypeOf(Void.class)) {
asyncResult = response.body().lastElement().ignoreElement()
.andThen(Single.just(responseConstructor.newInstance(responseStatusCode, deserializedHeaders, responseHeaders.toMap(), null)));
@@ -426,17 +425,22 @@ private Single> handleRestResponseReturnTypeAsync(HttpResponse response, Swagg
final Map rawHeaders = responseHeaders.toMap();
asyncResult = handleBodyReturnTypeAsync(response, methodParser, bodyType)
- .map(new Function