+ public final static String getUsername(User user) {
+ String cn = getProperty(user, UserAdminConstants.KEY_CN);
+ if (isEmpty(cn))
+ cn = getProperty(user, UserAdminConstants.KEY_UID);
+ return cn;
+ }
+
+ public final static String getProperty(Role role, String key) {
+ Object obj = role.getProperties().get(key);
+ if (obj != null)
+ return (String) obj;
+ else
+ return "";
+ }
+
+ public final static String getDefaultCn(String firstName, String lastName) {
+ return (firstName.trim() + " " + lastName.trim() + " ").trim();
+ }
+