Skip to content

Commit

Permalink
Merge branch 'release/1.41.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jesse-gallagher committed Apr 16, 2024
2 parents fe3d4a9 + 042b7df commit 0837add
Show file tree
Hide file tree
Showing 37 changed files with 842 additions and 676 deletions.
2 changes: 1 addition & 1 deletion domino-jnx-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.hcl.domino</groupId>
<artifactId>domino-jnx</artifactId>
<version>1.40.0</version>
<version>1.41.0</version>
</parent>
<artifactId>domino-jnx-api</artifactId>
<name>HCL Domino API</name>
Expand Down
48 changes: 48 additions & 0 deletions domino-jnx-api/src/main/java/com/hcl/domino/DominoProcess.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,25 @@ static DominoProcess get() {
* @throws DominoInitException if initialization fails
*/
void initializeProcess(String[] initArgs) throws DominoInitException;

/**
* Initializes the Domino runtime for the process.
* <p>
* In implementations that require it, this method should be called once per
* process,
* before any other API operations.
* </p>
*
* @param initArgs the arguments to pass to the initialization call
* @param nativeProcessInit whether to call the native NotesInitExtended
* and NotesTerm functions if available
* @param nativeThreadInit whether to call the native NotesInitThread
* and NotesTermThread functions for the pacemaker thread if
* available
* @throws DominoInitException if initialization fails
* @since 1.41.0
*/
void initializeProcess(String[] initArgs, boolean nativeProcessInit, boolean nativeThreadInit) throws DominoInitException;

/**
* Initializes the current thread for Domino API use.
Expand All @@ -77,6 +96,23 @@ static DominoProcess get() {
* {@link #terminateThread()}
*/
DominoThreadContext initializeThread();

/**
* Initializes the current thread for Domino API use.
* <p>
* Note: it is preferable to use threads spawned by
* {@link DominoClient#getThreadFactory()}.
* </p>
*
* @param nativeInit whether to call the native NotesInitThread
* function if available
* @param nativeTerm whether to call the native NotesTermThread
* function if available
* @return AutoCloseable to terminate thread, same as calling
* {@link #terminateThread()}
* @since 1.41.0
*/
DominoThreadContext initializeThread(boolean nativeInit, boolean nativeTerm);

/**
* This function switches to the specified ID file and returns the user name
Expand Down Expand Up @@ -115,4 +151,16 @@ static DominoProcess get() {
* </p>
*/
void terminateThread();

/**
* Terminates the current thread for Domino API use.
* <p>
* Note: it is preferable to use threads spawned by
* {@link DominoClient#getThreadFactory()}.
* </p>
*
* @param nativeTerm whether to call the native NotesTerm function if available
* @since 1.41.0
*/
void terminateThread(boolean nativeTerm);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* ==========================================================================
* Copyright (C) 2019-2022 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 <http://www.apache.org/licenses/LICENSE-2.0>.
*
* 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.exception;

import com.hcl.domino.DominoException;

/**
* Represents error code 0x178a, "The subject's public key found in the cross certificate
* does not match the one found in the certificate table."
*
* @author Jesse Gallagher
* @since 1.41.0
*/
public class MismatchedPublicKeyException extends DominoException {
private static final long serialVersionUID = 1L;

public MismatchedPublicKeyException(final int id, final String message) {
super(id, message);
}

public MismatchedPublicKeyException(final int id, final String message, final Throwable cause) {
super(id, message, cause);
}

public MismatchedPublicKeyException(final String msg) {
super(msg);
}

public MismatchedPublicKeyException(final String msg, final Throwable cause) {
super(msg, cause);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ public interface JsonSerializer {
* @since 1.20.0
*/
String PROP_META_EDITABLE = "editable"; //$NON-NLS-1$
/**
* @since 1.41.0
*/
String PROP_META_SIGNER = "signer"; //$NON-NLS-1$

String PROP_RANGE_FROM = "from"; //$NON-NLS-1$
String PROP_RANGE_TO = "to"; //$NON-NLS-1$
Expand Down
2 changes: 1 addition & 1 deletion domino-jnx-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.hcl.domino</groupId>
<artifactId>domino-jnx</artifactId>
<version>1.40.0</version>
<version>1.41.0</version>
</parent>
<artifactId>domino-jnx-commons</artifactId>
<name>HCL Domino API Common Code</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@ public static boolean isDisableGCDispose() {
public static boolean isNoInit() {
return DominoUtils.checkBooleanProperty("jnx.noinit", "JNX_NOINIT"); //$NON-NLS-1$ //$NON-NLS-2$
}

/**
* Sets whether calls to {@code NotesInitExtended} should be skipped even
* when otherwise valid.
*
* @param noInit {@code true} if {@code NotesInitExtended} calls should be skipped,
* {@code false} otherwise
* @since 1.41.0
*/
public static void setNoInit(boolean noInit) {
setJavaProperty("jnx.noinit", Boolean.toString(noInit));
}

/**
* Determines whether calls to {@code NotesInitThread} and
Expand All @@ -117,6 +129,19 @@ public static boolean isNoInit() {
public static boolean isNoInitTermThread() {
return DominoUtils.checkBooleanProperty("jnx.noinittermthread", "JNX_NOINITTERMTHREAD"); //$NON-NLS-1$ //$NON-NLS-2$
}

/**
* Sets whether calls to {@code NotesInitThread} and
* {@code NotesTermThread} should be skipped even when
* otherwise valid.
*
* @param noInitTermThread {@code true} if {@code NotesInitThread}
* calls should be skipped, {@code false} otherwise
* @since 1.41.0
*/
public static void setNoInitTermThread(boolean noInitTermThread) {
setJavaProperty("jnx.noinittermthread", Boolean.toString(noInitTermThread));
}

/**
* Determines whether calls to {@code NotesTerm} should be skipped even when
Expand All @@ -129,6 +154,18 @@ public static boolean isNoInitTermThread() {
public static boolean isNoTerm() {
return DominoUtils.checkBooleanProperty("jnx.noterm", "JNX_NOTERM"); //$NON-NLS-1$ //$NON-NLS-2$
}

/**
* Sets whether calls to {@code NotesTerm} should be skipped even when
* otherwise valid.
*
* @param noTerm {@code true} if {@code NotesTerm} calls should be skipped,
* {@code false} otherwise
* @since 1.41.0
*/
public static void setNoTerm(boolean noTerm) {
setJavaProperty("jnx.noterm", Boolean.toString(noTerm));
}

/**
* Determines whether the provided file path is a legal replica ID, i.e.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
import com.hcl.domino.exception.ItemNotFoundException;
import com.hcl.domino.exception.ItemNotPresentException;
import com.hcl.domino.exception.MimePartNotFoundException;
import com.hcl.domino.exception.MismatchedPublicKeyException;
import com.hcl.domino.exception.NoCrossCertificateException;
import com.hcl.domino.exception.NoEncryptionKeysException;
import com.hcl.domino.exception.MissingEncryptionKeyException;
Expand Down Expand Up @@ -333,6 +334,8 @@ public static Optional<DominoException> toNotesError(final short result, final S
return Optional.of(new NoEncryptionKeysException(s, message));
case IBsafeErr.ERR_BSAFE_ID_TRUNC:
return Optional.of(new CorruptIDFileException(s, message));
case IBsafeErr.ERR_BSAFE_WRONG_SUBJECT_KEY_X:
return Optional.of(new MismatchedPublicKeyException(s, message));
default:
return Optional.of(new DominoException(s, message));
}
Expand Down
2 changes: 1 addition & 1 deletion domino-jnx-console/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.hcl.domino</groupId>
<artifactId>domino-jnx</artifactId>
<version>1.40.0</version>
<version>1.41.0</version>
</parent>
<artifactId>domino-jnx-console</artifactId>
<name>HCL Domino API Server Controller Connector</name>
Expand Down
2 changes: 1 addition & 1 deletion domino-jnx-jna/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.hcl.domino</groupId>
<artifactId>domino-jnx</artifactId>
<version>1.40.0</version>
<version>1.41.0</version>
</parent>
<artifactId>domino-jnx-jna</artifactId>
<name>HCL Domino API, JNA Implementation</name>
Expand Down
Loading

0 comments on commit 0837add

Please sign in to comment.