Users and per-user policy

Assuming that the Verify Identity Access domain is Default and that there is a suffix o=ibm,c=us in LDAP, the following code creates a Verify Identity Access user called testuser. This testuser has the LDAP DN cn=testuser,o=ibm,c=us. First, obtain an RgyAttributes instance to set the users attributes and then create the user. A few optional attributes set for the user during the time of creation include account and password policy and account state.
// Setup the required attributes
RgyAttributes rgyAttributes = registry.newRgyAttributes();
rgyAttributes.putAttribute(RgyAttributes.COMMON_NAME_NAME,“testuser”);
rgyAttributes.putAttribute(RgyAttributes.SURNAME_NAME, “user”);
// Setup some optional attributes
rgyAttributes.putAttribute(RgyAttributes.MIN_PASSWORD_LENGTH_NAME, "8");
rgyAttributes.putAttribute(RgyAttributes.MAX_LOGIN_FAILURES_NAME, "2");
rgyAttributes.putAttribute(RgyAttributes.DISABLE_TIME_INTERVAL_NAME, "0");
Date currentTime = new Date();
currentTime.setTime(currentTime.getTime() + (3600 * 1000L));
String registryDate = null;
try {
	registryDate = registry.toRegistryDate(currentTime);
}
catch (RgyException e) {
	e.printStackTrace();
	System.exit(1);
}
rgyAttributes.putAttribute(RgyAttributes.ACCOUNT_EXPIRY_DATE_NAME,
registryDate);
rgyAttributes.putAttribute(RgyAttributes.SEC_ACCT_VALID_NAME, 
RgyAttributes.BOOL_TRUE_VALUE);
// Create the user
String userId = "testuser”;
String userNativeId = "cn=testuser,o=ibm,c=us”;
RgyUser rgyUser = null;
try {
	user = registry.createUser(“Default”, userId, userNativeId, "passw0rd".
toCharArray(), true, rgyAttributes, null);
}
catch (RgyException e) {
	e.printStackTrace();
	System.out.println("FAILED: Unable to create user: "+id);
	System.exit(1);
}