From 1db4bc3b6c04e1b650275c2499f4ffaad997c9bd Mon Sep 17 00:00:00 2001 From: Jesse Gallagher Date: Tue, 22 Oct 2024 13:54:03 -0400 Subject: [PATCH 1/5] Set version to 1.43.1-SNAPSHOT --- domino-jnx-api/pom.xml | 2 +- domino-jnx-commons/pom.xml | 2 +- domino-jnx-console/pom.xml | 2 +- domino-jnx-jna/pom.xml | 2 +- example/jnx-example-domino-servlet/pom.xml | 2 +- example/jnx-example-domino-webapp-admin/pom.xml | 2 +- example/jnx-example-gluon/pom.xml | 2 +- example/jnx-example-graalvm-native/pom.xml | 2 +- example/jnx-example-runjava/pom.xml | 2 +- example/jnx-example-swt/pom.xml | 2 +- example/jnx-example-webapp/pom.xml | 2 +- integration/domino-jnx-jakarta-security/pom.xml | 2 +- integration/domino-jnx-jsonb/pom.xml | 2 +- integration/domino-jnx-lsxbeshim/pom.xml | 2 +- integration/domino-jnx-rawdoc-json/pom.xml | 2 +- integration/domino-jnx-vertx-json/pom.xml | 2 +- integration/domino-jnx-xpages/pom.xml | 2 +- pom.xml | 2 +- test/it-domino-jnx/pom.xml | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/domino-jnx-api/pom.xml b/domino-jnx-api/pom.xml index 25f3c477..211e395b 100644 --- a/domino-jnx-api/pom.xml +++ b/domino-jnx-api/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.0 + 1.43.1-SNAPSHOT domino-jnx-api HCL Domino API diff --git a/domino-jnx-commons/pom.xml b/domino-jnx-commons/pom.xml index 0b038c90..69eebcef 100644 --- a/domino-jnx-commons/pom.xml +++ b/domino-jnx-commons/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.0 + 1.43.1-SNAPSHOT domino-jnx-commons HCL Domino API Common Code diff --git a/domino-jnx-console/pom.xml b/domino-jnx-console/pom.xml index d60c4759..55c9a536 100644 --- a/domino-jnx-console/pom.xml +++ b/domino-jnx-console/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.0 + 1.43.1-SNAPSHOT domino-jnx-console HCL Domino API Server Controller Connector diff --git a/domino-jnx-jna/pom.xml b/domino-jnx-jna/pom.xml index a9f1c98a..6539cb7c 100644 --- a/domino-jnx-jna/pom.xml +++ b/domino-jnx-jna/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.0 + 1.43.1-SNAPSHOT domino-jnx-jna HCL Domino API, JNA Implementation diff --git a/example/jnx-example-domino-servlet/pom.xml b/example/jnx-example-domino-servlet/pom.xml index 62955aa0..0d4abc11 100644 --- a/example/jnx-example-domino-servlet/pom.xml +++ b/example/jnx-example-domino-servlet/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.0 + 1.43.1-SNAPSHOT ../.. jnx-example-domino-servlet diff --git a/example/jnx-example-domino-webapp-admin/pom.xml b/example/jnx-example-domino-webapp-admin/pom.xml index 9b9c9e68..bc7e0c1d 100644 --- a/example/jnx-example-domino-webapp-admin/pom.xml +++ b/example/jnx-example-domino-webapp-admin/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.0 + 1.43.1-SNAPSHOT ../.. jnx-example-domino-webapp-admin diff --git a/example/jnx-example-gluon/pom.xml b/example/jnx-example-gluon/pom.xml index 76213a7e..2b93f8c4 100644 --- a/example/jnx-example-gluon/pom.xml +++ b/example/jnx-example-gluon/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.0 + 1.43.1-SNAPSHOT ../.. jnx-example-gluon diff --git a/example/jnx-example-graalvm-native/pom.xml b/example/jnx-example-graalvm-native/pom.xml index 2c1306be..1c1c2299 100644 --- a/example/jnx-example-graalvm-native/pom.xml +++ b/example/jnx-example-graalvm-native/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.0 + 1.43.1-SNAPSHOT ../.. jnx-example-graalvm-native diff --git a/example/jnx-example-runjava/pom.xml b/example/jnx-example-runjava/pom.xml index a2fc25dd..37ef8aea 100644 --- a/example/jnx-example-runjava/pom.xml +++ b/example/jnx-example-runjava/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.0 + 1.43.1-SNAPSHOT ../.. jnx-example-runjava diff --git a/example/jnx-example-swt/pom.xml b/example/jnx-example-swt/pom.xml index 75d83429..2514b720 100644 --- a/example/jnx-example-swt/pom.xml +++ b/example/jnx-example-swt/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.0 + 1.43.1-SNAPSHOT ../.. jnx-example-swt diff --git a/example/jnx-example-webapp/pom.xml b/example/jnx-example-webapp/pom.xml index 30f280d3..f80aba5c 100644 --- a/example/jnx-example-webapp/pom.xml +++ b/example/jnx-example-webapp/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.0 + 1.43.1-SNAPSHOT ../.. jnx-example-webapp diff --git a/integration/domino-jnx-jakarta-security/pom.xml b/integration/domino-jnx-jakarta-security/pom.xml index 62fd4f6f..09c5c94a 100644 --- a/integration/domino-jnx-jakarta-security/pom.xml +++ b/integration/domino-jnx-jakarta-security/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.0 + 1.43.1-SNAPSHOT ../.. domino-jnx-jakarta-security diff --git a/integration/domino-jnx-jsonb/pom.xml b/integration/domino-jnx-jsonb/pom.xml index 630a229c..9472b9b6 100644 --- a/integration/domino-jnx-jsonb/pom.xml +++ b/integration/domino-jnx-jsonb/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.0 + 1.43.1-SNAPSHOT ../.. domino-jnx-jsonb diff --git a/integration/domino-jnx-lsxbeshim/pom.xml b/integration/domino-jnx-lsxbeshim/pom.xml index f399ab9e..cae7735c 100644 --- a/integration/domino-jnx-lsxbeshim/pom.xml +++ b/integration/domino-jnx-lsxbeshim/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.0 + 1.43.1-SNAPSHOT ../.. domino-jnx-lsxbeshim diff --git a/integration/domino-jnx-rawdoc-json/pom.xml b/integration/domino-jnx-rawdoc-json/pom.xml index 9e672dd7..160257d2 100644 --- a/integration/domino-jnx-rawdoc-json/pom.xml +++ b/integration/domino-jnx-rawdoc-json/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.0 + 1.43.1-SNAPSHOT ../.. domino-jnx-rawdoc-json diff --git a/integration/domino-jnx-vertx-json/pom.xml b/integration/domino-jnx-vertx-json/pom.xml index df5abf36..b91f21cf 100644 --- a/integration/domino-jnx-vertx-json/pom.xml +++ b/integration/domino-jnx-vertx-json/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.0 + 1.43.1-SNAPSHOT ../.. domino-jnx-vertx-json diff --git a/integration/domino-jnx-xpages/pom.xml b/integration/domino-jnx-xpages/pom.xml index 2f98f033..86b0f54c 100644 --- a/integration/domino-jnx-xpages/pom.xml +++ b/integration/domino-jnx-xpages/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.0 + 1.43.1-SNAPSHOT ../.. domino-jnx-xpages diff --git a/pom.xml b/pom.xml index a90991d9..6f146cb3 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ 4.0.0 com.hcl.domino domino-jnx - 1.43.0 + 1.43.1-SNAPSHOT pom HCL Domino API Parent Project Modern Java API for HCL Domino diff --git a/test/it-domino-jnx/pom.xml b/test/it-domino-jnx/pom.xml index 811b3248..3d3550ac 100644 --- a/test/it-domino-jnx/pom.xml +++ b/test/it-domino-jnx/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.0 + 1.43.1-SNAPSHOT ../.. it-domino-jnx From 8fc0050a3882d6a75bb8b60417e40f44fc381128 Mon Sep 17 00:00:00 2001 From: Jesse Gallagher Date: Wed, 23 Oct 2024 10:55:01 -0400 Subject: [PATCH 2/5] Set version to 1.44.0-SNAPSHOT --- domino-jnx-api/pom.xml | 2 +- domino-jnx-commons/pom.xml | 2 +- domino-jnx-console/pom.xml | 2 +- domino-jnx-jna/pom.xml | 2 +- example/jnx-example-domino-servlet/pom.xml | 2 +- example/jnx-example-domino-webapp-admin/pom.xml | 2 +- example/jnx-example-gluon/pom.xml | 2 +- example/jnx-example-graalvm-native/pom.xml | 2 +- example/jnx-example-runjava/pom.xml | 2 +- example/jnx-example-swt/pom.xml | 2 +- example/jnx-example-webapp/pom.xml | 2 +- integration/domino-jnx-jakarta-security/pom.xml | 2 +- integration/domino-jnx-jsonb/pom.xml | 2 +- integration/domino-jnx-lsxbeshim/pom.xml | 2 +- integration/domino-jnx-rawdoc-json/pom.xml | 2 +- integration/domino-jnx-vertx-json/pom.xml | 2 +- integration/domino-jnx-xpages/pom.xml | 2 +- pom.xml | 2 +- test/it-domino-jnx/pom.xml | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/domino-jnx-api/pom.xml b/domino-jnx-api/pom.xml index 211e395b..234773d3 100644 --- a/domino-jnx-api/pom.xml +++ b/domino-jnx-api/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.1-SNAPSHOT + 1.44.0-SNAPSHOT domino-jnx-api HCL Domino API diff --git a/domino-jnx-commons/pom.xml b/domino-jnx-commons/pom.xml index 69eebcef..2cec8b21 100644 --- a/domino-jnx-commons/pom.xml +++ b/domino-jnx-commons/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.1-SNAPSHOT + 1.44.0-SNAPSHOT domino-jnx-commons HCL Domino API Common Code diff --git a/domino-jnx-console/pom.xml b/domino-jnx-console/pom.xml index 55c9a536..173c6a9f 100644 --- a/domino-jnx-console/pom.xml +++ b/domino-jnx-console/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.1-SNAPSHOT + 1.44.0-SNAPSHOT domino-jnx-console HCL Domino API Server Controller Connector diff --git a/domino-jnx-jna/pom.xml b/domino-jnx-jna/pom.xml index 6539cb7c..2456d48c 100644 --- a/domino-jnx-jna/pom.xml +++ b/domino-jnx-jna/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.1-SNAPSHOT + 1.44.0-SNAPSHOT domino-jnx-jna HCL Domino API, JNA Implementation diff --git a/example/jnx-example-domino-servlet/pom.xml b/example/jnx-example-domino-servlet/pom.xml index 0d4abc11..45492a29 100644 --- a/example/jnx-example-domino-servlet/pom.xml +++ b/example/jnx-example-domino-servlet/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.1-SNAPSHOT + 1.44.0-SNAPSHOT ../.. jnx-example-domino-servlet diff --git a/example/jnx-example-domino-webapp-admin/pom.xml b/example/jnx-example-domino-webapp-admin/pom.xml index bc7e0c1d..4d17a825 100644 --- a/example/jnx-example-domino-webapp-admin/pom.xml +++ b/example/jnx-example-domino-webapp-admin/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.1-SNAPSHOT + 1.44.0-SNAPSHOT ../.. jnx-example-domino-webapp-admin diff --git a/example/jnx-example-gluon/pom.xml b/example/jnx-example-gluon/pom.xml index 2b93f8c4..30fc6273 100644 --- a/example/jnx-example-gluon/pom.xml +++ b/example/jnx-example-gluon/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.1-SNAPSHOT + 1.44.0-SNAPSHOT ../.. jnx-example-gluon diff --git a/example/jnx-example-graalvm-native/pom.xml b/example/jnx-example-graalvm-native/pom.xml index 1c1c2299..b9c1829e 100644 --- a/example/jnx-example-graalvm-native/pom.xml +++ b/example/jnx-example-graalvm-native/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.1-SNAPSHOT + 1.44.0-SNAPSHOT ../.. jnx-example-graalvm-native diff --git a/example/jnx-example-runjava/pom.xml b/example/jnx-example-runjava/pom.xml index 37ef8aea..f662990e 100644 --- a/example/jnx-example-runjava/pom.xml +++ b/example/jnx-example-runjava/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.1-SNAPSHOT + 1.44.0-SNAPSHOT ../.. jnx-example-runjava diff --git a/example/jnx-example-swt/pom.xml b/example/jnx-example-swt/pom.xml index 2514b720..b3365fec 100644 --- a/example/jnx-example-swt/pom.xml +++ b/example/jnx-example-swt/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.1-SNAPSHOT + 1.44.0-SNAPSHOT ../.. jnx-example-swt diff --git a/example/jnx-example-webapp/pom.xml b/example/jnx-example-webapp/pom.xml index f80aba5c..43c39281 100644 --- a/example/jnx-example-webapp/pom.xml +++ b/example/jnx-example-webapp/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.1-SNAPSHOT + 1.44.0-SNAPSHOT ../.. jnx-example-webapp diff --git a/integration/domino-jnx-jakarta-security/pom.xml b/integration/domino-jnx-jakarta-security/pom.xml index 09c5c94a..58f2f417 100644 --- a/integration/domino-jnx-jakarta-security/pom.xml +++ b/integration/domino-jnx-jakarta-security/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.1-SNAPSHOT + 1.44.0-SNAPSHOT ../.. domino-jnx-jakarta-security diff --git a/integration/domino-jnx-jsonb/pom.xml b/integration/domino-jnx-jsonb/pom.xml index 9472b9b6..24668597 100644 --- a/integration/domino-jnx-jsonb/pom.xml +++ b/integration/domino-jnx-jsonb/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.1-SNAPSHOT + 1.44.0-SNAPSHOT ../.. domino-jnx-jsonb diff --git a/integration/domino-jnx-lsxbeshim/pom.xml b/integration/domino-jnx-lsxbeshim/pom.xml index cae7735c..d0d554f1 100644 --- a/integration/domino-jnx-lsxbeshim/pom.xml +++ b/integration/domino-jnx-lsxbeshim/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.1-SNAPSHOT + 1.44.0-SNAPSHOT ../.. domino-jnx-lsxbeshim diff --git a/integration/domino-jnx-rawdoc-json/pom.xml b/integration/domino-jnx-rawdoc-json/pom.xml index 160257d2..53601f28 100644 --- a/integration/domino-jnx-rawdoc-json/pom.xml +++ b/integration/domino-jnx-rawdoc-json/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.1-SNAPSHOT + 1.44.0-SNAPSHOT ../.. domino-jnx-rawdoc-json diff --git a/integration/domino-jnx-vertx-json/pom.xml b/integration/domino-jnx-vertx-json/pom.xml index b91f21cf..e5bb2886 100644 --- a/integration/domino-jnx-vertx-json/pom.xml +++ b/integration/domino-jnx-vertx-json/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.1-SNAPSHOT + 1.44.0-SNAPSHOT ../.. domino-jnx-vertx-json diff --git a/integration/domino-jnx-xpages/pom.xml b/integration/domino-jnx-xpages/pom.xml index 86b0f54c..21a80569 100644 --- a/integration/domino-jnx-xpages/pom.xml +++ b/integration/domino-jnx-xpages/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.1-SNAPSHOT + 1.44.0-SNAPSHOT ../.. domino-jnx-xpages diff --git a/pom.xml b/pom.xml index 6f146cb3..10cfb33d 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ 4.0.0 com.hcl.domino domino-jnx - 1.43.1-SNAPSHOT + 1.44.0-SNAPSHOT pom HCL Domino API Parent Project Modern Java API for HCL Domino diff --git a/test/it-domino-jnx/pom.xml b/test/it-domino-jnx/pom.xml index 3d3550ac..240ea03d 100644 --- a/test/it-domino-jnx/pom.xml +++ b/test/it-domino-jnx/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.43.1-SNAPSHOT + 1.44.0-SNAPSHOT ../.. it-domino-jnx From 9be5e2875bac186a77f036519d58bf20437aae3c Mon Sep 17 00:00:00 2001 From: Jesse Gallagher Date: Wed, 23 Oct 2024 11:55:38 -0400 Subject: [PATCH 3/5] Add CollectionData access (Issue #442) --- .../java/com/hcl/domino/constants/Nif.java | 27 ++++++++++ .../com/hcl/domino/data/DominoCollection.java | 13 ++++- .../data/structures/CollectionData.java | 53 +++++++++++++++++++ .../com/hcl/domino/misc/NotesConstants.java | 3 +- .../domino/jna/data/JNADominoCollection.java | 31 +++++++++++ .../domino/jna/internal/capi/INotesCAPI.java | 8 +++ .../domino/test/queries/TestViewQueries.java | 1 + 7 files changed, 134 insertions(+), 2 deletions(-) create mode 100644 domino-jnx-api/src/main/java/com/hcl/domino/constants/Nif.java create mode 100644 domino-jnx-api/src/main/java/com/hcl/domino/data/structures/CollectionData.java diff --git a/domino-jnx-api/src/main/java/com/hcl/domino/constants/Nif.java b/domino-jnx-api/src/main/java/com/hcl/domino/constants/Nif.java new file mode 100644 index 00000000..77cb0f3a --- /dev/null +++ b/domino-jnx-api/src/main/java/com/hcl/domino/constants/Nif.java @@ -0,0 +1,27 @@ +/* + * ========================================================================== + * Copyright (C) 2019-2024 HCL America, Inc. ( http://www.hcl.com/ ) + * All rights reserved. + * ========================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"). You may + * not use this file except in compliance with the License. You may obtain a + * copy of the License at . + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * ========================================================================== + */ +package com.hcl.domino.constants; + +/** + * Represents constants originally from the {@code editods.h} header file. + * + * @author Jesse Gallagher + * @since 1.44.0 + */ +public interface Nif { + int PERCENTILE_COUNT = 11; +} diff --git a/domino-jnx-api/src/main/java/com/hcl/domino/data/DominoCollection.java b/domino-jnx-api/src/main/java/com/hcl/domino/data/DominoCollection.java index 02ef72a4..c6403fe5 100644 --- a/domino-jnx-api/src/main/java/com/hcl/domino/data/DominoCollection.java +++ b/domino-jnx-api/src/main/java/com/hcl/domino/data/DominoCollection.java @@ -21,7 +21,7 @@ import java.util.List; import java.util.Set; import java.util.function.BiConsumer; - +import com.hcl.domino.data.structures.CollectionData; import com.hcl.domino.misc.DominoClientDescendant; import com.hcl.domino.misc.Loop; @@ -95,6 +95,17 @@ public enum Direction { * @return sorted set of note ids */ Set getAllIdsByKey(Set findFlags, Object key); + + /** + * Retrieve detailed information about the collection itself, such + * as the number of documents in the collection and the total size + * of the document entries in the collection. + * + * @return a {@link CollectionData} instance representing information + * about the collection + * @since 1.44.0 + */ + CollectionData getCollectionData(); List getColumns(); diff --git a/domino-jnx-api/src/main/java/com/hcl/domino/data/structures/CollectionData.java b/domino-jnx-api/src/main/java/com/hcl/domino/data/structures/CollectionData.java new file mode 100644 index 00000000..8f0fac0b --- /dev/null +++ b/domino-jnx-api/src/main/java/com/hcl/domino/data/structures/CollectionData.java @@ -0,0 +1,53 @@ +/* + * ========================================================================== + * Copyright (C) 2019-2024 HCL America, Inc. ( http://www.hcl.com/ ) + * All rights reserved. + * ========================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"). You may + * not use this file except in compliance with the License. You may obtain a + * copy of the License at . + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * ========================================================================== + */ +package com.hcl.domino.data.structures; + +import com.hcl.domino.misc.NotesConstants; +import com.hcl.domino.richtext.annotation.StructureDefinition; +import com.hcl.domino.richtext.annotation.StructureGetter; +import com.hcl.domino.richtext.annotation.StructureMember; +import com.hcl.domino.richtext.structures.MemoryStructure; + +/** + * Represents aggregate data about a view or folder. + * + * @since 1.44.0 + */ +@StructureDefinition( + name = "COLLECTIONDATA", + members = { + @StructureMember(name = "DocCount", type = int.class, unsigned = true), + @StructureMember(name = "DocTotalSize", type = int.class, unsigned = true), + @StructureMember(name = "BTreeLeafNodes", type = int.class, unsigned = true), + @StructureMember(name = "BTreeDepth", type = short.class, unsigned = true), + @StructureMember(name = "Spare", type = short.class), + @StructureMember(name = "KeyOffset", type = int[].class, unsigned = true, length = NotesConstants.PERCENTILE_COUNT) + } + ) +public interface CollectionData extends MemoryStructure { + @StructureGetter("DocCount") + long getDocCount(); + + @StructureGetter("DocTotalSize") + long getDocTotalSize(); + + @StructureGetter("BTreeLeafNodes") + long getLeafNodeCount(); + + @StructureGetter("BTreeDepth") + int getDepth(); +} diff --git a/domino-jnx-api/src/main/java/com/hcl/domino/misc/NotesConstants.java b/domino-jnx-api/src/main/java/com/hcl/domino/misc/NotesConstants.java index 3a469c8b..199e30bb 100644 --- a/domino-jnx-api/src/main/java/com/hcl/domino/misc/NotesConstants.java +++ b/domino-jnx-api/src/main/java/com/hcl/domino/misc/NotesConstants.java @@ -18,13 +18,14 @@ import com.hcl.domino.constants.Bsafe; import com.hcl.domino.constants.EditOds; +import com.hcl.domino.constants.Nif; import com.hcl.domino.constants.OleOds; import com.hcl.domino.constants.QueryOds; import com.hcl.domino.constants.Stats; import com.hcl.domino.constants.StdNames; import com.hcl.domino.constants.VmOds; -public interface NotesConstants extends ViewFormatConstants, StdNames, QueryOds, EditOds, OleOds, VmOds, Bsafe, Stats { +public interface NotesConstants extends ViewFormatConstants, StdNames, QueryOds, EditOds, OleOds, VmOds, Bsafe, Stats, Nif { public enum AgentCheck { CheckRights(0), diff --git a/domino-jnx-jna/src/main/java/com/hcl/domino/jna/data/JNADominoCollection.java b/domino-jnx-jna/src/main/java/com/hcl/domino/jna/data/JNADominoCollection.java index 870546aa..dab488ff 100644 --- a/domino-jnx-jna/src/main/java/com/hcl/domino/jna/data/JNADominoCollection.java +++ b/domino-jnx-jna/src/main/java/com/hcl/domino/jna/data/JNADominoCollection.java @@ -17,6 +17,7 @@ package com.hcl.domino.jna.data; import java.lang.ref.ReferenceQueue; +import java.nio.ByteBuffer; import java.text.Collator; import java.text.MessageFormat; import java.util.ArrayList; @@ -46,6 +47,7 @@ import com.hcl.domino.commons.gc.APIObjectAllocations; import com.hcl.domino.commons.gc.IAPIObject; import com.hcl.domino.commons.gc.IGCDominoClient; +import com.hcl.domino.commons.structures.MemoryStructureUtil; import com.hcl.domino.commons.util.NotesErrorUtils; import com.hcl.domino.commons.util.PlatformUtils; import com.hcl.domino.commons.util.StringTokenizerExt; @@ -59,6 +61,7 @@ import com.hcl.domino.data.CollectionSearchQuery.CollectionEntryProcessor; import com.hcl.domino.data.Database; import com.hcl.domino.data.Database.Action; +import com.hcl.domino.data.structures.CollectionData; import com.hcl.domino.data.Document; import com.hcl.domino.data.DominoCollection; import com.hcl.domino.data.DominoDateTime; @@ -71,6 +74,7 @@ import com.hcl.domino.jna.JNADominoClient; import com.hcl.domino.jna.data.CollectionDataCache.CacheState; import com.hcl.domino.jna.data.JNACollectionEntry.CacheableViewEntryData; +import com.hcl.domino.jna.internal.Mem; import com.hcl.domino.jna.internal.callbacks.NotesCallbacks; import com.hcl.domino.jna.internal.callbacks.Win32NotesCallbacks; import com.hcl.domino.jna.internal.capi.NotesCAPI; @@ -1734,6 +1738,33 @@ private short getCollation() { return retCollationNum.getValue(); } + @Override + public CollectionData getCollectionData() { + checkDisposed(); + + final DHANDLE.ByReference rethCollData = DHANDLE.newInstanceByReference(); + + LockUtil.lockHandle(getAllocations().getCollectionHandle(), hCollectionByVal -> + NotesCAPI.get().NIFGetCollectionData(hCollectionByVal, rethCollData) + ); + + return LockUtil.lockHandle(rethCollData, hCollData -> { + CollectionData result = Mem.OSLockObject(hCollData, ptr -> { + int len = MemoryStructureUtil.sizeOf(CollectionData.class); + byte[] data = new byte[len]; + ptr.read(0, data, 0, len); + + ByteBuffer buf = ByteBuffer.wrap(data); + + return MemoryStructureUtil.forStructure(CollectionData.class, () -> buf); + }); + + Mem.OSMemFree(hCollData); + + return result; + }); + } + @Override public LinkedHashSet getAllIds(boolean withDocuments, boolean withCategories) { if (!withDocuments && !withCategories) { diff --git a/domino-jnx-jna/src/main/java/com/hcl/domino/jna/internal/capi/INotesCAPI.java b/domino-jnx-jna/src/main/java/com/hcl/domino/jna/internal/capi/INotesCAPI.java index 0011ebbd..57396ed5 100644 --- a/domino-jnx-jna/src/main/java/com/hcl/domino/jna/internal/capi/INotesCAPI.java +++ b/domino-jnx-jna/src/main/java/com/hcl/domino/jna/internal/capi/INotesCAPI.java @@ -687,6 +687,14 @@ short NIFOpenCollectionWithUserNameList (HANDLE.ByValue hViewDB, HANDLE.ByValue short NIFGetCollation(DHANDLE.ByValue hCollection, ShortByReference retCollationNum); short NIFSetCollation(DHANDLE.ByValue hCollection, short CollationNum); + /** + * Retrieve detailed information about the collection itself, such as the number of documents + * in the collection and the total size of the document entries in the collection. + * + * @since Notes/Domino 4.0 + * @since 1.44.0 + */ + short NIFGetCollectionData(DHANDLE.ByValue hCollection, DHANDLE.ByReference rethCollData); short NIFUpdateCollection(DHANDLE.ByValue hCollection); @UndocumentedAPI diff --git a/test/it-domino-jnx/src/test/java/it/com/hcl/domino/test/queries/TestViewQueries.java b/test/it-domino-jnx/src/test/java/it/com/hcl/domino/test/queries/TestViewQueries.java index c4f7f1b7..3c07ddb2 100644 --- a/test/it-domino-jnx/src/test/java/it/com/hcl/domino/test/queries/TestViewQueries.java +++ b/test/it-domino-jnx/src/test/java/it/com/hcl/domino/test/queries/TestViewQueries.java @@ -51,6 +51,7 @@ import com.hcl.domino.data.DominoCollection; import com.hcl.domino.data.DominoCollection.Direction; import com.hcl.domino.data.Navigate; +import com.hcl.domino.data.structures.CollectionData; import com.hcl.domino.dbdirectory.DirectorySearchQuery.SearchFlag; import com.hcl.domino.dql.DQL; import com.hcl.domino.dql.DQL.DQLTerm; From 9e1906409ed570a1c6b3ea46c439a6727dfa6b6f Mon Sep 17 00:00:00 2001 From: Jesse Gallagher Date: Wed, 30 Oct 2024 17:50:58 -0400 Subject: [PATCH 4/5] Add bindings for working with default status lines (Issue #444) --- .../com/hcl/domino/admin/ServerAdmin.java | 18 +++++++++++++ .../hcl/domino/jna/admin/JNAServerAdmin.java | 25 +++++++++++++++++++ .../domino/jna/internal/capi/INotesCAPI.java | 2 ++ .../jna/server/JNAServerStatusLine.java | 9 +++++++ 4 files changed, 54 insertions(+) diff --git a/domino-jnx-api/src/main/java/com/hcl/domino/admin/ServerAdmin.java b/domino-jnx-api/src/main/java/com/hcl/domino/admin/ServerAdmin.java index 166a8dbc..1a895df9 100644 --- a/domino-jnx-api/src/main/java/com/hcl/domino/admin/ServerAdmin.java +++ b/domino-jnx-api/src/main/java/com/hcl/domino/admin/ServerAdmin.java @@ -469,4 +469,22 @@ void registerCrossCertificate(String certFilePath, String certPW, String certLog */ String sendConsoleCommand(String server, String command); + + /** + * Retrieves the current addin's default status line. + * + * @return a {@link ServerStatusLine} for the current addin's default + * @since 1.44.0 + */ + ServerStatusLine getDefaultServerStatusLine(); + + /** + * Sets the provided status line as the default for the current addin. + * + * @param statusLine a {@link ServerStatusLine} to make the default, + * must be non-null + * @since 1.44.0 + */ + void setDefaultServerStatusLine(ServerStatusLine statusLine); + } diff --git a/domino-jnx-jna/src/main/java/com/hcl/domino/jna/admin/JNAServerAdmin.java b/domino-jnx-jna/src/main/java/com/hcl/domino/jna/admin/JNAServerAdmin.java index 639ceea2..a01ef135 100644 --- a/domino-jnx-jna/src/main/java/com/hcl/domino/jna/admin/JNAServerAdmin.java +++ b/domino-jnx-jna/src/main/java/com/hcl/domino/jna/admin/JNAServerAdmin.java @@ -23,6 +23,7 @@ import java.util.Collections; import java.util.EnumSet; import java.util.List; +import java.util.Objects; import java.util.concurrent.atomic.AtomicInteger; import com.hcl.domino.DominoClient; @@ -83,6 +84,7 @@ import com.sun.jna.Memory; import com.sun.jna.Pointer; import com.sun.jna.ptr.IntByReference; +import com.sun.jna.ptr.LongByReference; import com.sun.jna.ptr.PointerByReference; import com.sun.jna.ptr.ShortByReference; @@ -490,6 +492,29 @@ public ServerStatusLine createServerStatusLine(String taskName) { long hDesc = NotesCAPI.get().AddInCreateStatusLine(NotesStringUtils.toLMBCS(taskName, true)); return new JNAServerStatusLine(getParentDominoClient(), hDesc); } + + @Override + public ServerStatusLine getDefaultServerStatusLine() { + LongByReference rethModule = new LongByReference(); + LongByReference rethDesc = new LongByReference(); + NotesCAPI.get().AddInQueryDefaults(rethModule, rethDesc); + return new JNAServerStatusLine(getParentDominoClient(), rethDesc.getValue()); + } + + @Override + public void setDefaultServerStatusLine(ServerStatusLine statusLine) { + Objects.requireNonNull(statusLine, "statusLine cannot be null"); + if(!(statusLine instanceof JNAServerStatusLine)) { + throw new IllegalArgumentException(MessageFormat.format("Unable to handle ServerStatusLine of type {0}", statusLine.getClass().getName())); + } + JNAServerStatusLine jnaLine = (JNAServerStatusLine)statusLine; + + LongByReference rethModule = new LongByReference(); + LongByReference rethDesc = new LongByReference(); + NotesCAPI.get().AddInQueryDefaults(rethModule, rethDesc); + rethDesc.setValue(jnaLine.getAdapter(long.class)); + NotesCAPI.get().AddInSetDefaults(rethModule.getValue(), rethDesc.getValue()); + } @Override public void openServerConsole(String serverName, ConsoleHandler handler) { diff --git a/domino-jnx-jna/src/main/java/com/hcl/domino/jna/internal/capi/INotesCAPI.java b/domino-jnx-jna/src/main/java/com/hcl/domino/jna/internal/capi/INotesCAPI.java index 57396ed5..b2d6999d 100644 --- a/domino-jnx-jna/src/main/java/com/hcl/domino/jna/internal/capi/INotesCAPI.java +++ b/domino-jnx-jna/src/main/java/com/hcl/domino/jna/internal/capi/INotesCAPI.java @@ -2213,6 +2213,8 @@ default boolean AddInMinutesHaveElapsed(int Minutes) { boolean AddInShouldTerminate(); long AddInCreateStatusLine(Memory TaskName); void AddInDeleteStatusLine(long hDesc); + void AddInQueryDefaults(LongByReference rethModule, LongByReference rethDesc); + void AddInSetDefaults(long hNewModule, long hDesc); void AddInSetStatusLine(long hDesc, Memory string); void OSPreemptOccasionally(); diff --git a/domino-jnx-jna/src/main/java/com/hcl/domino/jna/server/JNAServerStatusLine.java b/domino-jnx-jna/src/main/java/com/hcl/domino/jna/server/JNAServerStatusLine.java index 1a433ee9..5e15568f 100644 --- a/domino-jnx-jna/src/main/java/com/hcl/domino/jna/server/JNAServerStatusLine.java +++ b/domino-jnx-jna/src/main/java/com/hcl/domino/jna/server/JNAServerStatusLine.java @@ -55,5 +55,14 @@ public void setLine(String line) { Memory string = NotesStringUtils.toLMBCS(line, true); NotesCAPI.get().AddInSetStatusLine(hDesc, string); } + + @SuppressWarnings("unchecked") + @Override + protected T getAdapterLocal(Class clazz) { + if(long.class.equals(clazz) || Long.class.equals(clazz)) { + return (T)Long.valueOf(getAllocations().getLineHandle()); + } + return super.getAdapterLocal(clazz); + } } From 194c70c3e26e53385d713af9c571ff99290ac4c6 Mon Sep 17 00:00:00 2001 From: Jesse Gallagher Date: Wed, 30 Oct 2024 17:56:04 -0400 Subject: [PATCH 5/5] Set version to 1.44.0 --- domino-jnx-api/pom.xml | 2 +- domino-jnx-commons/pom.xml | 2 +- domino-jnx-console/pom.xml | 2 +- domino-jnx-jna/pom.xml | 2 +- example/jnx-example-domino-servlet/pom.xml | 2 +- example/jnx-example-domino-webapp-admin/pom.xml | 2 +- example/jnx-example-gluon/pom.xml | 2 +- example/jnx-example-graalvm-native/pom.xml | 2 +- example/jnx-example-runjava/pom.xml | 2 +- example/jnx-example-swt/pom.xml | 2 +- example/jnx-example-webapp/pom.xml | 2 +- integration/domino-jnx-jakarta-security/pom.xml | 2 +- integration/domino-jnx-jsonb/pom.xml | 2 +- integration/domino-jnx-lsxbeshim/pom.xml | 2 +- integration/domino-jnx-rawdoc-json/pom.xml | 2 +- integration/domino-jnx-vertx-json/pom.xml | 2 +- integration/domino-jnx-xpages/pom.xml | 2 +- pom.xml | 2 +- test/it-domino-jnx/pom.xml | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/domino-jnx-api/pom.xml b/domino-jnx-api/pom.xml index 234773d3..1f52aebb 100644 --- a/domino-jnx-api/pom.xml +++ b/domino-jnx-api/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.44.0-SNAPSHOT + 1.44.0 domino-jnx-api HCL Domino API diff --git a/domino-jnx-commons/pom.xml b/domino-jnx-commons/pom.xml index 2cec8b21..5a2b937b 100644 --- a/domino-jnx-commons/pom.xml +++ b/domino-jnx-commons/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.44.0-SNAPSHOT + 1.44.0 domino-jnx-commons HCL Domino API Common Code diff --git a/domino-jnx-console/pom.xml b/domino-jnx-console/pom.xml index 173c6a9f..dfd79b8a 100644 --- a/domino-jnx-console/pom.xml +++ b/domino-jnx-console/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.44.0-SNAPSHOT + 1.44.0 domino-jnx-console HCL Domino API Server Controller Connector diff --git a/domino-jnx-jna/pom.xml b/domino-jnx-jna/pom.xml index 2456d48c..9829ad23 100644 --- a/domino-jnx-jna/pom.xml +++ b/domino-jnx-jna/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.44.0-SNAPSHOT + 1.44.0 domino-jnx-jna HCL Domino API, JNA Implementation diff --git a/example/jnx-example-domino-servlet/pom.xml b/example/jnx-example-domino-servlet/pom.xml index 45492a29..00dd9804 100644 --- a/example/jnx-example-domino-servlet/pom.xml +++ b/example/jnx-example-domino-servlet/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.44.0-SNAPSHOT + 1.44.0 ../.. jnx-example-domino-servlet diff --git a/example/jnx-example-domino-webapp-admin/pom.xml b/example/jnx-example-domino-webapp-admin/pom.xml index 4d17a825..7af723dc 100644 --- a/example/jnx-example-domino-webapp-admin/pom.xml +++ b/example/jnx-example-domino-webapp-admin/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.44.0-SNAPSHOT + 1.44.0 ../.. jnx-example-domino-webapp-admin diff --git a/example/jnx-example-gluon/pom.xml b/example/jnx-example-gluon/pom.xml index 30fc6273..296530ba 100644 --- a/example/jnx-example-gluon/pom.xml +++ b/example/jnx-example-gluon/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.44.0-SNAPSHOT + 1.44.0 ../.. jnx-example-gluon diff --git a/example/jnx-example-graalvm-native/pom.xml b/example/jnx-example-graalvm-native/pom.xml index b9c1829e..700aa289 100644 --- a/example/jnx-example-graalvm-native/pom.xml +++ b/example/jnx-example-graalvm-native/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.44.0-SNAPSHOT + 1.44.0 ../.. jnx-example-graalvm-native diff --git a/example/jnx-example-runjava/pom.xml b/example/jnx-example-runjava/pom.xml index f662990e..bb8e6361 100644 --- a/example/jnx-example-runjava/pom.xml +++ b/example/jnx-example-runjava/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.44.0-SNAPSHOT + 1.44.0 ../.. jnx-example-runjava diff --git a/example/jnx-example-swt/pom.xml b/example/jnx-example-swt/pom.xml index b3365fec..92ffc604 100644 --- a/example/jnx-example-swt/pom.xml +++ b/example/jnx-example-swt/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.44.0-SNAPSHOT + 1.44.0 ../.. jnx-example-swt diff --git a/example/jnx-example-webapp/pom.xml b/example/jnx-example-webapp/pom.xml index 43c39281..eef4679f 100644 --- a/example/jnx-example-webapp/pom.xml +++ b/example/jnx-example-webapp/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.44.0-SNAPSHOT + 1.44.0 ../.. jnx-example-webapp diff --git a/integration/domino-jnx-jakarta-security/pom.xml b/integration/domino-jnx-jakarta-security/pom.xml index 58f2f417..dc1d301f 100644 --- a/integration/domino-jnx-jakarta-security/pom.xml +++ b/integration/domino-jnx-jakarta-security/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.44.0-SNAPSHOT + 1.44.0 ../.. domino-jnx-jakarta-security diff --git a/integration/domino-jnx-jsonb/pom.xml b/integration/domino-jnx-jsonb/pom.xml index 24668597..04045039 100644 --- a/integration/domino-jnx-jsonb/pom.xml +++ b/integration/domino-jnx-jsonb/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.44.0-SNAPSHOT + 1.44.0 ../.. domino-jnx-jsonb diff --git a/integration/domino-jnx-lsxbeshim/pom.xml b/integration/domino-jnx-lsxbeshim/pom.xml index d0d554f1..b1873537 100644 --- a/integration/domino-jnx-lsxbeshim/pom.xml +++ b/integration/domino-jnx-lsxbeshim/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.44.0-SNAPSHOT + 1.44.0 ../.. domino-jnx-lsxbeshim diff --git a/integration/domino-jnx-rawdoc-json/pom.xml b/integration/domino-jnx-rawdoc-json/pom.xml index 53601f28..17e8fd1c 100644 --- a/integration/domino-jnx-rawdoc-json/pom.xml +++ b/integration/domino-jnx-rawdoc-json/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.44.0-SNAPSHOT + 1.44.0 ../.. domino-jnx-rawdoc-json diff --git a/integration/domino-jnx-vertx-json/pom.xml b/integration/domino-jnx-vertx-json/pom.xml index e5bb2886..419849be 100644 --- a/integration/domino-jnx-vertx-json/pom.xml +++ b/integration/domino-jnx-vertx-json/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.44.0-SNAPSHOT + 1.44.0 ../.. domino-jnx-vertx-json diff --git a/integration/domino-jnx-xpages/pom.xml b/integration/domino-jnx-xpages/pom.xml index 21a80569..bf005d05 100644 --- a/integration/domino-jnx-xpages/pom.xml +++ b/integration/domino-jnx-xpages/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.44.0-SNAPSHOT + 1.44.0 ../.. domino-jnx-xpages diff --git a/pom.xml b/pom.xml index 10cfb33d..7aee5f74 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ 4.0.0 com.hcl.domino domino-jnx - 1.44.0-SNAPSHOT + 1.44.0 pom HCL Domino API Parent Project Modern Java API for HCL Domino diff --git a/test/it-domino-jnx/pom.xml b/test/it-domino-jnx/pom.xml index 240ea03d..d797ea5b 100644 --- a/test/it-domino-jnx/pom.xml +++ b/test/it-domino-jnx/pom.xml @@ -7,7 +7,7 @@ com.hcl.domino domino-jnx - 1.44.0-SNAPSHOT + 1.44.0 ../.. it-domino-jnx