Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native Profile Handle Changes #229

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions src/main/java/com/ibm/as400/access/AS400ImplNative.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,29 @@ class AS400ImplNative
/* swapFromPH is the profile to swap to */
static native void swapBackNative(byte[] swapToPH, byte[] swapFromPH) throws NativeException;


/* New method to create a profile handle. This method is only available after IBM 7.5.
* The create profile handle should be used with SwapToProfileHandleNative to do the
* swap.
* This profile handle should be released when the AS400 object is closed */
static native void createProfileHandleNative(byte[] profileHandle, String userId, char[] password, char[] additionalAuthenticationFactor) throws NativeException;

/* Swap to the user associated with swapToPH. The swapFromPH is the handle for the original user, */
/* which is used with swapping back using swapBackAndReleaseNative */
static native void swapToProfileHandleNative(byte[] swapToPH, byte[] swapFromPH) throws NativeException;

/* Swap back to the original profile handle and free it */
static native void swapBackAndReleaseNative(byte[] swapFromPH) throws NativeException;


/* Create profile handle with additional authentication information.
* This method is only available after IBM 7.5.
* This profile handle should be released when the AS400 object is done with it. */
public static native void createProfileHandle2Native(byte[] profileHandle,
static native void createProfileHandle2Native(byte[] profileHandle,
String userId, char[] password, char[] additionalAuthenticationFactor,
String verificationId, String remoteIpAddress, int jRemotePort, String localIpAddress, int jLocalPort ) throws NativeException;



/* Swap to the user associated with swapToPH. The swapFromPH is the handle for the original user,
* which is used with swapping back using swapBackAndReleaseNative.
* This method is only available after IBM 7.5.
*/
static native void swapToProfileHandleNative(byte[] swapToPH, byte[] swapFromPH) throws NativeException;

/* Swap back to the original profile handle and free it.. This method is only available after IBM 7.5. */
static native void swapBackAndReleaseNative(byte[] swapFromPH) throws NativeException;


/* Release the originally allocated handle. This method is only available after IBM 7.5. */
static native void releaseProfileHandleNative(byte[] profileHandle) throws NativeException;



}
Loading