Merge tag 'v2.3.28' into testing
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / directory / ldap / DefaultLdapEntry.java
index 94e0ac46def207abecdfeb66743cbc77e45002c2..f919fa6c843050d7a8564d133e91c3e91173c7db 100644 (file)
@@ -22,6 +22,7 @@ import javax.naming.directory.Attributes;
 import javax.naming.directory.BasicAttribute;
 import javax.naming.ldap.LdapName;
 
+import org.argeo.api.acr.QNamed;
 import org.argeo.api.acr.ldap.LdapAttr;
 import org.argeo.api.acr.ldap.LdapObj;
 import org.argeo.api.cms.directory.DirectoryDigestUtils;
@@ -125,9 +126,9 @@ public class DefaultLdapEntry implements LdapEntry {
                // modifiedAttributes = (Attributes) publishedAttributes.clone();
        }
 
-       public synchronized void publishAttributes(Attributes modifiedAttributes) {
-//             publishedAttributes = modifiedAttributes;
-       }
+//     public synchronized void publishAttributes(Attributes modifiedAttributes) {
+////           publishedAttributes = modifiedAttributes;
+//     }
 
        /*
         * PROPERTIES
@@ -145,6 +146,17 @@ public class DefaultLdapEntry implements LdapEntry {
                return credentials;
        }
 
+       protected String getPropertyAsString(QNamed key) {
+               return getPropertyAsString(key.localName());
+       }
+
+       protected String getPropertyAsString(String key) {
+               Object res = getProperties().get(key);
+               if (res == null)
+                       return null;
+               return res.toString();
+       }
+
        /*
         * CREDENTIALS
         */