Hi All,
I am working on a Lotus Notes Integration project. Currently we are using a Java client application, which uses NCSO.jar. The main usage is to register new users.
The current requirement is to create new user on the defined mail server and create the roaming profile on the same server. If I use the LotusNotes admin server as the mail server and roaming server, ti creates the new user and roaming files. But If I use a different server to create the mail file, current code can’t create roaming files. Could you help me to create the roaming files to create in the same mail server please.
Currently there is one registration policy in the test environment.
Following is the current code,
private void connect() throws NotesException { if (session == null) { session = NotesFactory.createSession(config.getAdminServer() + “:” + config.getAdminServerPort(), config.getAdminUsername(), config.getAdminPassword()); } }
private void registerNewUser(DominoNewUserDetails newUser) throws NotesException, CertifierIdFileNotFoundException { connect(); String certifierIdFile = calculateCertifierIdFileName(newUser .getCertifierId()); String newUserIdFile = config.getNewUserCertificateDir() + newUser.getUserName() + CERTIFICATE_FILE_EXTENSION; String mailFile = config.getMailFileDir() + newUser.getUserName(); Registration reg = session.createRegistration(); // Setup the registration/administration server and the appropriate // cert.id reg.setRegistrationServer(config.getAdminServer()); reg.setCertifierIDFile(certifierIdFile); reg.setCreateMailDb(config.isCreateMailDb()); // Setup the mail quotas, warning and template reg.setMailQuotaSizeLimit(config.getMailQuotaSizeLimit()); reg.setMailQuotaWarningThreshold(config.getMailQuotaWarningThreshold()); reg.setMailTemplateName(config.getMailTemplate()); // Setup the users internet email address and short name reg.setMailInternetAddress(newUser.getUserName() + config.getOxfamMailDomain()); reg.setShortName(newUser.getUserName()); // Setup the expiry date to be 24 months from today DateTime dt = session.createDateTime(“Today”); dt.setNow(); dt.adjustYear(config.getAccountExpiryYears()); reg.setExpiration(dt); // Set the ID type, minimal password length and as International reg.setIDType(Registration.ID_HIERARCHICAL); reg.setMinPasswordLength(config.getMinPasswordLength()); // password // strength reg.setNorthAmerican(config.isNorthAmerica()); // Setup registration log file for logging information // and tell it to update the address book but not store // the ID file in the address book reg.setRegistrationLog(config.getRegistrationLog()); reg.setUpdateAddressBook(config.isUpdateAddressBook()); reg.setStoreIDInAddressBook(config.isStoreIdInAddressBook()); // Setup the policy details reg.setPolicyName(config.getPolicyName()); // Setup the roaming details reg.setRoamingUser(config.isRoamingUser()); reg.setRoamingServer(newUser.getMailServer()); reg.setRoamingSubdir(config.getRoamingSubdirPrefix() + newUser.getUserName()); // Setup the server list for replicas of this mail file // of Strings // reg.setMailReplicaServers(config.getReplicaServers()); // Setup the group list to add this user to // of Strings reg.setGroupList(newUser.getGroupList()); try { boolean regStatus = reg.registerNewUser(newUser.getLastName(), // last // name newUserIdFile, // id file to be created /* * the admin server has been specified as the mail server to * address the issue when creating the mail database on the mail server */ config.getAdminServer(), // mail server // newUser.getMailServer(), // mail server newUser.getFirstName(), // first name newUser.getMiddleInitial(), // middle initial config.getCertifierPassword(), // certifier password newUser.getLocation(), // location field newUser.getComment(), // comment field mailFile, // mail file config.getForwardingDomain(), // forwarding domain newUser.getPassword()); // new user password } catch (NotesException e) { if (e.text.equals(“Notes error: Could not open the ID file”) && (e.id == 4000)) { throw new CertifierIdFileNotFoundException( “The certifier id file " + certifierIdFile + " was not found on the Domino Server.”, e); } else { throw e; } } }