Этот агент регистрирует одного примера пользователя.
Для получения дополнительной информации: ( пример ссылки )
import lotus.domino.*;
import java.util.Vector;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
// (Your code goes here)
Registration reg = session.createRegistration();
reg.setRegistrationServer("localhost"); //provide here your server name
reg.setCreateMailDb(true);
reg.setCertifierIDFile("c:\\NotesAdministrator\\cert.id");
DateTime dt = session.createDateTime("Today");
dt.setNow();
dt.adjustYear(1);
reg.setExpiration(dt);
reg.setIDType(Registration.ID_HIERARCHICAL);
reg.setNorthAmerican(false);
reg.setMinPasswordLength(5); // password strength
Vector orgs = new Vector();
orgs.addElement("Japanese OU");
orgs.addElement("PRC OU");
orgs.addElement("Korean OU");
reg.setAltOrgUnit(orgs);
Vector langs = new Vector();
langs.addElement("ja");
langs.addElement("zh-CN");
langs.addElement("ko");
reg.setAltOrgUnitLang(langs);
reg.setUpdateAddressBook(true);
reg.setStoreIDInAddressBook(true);
if (reg.registerNewUser("Taylor", // last name
"c:\\NotesAdministrator\\mtaylor.id", // file to be created
"CN=AceOne/O=AceHardware", // mail server
"Mike", // first name
"", // middle initial
"AceHardware", // certifier password
"", // location field
"", // comment field
"mail\\mtaylor.nsf", // mail file
"", // forwarding domain
"AceHardware", //user password
"Japanese name for Mike", //alternate name
"ja")) // alternate language
{
System.out.println("Registration succeeded");
}
else {
System.out.println("Registration failed");
}
} catch(NotesException e) {
System.out.println(e.id + " " + e.text);
e.printStackTrace();
}
}
}