@@ -350,52 +350,113 @@ public SecurityContext withSSLContext(SSLContext context, X509TrustManager trust
350
350
351
351
/**
352
352
* @since 6.1.0
353
+ * @deprecated as of 7.2.0; use {@code ProgressDataCloudAuthContext} instead. Will be removed in 8.0.0.
353
354
*/
354
- public static class MarkLogicCloudAuthContext extends AuthContext {
355
+ @ Deprecated
356
+ public static class MarkLogicCloudAuthContext extends ProgressDataCloudAuthContext {
357
+
358
+ /**
359
+ * @param apiKey user's API key for accessing Progress Data Cloud
360
+ */
361
+ public MarkLogicCloudAuthContext (String apiKey ) {
362
+ super (apiKey );
363
+ }
364
+
365
+ /**
366
+ * @param apiKey user's API key for accessing Progress Data Cloud
367
+ * @param tokenDuration length in minutes until the generated access token expires
368
+ * @since 6.3.0
369
+ */
370
+ public MarkLogicCloudAuthContext (String apiKey , Integer tokenDuration ) {
371
+ super (apiKey , tokenDuration );
372
+ }
373
+
374
+ /**
375
+ * Only intended to be used in the scenario that the token endpoint of "/token" and the grant type of "apikey"
376
+ * are not the intended values.
377
+ *
378
+ * @param apiKey user's API key for accessing Progress Data Cloud
379
+ * @param tokenEndpoint for overriding the default token endpoint if necessary
380
+ * @param grantType for overriding the default grant type if necessary
381
+ */
382
+ public MarkLogicCloudAuthContext (String apiKey , String tokenEndpoint , String grantType ) {
383
+ super (apiKey , tokenEndpoint , grantType );
384
+ }
385
+
386
+ /**
387
+ * Only intended to be used in the scenario that the token endpoint of "/token" and the grant type of "apikey"
388
+ * are not the intended values.
389
+ *
390
+ * @param apiKey user's API key for accessing Progress Data Cloud
391
+ * @param tokenEndpoint for overriding the default token endpoint if necessary
392
+ * @param grantType for overriding the default grant type if necessary
393
+ * @param tokenDuration length in minutes until the generated access token expires
394
+ * @since 6.3.0
395
+ */
396
+ public MarkLogicCloudAuthContext (String apiKey , String tokenEndpoint , String grantType , Integer tokenDuration ) {
397
+ super (apiKey , tokenEndpoint , grantType , tokenDuration );
398
+ }
399
+
400
+ @ Override
401
+ public MarkLogicCloudAuthContext withSSLContext (SSLContext context , X509TrustManager trustManager ) {
402
+ this .sslContext = context ;
403
+ this .trustManager = trustManager ;
404
+ return this ;
405
+ }
406
+
407
+ @ Override
408
+ public MarkLogicCloudAuthContext withSSLHostnameVerifier (SSLHostnameVerifier verifier ) {
409
+ this .sslVerifier = verifier ;
410
+ return this ;
411
+ }
412
+ }
413
+
414
+ /**
415
+ * @since 7.2.0 Use this instead of the now-deprecated {@code MarkLogicCloudAuthContext}
416
+ */
417
+ public static class ProgressDataCloudAuthContext extends AuthContext {
355
418
private String tokenEndpoint ;
356
419
private String grantType ;
357
420
private String apiKey ;
358
421
private Integer tokenDuration ;
359
422
360
423
/**
361
- * @param apiKey user's API key for accessing MarkLogic Cloud
424
+ * @param apiKey user's API key for accessing Progress Data Cloud
362
425
*/
363
- public MarkLogicCloudAuthContext (String apiKey ) {
426
+ public ProgressDataCloudAuthContext (String apiKey ) {
364
427
this (apiKey , null );
365
428
}
366
429
367
430
/**
368
- * @param apiKey user's API key for accessing MarkLogic Cloud
431
+ * @param apiKey user's API key for accessing Progress Data Cloud
369
432
* @param tokenDuration length in minutes until the generated access token expires
370
- * @since 6.3.0
371
433
*/
372
- public MarkLogicCloudAuthContext (String apiKey , Integer tokenDuration ) {
434
+ public ProgressDataCloudAuthContext (String apiKey , Integer tokenDuration ) {
373
435
this (apiKey , "/token" , "apikey" , tokenDuration );
374
436
}
375
437
376
438
/**
377
439
* Only intended to be used in the scenario that the token endpoint of "/token" and the grant type of "apikey"
378
440
* are not the intended values.
379
441
*
380
- * @param apiKey user's API key for accessing MarkLogic Cloud
442
+ * @param apiKey user's API key for accessing Progress Data Cloud
381
443
* @param tokenEndpoint for overriding the default token endpoint if necessary
382
444
* @param grantType for overriding the default grant type if necessary
383
445
*/
384
- public MarkLogicCloudAuthContext (String apiKey , String tokenEndpoint , String grantType ) {
446
+ public ProgressDataCloudAuthContext (String apiKey , String tokenEndpoint , String grantType ) {
385
447
this (apiKey , tokenEndpoint , grantType , null );
386
448
}
387
449
388
450
/**
389
451
* Only intended to be used in the scenario that the token endpoint of "/token" and the grant type of "apikey"
390
452
* are not the intended values.
391
453
*
392
- * @param apiKey user's API key for accessing MarkLogic Cloud
454
+ * @param apiKey user's API key for accessing Progress Data Cloud
393
455
* @param tokenEndpoint for overriding the default token endpoint if necessary
394
456
* @param grantType for overriding the default grant type if necessary
395
457
* @param tokenDuration length in minutes until the generated access token expires
396
- * @since 6.3.0
397
458
*/
398
- public MarkLogicCloudAuthContext (String apiKey , String tokenEndpoint , String grantType , Integer tokenDuration ) {
459
+ public ProgressDataCloudAuthContext (String apiKey , String tokenEndpoint , String grantType , Integer tokenDuration ) {
399
460
this .apiKey = apiKey ;
400
461
this .tokenEndpoint = tokenEndpoint ;
401
462
this .grantType = grantType ;
@@ -414,23 +475,19 @@ public String getApiKey() {
414
475
return apiKey ;
415
476
}
416
477
417
- /**
418
- * @return
419
- * @since 6.3.0
420
- */
421
478
public Integer getTokenDuration () {
422
479
return tokenDuration ;
423
480
}
424
481
425
482
@ Override
426
- public MarkLogicCloudAuthContext withSSLContext (SSLContext context , X509TrustManager trustManager ) {
483
+ public ProgressDataCloudAuthContext withSSLContext (SSLContext context , X509TrustManager trustManager ) {
427
484
this .sslContext = context ;
428
485
this .trustManager = trustManager ;
429
486
return this ;
430
487
}
431
488
432
489
@ Override
433
- public MarkLogicCloudAuthContext withSSLHostnameVerifier (SSLHostnameVerifier verifier ) {
490
+ public ProgressDataCloudAuthContext withSSLHostnameVerifier (SSLHostnameVerifier verifier ) {
434
491
this .sslVerifier = verifier ;
435
492
return this ;
436
493
}
@@ -1277,10 +1334,10 @@ static public DatabaseClient newClient(String host, int port, String basePath, S
1277
1334
DatabaseClient .ConnectionType connectionType ) {
1278
1335
RESTServices services = new OkHttpServices ();
1279
1336
// As of 6.1.0, the following optimization is made as it's guaranteed that if the user is connecting to a
1280
- // MarkLogic Cloud instance, then port 443 will be used. Every path for constructing a DatabaseClient goes through
1337
+ // Progress Data Cloud instance, then port 443 will be used. Every path for constructing a DatabaseClient goes through
1281
1338
// this method, ensuring that this optimization will always be applied, and thus freeing the user from having to
1282
- // worry about what port to configure when using MarkLogic Cloud.
1283
- if (securityContext instanceof MarkLogicCloudAuthContext ) {
1339
+ // worry about what port to configure when using Progress Data Cloud.
1340
+ if (securityContext instanceof MarkLogicCloudAuthContext || securityContext instanceof ProgressDataCloudAuthContext ) {
1284
1341
port = 443 ;
1285
1342
}
1286
1343
services .connect (host , port , basePath , database , securityContext );
0 commit comments