Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit d6cec23

Browse files
authored
Merge pull request #201 from marklogic/release/4.7
Release/4.7
2 parents d4bcbb2 + 28f49af commit d6cec23

13 files changed

+264
-65
lines changed

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pipeline{
1414
stages{
1515
stage('tests'){
1616
steps{
17-
copyRPM 'Release','10.0-9.4'
17+
copyRPM 'Release','11.1.0'
1818
setUpML '$WORKSPACE/xdmp/src/Mark*.rpm'
1919
sh label:'test', script: '''#!/bin/bash
2020
export JAVA_HOME=$JAVA_HOME_DIR

build.gradle

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ plugins {
1010

1111
// For deploying the test app.
1212
id 'net.saliman.properties' version '1.5.2'
13-
id "com.marklogic.ml-gradle" version "4.5.2"
13+
id "com.marklogic.ml-gradle" version "4.6.1"
1414
}
1515

1616
group = "com.marklogic"
17-
version = "4.6.0"
17+
version = "4.7.0"
1818

1919
java {
2020
sourceCompatibility = 1.8
@@ -24,33 +24,33 @@ java {
2424
repositories {
2525
mavenLocal()
2626
maven {
27-
url "https://nexus.marklogic.com/repository/maven-snapshots/"
27+
url "https://bed-artifactory.bedford.progress.com:443/artifactory/ml-maven-snapshots/"
2828
}
2929
mavenCentral()
3030
}
3131

3232
dependencies {
33-
api 'com.marklogic:marklogic-client-api:6.3.0'
34-
api 'com.marklogic:marklogic-xcc:11.0.3'
35-
api 'org.springframework:spring-context:5.3.29'
33+
api 'com.marklogic:marklogic-client-api:6.5.0'
34+
api 'com.marklogic:marklogic-xcc:11.1.0'
35+
api 'org.springframework:spring-context:5.3.31'
3636

3737
implementation 'org.jdom:jdom2:2.0.6.1'
3838

39-
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
39+
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.3'
4040

4141
// This is currently an implementation dependency, though perhaps should be an api dependency due to its usage in
4242
// LoggingObject; not clear yet on whether the protected Logger in that class should make this an api dependency or not
4343
implementation 'org.slf4j:slf4j-api:1.7.36'
4444

45-
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.0'
46-
testImplementation 'org.springframework:spring-test:5.3.29'
45+
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
46+
testImplementation 'org.springframework:spring-test:5.3.31'
4747
testImplementation 'org.mockito:mockito-core:4.11.0'
4848

4949
// Used for testing loading modules from the classpath
5050
testImplementation files("lib/modules.jar")
5151

5252
// Forcing Spring to use logback instead of commons-logging
53-
testImplementation "ch.qos.logback:logback-classic:1.3.5" // Not using 1.4.x yet as it requires Java 11
53+
testImplementation "ch.qos.logback:logback-classic:1.3.14" // Not using 1.4.x yet as it requires Java 11
5454
testImplementation "org.slf4j:jcl-over-slf4j:1.7.36"
5555
testImplementation "org.slf4j:slf4j-api:1.7.36"
5656

@@ -73,12 +73,12 @@ test {
7373
}
7474

7575
task sourcesJar(type: Jar, dependsOn: classes) {
76-
classifier 'sources'
76+
archiveClassifier = 'sources'
7777
from sourceSets.main.allSource
7878
}
7979

8080
task javadocJar(type: Jar, dependsOn: javadoc) {
81-
classifier "javadoc"
81+
archiveClassifier = "javadoc"
8282
from javadoc
8383
}
8484
javadoc.failOnError = false
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

src/main/java/com/marklogic/client/ext/DatabaseClientConfig.java

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ public class DatabaseClientConfig {
4949
private String cloudApiKey;
5050
private String basePath;
5151

52+
private String keyStorePath;
53+
private String keyStorePassword;
54+
private String keyStoreType;
55+
private String keyStoreAlgorithm;
56+
private String trustStorePath;
57+
private String trustStorePassword;
58+
private String trustStoreType;
59+
private String trustStoreAlgorithm;
60+
5261
public DatabaseClientConfig() {
5362
}
5463

@@ -236,4 +245,148 @@ public String getSamlToken() {
236245
public void setSamlToken(String samlToken) {
237246
this.samlToken = samlToken;
238247
}
248+
249+
/**
250+
*
251+
* @return
252+
* @since 4.7.0
253+
*/
254+
public String getKeyStorePath() {
255+
return keyStorePath;
256+
}
257+
258+
/**
259+
*
260+
* @param keyStorePath
261+
* @since 4.7.0
262+
*/
263+
public void setKeyStorePath(String keyStorePath) {
264+
this.keyStorePath = keyStorePath;
265+
}
266+
267+
/**
268+
*
269+
* @return
270+
* @since 4.7.0
271+
*/
272+
public String getKeyStorePassword() {
273+
return keyStorePassword;
274+
}
275+
276+
/**
277+
*
278+
* @param keyStorePassword
279+
* @since 4.7.0
280+
*/
281+
public void setKeyStorePassword(String keyStorePassword) {
282+
this.keyStorePassword = keyStorePassword;
283+
}
284+
285+
/**
286+
*
287+
* @return
288+
* @since 4.7.0
289+
*/
290+
public String getKeyStoreType() {
291+
return keyStoreType;
292+
}
293+
294+
/**
295+
*
296+
* @param keyStoreType
297+
* @since 4.7.0
298+
*/
299+
public void setKeyStoreType(String keyStoreType) {
300+
this.keyStoreType = keyStoreType;
301+
}
302+
303+
/**
304+
*
305+
* @return
306+
* @since 4.7.0
307+
*/
308+
public String getKeyStoreAlgorithm() {
309+
return keyStoreAlgorithm;
310+
}
311+
312+
/**
313+
*
314+
* @param keyStoreAlgorithm
315+
* @since 4.7.0
316+
*/
317+
public void setKeyStoreAlgorithm(String keyStoreAlgorithm) {
318+
this.keyStoreAlgorithm = keyStoreAlgorithm;
319+
}
320+
321+
/**
322+
*
323+
* @return
324+
* @since 4.7.0
325+
*/
326+
public String getTrustStorePath() {
327+
return trustStorePath;
328+
}
329+
330+
/**
331+
*
332+
* @param trustStorePath
333+
* @since 4.7.0
334+
*/
335+
public void setTrustStorePath(String trustStorePath) {
336+
this.trustStorePath = trustStorePath;
337+
}
338+
339+
/**
340+
*
341+
* @return
342+
* @since 4.7.0
343+
*/
344+
public String getTrustStorePassword() {
345+
return trustStorePassword;
346+
}
347+
348+
/**
349+
*
350+
* @param trustStorePassword
351+
* @since 4.7.0
352+
*/
353+
public void setTrustStorePassword(String trustStorePassword) {
354+
this.trustStorePassword = trustStorePassword;
355+
}
356+
357+
/**
358+
*
359+
* @return
360+
* @since 4.7.0
361+
*/
362+
public String getTrustStoreType() {
363+
return trustStoreType;
364+
}
365+
366+
/**
367+
*
368+
* @param trustStoreType
369+
* @since 4.7.0
370+
*/
371+
public void setTrustStoreType(String trustStoreType) {
372+
this.trustStoreType = trustStoreType;
373+
}
374+
375+
/**
376+
*
377+
* @return
378+
* @since 4.7.0
379+
*/
380+
public String getTrustStoreAlgorithm() {
381+
return trustStoreAlgorithm;
382+
}
383+
384+
/**
385+
*
386+
* @param trustStoreAlgorithm
387+
* @since 4.7.0
388+
*/
389+
public void setTrustStoreAlgorithm(String trustStoreAlgorithm) {
390+
this.trustStoreAlgorithm = trustStoreAlgorithm;
391+
}
239392
}

src/main/java/com/marklogic/client/ext/DefaultConfiguredDatabaseClientFactory.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,16 @@ public DatabaseClient newDatabaseClient(DatabaseClientConfig config) {
4848
.withSAMLToken(config.getSamlToken())
4949
.withCloudApiKey(config.getCloudApiKey())
5050
.withSSLProtocol(config.getSslProtocol())
51-
.withSSLHostnameVerifier(config.getSslHostnameVerifier());
51+
.withSSLHostnameVerifier(config.getSslHostnameVerifier())
52+
// The following 8 were added for 4.7.0 based on Java Client 6.5.0
53+
.withKeyStorePath(config.getKeyStorePath())
54+
.withKeyStorePassword(config.getKeyStorePassword())
55+
.withKeyStoreType(config.getKeyStoreType())
56+
.withKeyStoreAlgorithm(config.getKeyStoreAlgorithm())
57+
.withTrustStorePath(config.getTrustStorePath())
58+
.withTrustStorePassword(config.getTrustStorePassword())
59+
.withTrustStoreType(config.getTrustStoreType())
60+
.withTrustStoreAlgorithm(config.getTrustStoreAlgorithm());
5261

5362
if (config.getSecurityContextType() != null) {
5463
builder.withAuthType(config.getSecurityContextType().name());

src/main/java/com/marklogic/client/ext/file/CollectionsFileDocumentFileProcessor.java

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
*/
1616
package com.marklogic.client.ext.file;
1717

18-
import java.util.Properties;
19-
2018
/**
2119
* Looks for a special file in each directory - defaults to collections.properties - that contains properties where the
2220
* key is the name of a file in the directory, and the value is a comma-delimited list of collections to load the file
@@ -34,18 +32,8 @@ public CollectionsFileDocumentFileProcessor(String propertiesFilename) {
3432
super(propertiesFilename);
3533
}
3634

37-
@Override
38-
protected void processProperties(DocumentFile documentFile, Properties properties) {
39-
String name = documentFile.getFile().getName();
40-
if (properties.containsKey(name)) {
41-
String value = getPropertyValue(properties, name);
42-
documentFile.getDocumentMetadata().withCollections(value.split(delimiter));
43-
}
44-
45-
if (properties.containsKey(WILDCARD_KEY)) {
46-
String value = getPropertyValue(properties, WILDCARD_KEY);
47-
documentFile.getDocumentMetadata().withCollections(value.split(delimiter));
48-
}
35+
protected void applyPropertyMatch(DocumentFile documentFile, String pattern, String value) {
36+
documentFile.getDocumentMetadata().withCollections(value.split(delimiter));
4937
}
5038

5139
public String getDelimiter() {

src/main/java/com/marklogic/client/ext/file/PermissionsFileDocumentFileProcessor.java

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717

1818
import com.marklogic.client.ext.util.DocumentPermissionsParser;
1919

20+
import java.nio.file.FileSystems;
21+
import java.nio.file.Path;
22+
import java.nio.file.PathMatcher;
23+
import java.util.Enumeration;
2024
import java.util.Properties;
2125

2226
/**
@@ -46,26 +50,11 @@ public PermissionsFileDocumentFileProcessor(String propertiesFilename, DocumentP
4650
this.documentPermissionsParser = documentPermissionsParser;
4751
}
4852

49-
@Override
50-
protected void processProperties(DocumentFile documentFile, Properties properties) {
51-
String name = documentFile.getFile().getName();
52-
if (properties.containsKey(name)) {
53-
String value = getPropertyValue(properties, name);
54-
if (documentPermissionsParser != null) {
55-
documentPermissionsParser.parsePermissions(value, documentFile.getDocumentMetadata().getPermissions());
56-
} else {
57-
documentFile.getDocumentMetadata().getPermissions().addFromDelimitedString(value);
58-
}
59-
60-
}
61-
62-
if (properties.containsKey(WILDCARD_KEY)) {
63-
String value = getPropertyValue(properties, WILDCARD_KEY);
64-
if (documentPermissionsParser != null) {
65-
documentPermissionsParser.parsePermissions(value, documentFile.getDocumentMetadata().getPermissions());
66-
} else {
67-
documentFile.getDocumentMetadata().getPermissions().addFromDelimitedString(value);
68-
}
53+
protected void applyPropertyMatch(DocumentFile documentFile, String pattern, String value) {
54+
if (documentPermissionsParser != null) {
55+
documentPermissionsParser.parsePermissions(value, documentFile.getDocumentMetadata().getPermissions());
56+
} else {
57+
documentFile.getDocumentMetadata().getPermissions().addFromDelimitedString(value);
6958
}
7059
}
7160

0 commit comments

Comments
 (0)