API resetUserPassword return value in Java/LS/C API

Can someone please shine a little bit of light on the resetUserPassword method in Java?

The 8.5 documentation states the following:

public void resetUserPassword(String servername, String username, String password[, Int downloadcount])

throws NotesException

However, when writing Java code for our password reset system, I realized that designer offered a different version of this method:

  1. Java

The Java code completion offered two different versions that both return a boolean value. Here is what Designer offers in Java code completion:

resetUserPassword(String arg0, String arg1, String arg2) : boolean - Session

and

resetUserPassword(String arg0, String arg1, String arg2, int arg3) : boolean - Session

  1. LotusScript

In LotusScript there was no return value at all specified:

Resetuserpassword(Server As String, Username As String, Password As String, Authorizeddownloads as Integer) - Session

  1. C API:

The C API shows that there is a return value of type STATUS

#include <idvault.h>

STATUS LNPUBLICFUNC SECidvResetUserPassword(

char *pServer,

char *pUserName,

char *pPassword,

WORD  wDownloadCount,

DWORD  ReservedFlags,

void *pReserved);

My question here is:

What should the Java method return?

If it returns true, does that mean that there was an error when trying to reset the password?

If it returns false, there was no error?

For me it looks like I always get ‘false’ back if I call the method in Java.

I’d like to make sure that I can catch a possible failure here.

Does anybody out there have an idea how to do this correctly?

Does the documentation need an update/correction/clarification?

Thanks,

Uwe

Subject: Re: Try Catch is the answer to the error handling for resetUserPassword in Java

To answer my own question:In Java you need to enclose everything in try-catch:

try {

session.resetUserPassword(

serverName,

theNotesNameOfTheUser, 

passwordInClearText);

} catch(NotesException e) {

// here you catch the exceptions of

// of type

// Error: you have used the password before

} catch (Exception e) {

// this is the standard for exceptions

}

Well - you just need to know Java a lot better to get the job done :wink: