From 56ca5d7dad586aedf6be217b59dfc36bc23060db Mon Sep 17 00:00:00 2001 From: Rob Rudin Date: Thu, 9 Oct 2025 12:51:04 -0400 Subject: [PATCH] MLE-24523 Removing deprecated items Also eagerly bumped up the NOTICE file. --- NOTICE.txt | 4 +- README.md | 4 +- .../client/DatabaseClientFactory.java | 67 +------------------ .../client/extra/gson/GSONHandle.java | 25 ++----- .../client/impl/okhttp/OkHttpUtil.java | 4 +- .../src/test/example-project/build.gradle | 6 +- 6 files changed, 16 insertions(+), 94 deletions(-) diff --git a/NOTICE.txt b/NOTICE.txt index 9dd2c0e1f..700be2e15 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -28,7 +28,7 @@ Eclipse Public License 1.0 (EPL-1.0) Third-Party Components -The following is a list of the third-party components used by the MarkLogic® for Java Client 7.2.0 (last updated July 21, 2025): +The following is a list of the third-party components used by the MarkLogic® for Java Client 8.0.0 (last updated October 29, 2025): jackson-databind 2.20.0 (Apache-2.0) https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/ @@ -68,7 +68,7 @@ For the full text of the Apache-2.0 license, see Apache License 2.0 (Apache-2.0) Common Licenses -The following is a list of the third-party components used by the MarkLogic® for Java Client 7.2.0 (last updated July 21, 2025): +The following is a list of the third-party components used by the MarkLogic® for Java Client 8.0.0 (last updated October 29, 2025): Apache License 2.0 (Apache-2.0) https://spdx.org/licenses/Apache-2.0.html diff --git a/README.md b/README.md index be9e1944e..f6bf86b28 100644 --- a/README.md +++ b/README.md @@ -33,13 +33,13 @@ To use the client in your [Maven](https://maven.apache.org/) project, include th com.marklogic marklogic-client-api - 7.2.0 + 8.0.0 To use the client in your [Gradle](https://gradle.org/) project, include the following in your `build.gradle` file: dependencies { - implementation "com.marklogic:marklogic-client-api:7.2.0" + implementation "com.marklogic:marklogic-client-api:8.0.0" } Next, read [The Java API in Five Minutes](http://developer.marklogic.com/try/java/index) to get started. diff --git a/marklogic-client-api/src/main/java/com/marklogic/client/DatabaseClientFactory.java b/marklogic-client-api/src/main/java/com/marklogic/client/DatabaseClientFactory.java index 10bb1c69c..63e4cd212 100644 --- a/marklogic-client-api/src/main/java/com/marklogic/client/DatabaseClientFactory.java +++ b/marklogic-client-api/src/main/java/com/marklogic/client/DatabaseClientFactory.java @@ -348,70 +348,7 @@ public SecurityContext withSSLContext(SSLContext context, X509TrustManager trust } /** - * @since 6.1.0 - * @deprecated as of 7.2.0; use {@code ProgressDataCloudAuthContext} instead. Will be removed in 8.0.0. - */ - @Deprecated - public static class MarkLogicCloudAuthContext extends ProgressDataCloudAuthContext { - - /** - * @param apiKey user's API key for accessing Progress Data Cloud - */ - public MarkLogicCloudAuthContext(String apiKey) { - super(apiKey); - } - - /** - * @param apiKey user's API key for accessing Progress Data Cloud - * @param tokenDuration length in minutes until the generated access token expires - * @since 6.3.0 - */ - public MarkLogicCloudAuthContext(String apiKey, Integer tokenDuration) { - super(apiKey, tokenDuration); - } - - /** - * Only intended to be used in the scenario that the token endpoint of "/token" and the grant type of "apikey" - * are not the intended values. - * - * @param apiKey user's API key for accessing Progress Data Cloud - * @param tokenEndpoint for overriding the default token endpoint if necessary - * @param grantType for overriding the default grant type if necessary - */ - public MarkLogicCloudAuthContext(String apiKey, String tokenEndpoint, String grantType) { - super(apiKey, tokenEndpoint, grantType); - } - - /** - * Only intended to be used in the scenario that the token endpoint of "/token" and the grant type of "apikey" - * are not the intended values. - * - * @param apiKey user's API key for accessing Progress Data Cloud - * @param tokenEndpoint for overriding the default token endpoint if necessary - * @param grantType for overriding the default grant type if necessary - * @param tokenDuration length in minutes until the generated access token expires - * @since 6.3.0 - */ - public MarkLogicCloudAuthContext(String apiKey, String tokenEndpoint, String grantType, Integer tokenDuration) { - super(apiKey, tokenEndpoint, grantType, tokenDuration); - } - - @Override - public MarkLogicCloudAuthContext withSSLContext(SSLContext context, X509TrustManager trustManager) { - this.sslContext = context; - this.trustManager = trustManager; - return this; - } - - @Override - public MarkLogicCloudAuthContext withSSLHostnameVerifier(SSLHostnameVerifier verifier) { - this.sslVerifier = verifier; - return this; - } - } - - /** - * @since 7.2.0 Use this instead of the now-deprecated {@code MarkLogicCloudAuthContext} + * @since 7.2.0 Replaced {@code MarkLogicCloudAuthContext} which was removed in 8.0.0 */ public static class ProgressDataCloudAuthContext extends AuthContext { private String tokenEndpoint; @@ -1332,7 +1269,7 @@ static public DatabaseClient newClient(String host, int port, String basePath, S // Progress Data Cloud instance, then port 443 will be used. Every path for constructing a DatabaseClient goes through // this method, ensuring that this optimization will always be applied, and thus freeing the user from having to // worry about what port to configure when using Progress Data Cloud. - if (securityContext instanceof MarkLogicCloudAuthContext || securityContext instanceof ProgressDataCloudAuthContext) { + if (securityContext instanceof ProgressDataCloudAuthContext) { port = 443; } diff --git a/marklogic-client-api/src/main/java/com/marklogic/client/extra/gson/GSONHandle.java b/marklogic-client-api/src/main/java/com/marklogic/client/extra/gson/GSONHandle.java index 511bf4163..dfdbbbb90 100644 --- a/marklogic-client-api/src/main/java/com/marklogic/client/extra/gson/GSONHandle.java +++ b/marklogic-client-api/src/main/java/com/marklogic/client/extra/gson/GSONHandle.java @@ -3,12 +3,6 @@ */ package com.marklogic.client.extra.gson; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; - import com.google.gson.JsonElement; import com.google.gson.JsonIOException; import com.google.gson.JsonParser; @@ -16,9 +10,14 @@ import com.marklogic.client.MarkLogicIOException; import com.marklogic.client.io.BaseHandle; import com.marklogic.client.io.Format; -import com.marklogic.client.io.marker.ResendableContentHandle; import com.marklogic.client.io.marker.*; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; + /** * A GSONHandle represents JSON content as a GSON JsonElement for reading or * writing. You must install the GSON library to use this class. @@ -83,18 +82,6 @@ public GSONHandle[] newHandleArray(int length) { return new GSONHandle[length]; } - /** - * Returns the parser used to construct element objects from JSON. - * @return the JSON parser. - * @deprecated Use static methods like JsonParser.parseString() or JsonParser.parseReader() directly instead - */ - @Deprecated - public JsonParser getParser() { - if (parser == null) - parser = new JsonParser(); - return parser; - } - /** * Returns the root node of the JSON tree. * @return the JSON root element. diff --git a/marklogic-client-api/src/main/java/com/marklogic/client/impl/okhttp/OkHttpUtil.java b/marklogic-client-api/src/main/java/com/marklogic/client/impl/okhttp/OkHttpUtil.java index 9d0f384ae..e3f9d4bd1 100644 --- a/marklogic-client-api/src/main/java/com/marklogic/client/impl/okhttp/OkHttpUtil.java +++ b/marklogic-client-api/src/main/java/com/marklogic/client/impl/okhttp/OkHttpUtil.java @@ -51,9 +51,7 @@ public static OkHttpClient.Builder newOkHttpClientBuilder(String host, DatabaseC } else if (securityContext instanceof DatabaseClientFactory.CertificateAuthContext) { } else if (securityContext instanceof DatabaseClientFactory.SAMLAuthContext) { configureSAMLAuth((DatabaseClientFactory.SAMLAuthContext) securityContext, clientBuilder); - } else if (securityContext instanceof DatabaseClientFactory.ProgressDataCloudAuthContext || - // It's fine to refer to this deprecated class as it needs to be supported until Java Client 8. - securityContext instanceof DatabaseClientFactory.MarkLogicCloudAuthContext) { + } else if (securityContext instanceof DatabaseClientFactory.ProgressDataCloudAuthContext) { authenticationConfigurer = new ProgressDataCloudAuthenticationConfigurer(host); } else if (securityContext instanceof DatabaseClientFactory.OAuthContext) { authenticationConfigurer = new OAuthAuthenticationConfigurer(); diff --git a/ml-development-tools/src/test/example-project/build.gradle b/ml-development-tools/src/test/example-project/build.gradle index c0ce194f3..0ec53c470 100644 --- a/ml-development-tools/src/test/example-project/build.gradle +++ b/ml-development-tools/src/test/example-project/build.gradle @@ -4,7 +4,7 @@ buildscript { mavenCentral() } dependencies { - classpath "com.marklogic:ml-development-tools:7.2.0" + classpath "com.marklogic:ml-development-tools:8.0.0" } } @@ -23,11 +23,11 @@ repositories { } dependencies { - implementation 'com.marklogic:marklogic-client-api:7.2.0' + implementation 'com.marklogic:marklogic-client-api:8.0.0' } tasks.register("testFullPath", com.marklogic.client.tools.gradle.EndpointProxiesGenTask) { - serviceDeclarationFile = "/Users/rrudin/workspace/java-client-api/example-project/src/main/ml-modules/root/inventory/service.json" + serviceDeclarationFile = "/Users/rudin/workspace/java-client-api/ml-development-tools/src/test/example-project/src/main/ml-modules/root/inventory/service.json" } tasks.register("testProjectPath", com.marklogic.client.tools.gradle.EndpointProxiesGenTask) {