@Entry(dn = "ou=users,dc=example,dc=org")
public class User {
@Attribute(name = "cn")
private String username;
@Attribute(name = "userPassword")
private String password;
// Getters and setters
}
public class Main {
public static void main(String[] args) {
OxLdap oxLdap = new OxLdap();
oxLdap.setServer("ldap://localhost:389");
oxLdap.setBindUser("cn=admin,dc=example,dc=org");
oxLdap.setBindPassword("password");
oxLdap.connect();
// ...
oxLdap.disconnect();
}
}