X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.util%2Fsrc%2Forg%2Fargeo%2Futil%2Fnaming%2FLdapObjs.java;h=995c68cc9de1c10f9640f440c7411b8ce17212cb;hb=3c1cdc594d954520b14646102b366290bdad58c7;hp=c616d1491de4358b40d6a6872cbe8c80654220c5;hpb=b71546ddc74d6ca49d252806aafd491c75dfe1fb;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.util/src/org/argeo/util/naming/LdapObjs.java b/org.argeo.util/src/org/argeo/util/naming/LdapObjs.java index c616d1491..995c68cc9 100644 --- a/org.argeo.util/src/org/argeo/util/naming/LdapObjs.java +++ b/org.argeo.util/src/org/argeo/util/naming/LdapObjs.java @@ -1,11 +1,17 @@ package org.argeo.util.naming; +import java.util.function.Supplier; + +import javax.xml.namespace.QName; + +import org.argeo.util.internal.DisplayQName; + /** * Standard LDAP object classes as per * https://www.ldap.com/ldap- * oid-reference */ -public enum LdapObjs implements SpecifiedName { +public enum LdapObjs implements SpecifiedName, Supplier { account("0.9.2342.19200300.100.4.5", "RFC 4524"), /** */ document("0.9.2342.19200300.100.4.6", "RFC 4524"), @@ -89,14 +95,33 @@ public enum LdapObjs implements SpecifiedName { /** */ inetOrgPerson("2.16.840.1.113730.3.2.2", "RFC 2798"), /** */ - referral("2.16.840.1.113730.3.2.6", "RFC 3296"); + referral("2.16.840.1.113730.3.2.6", "RFC 3296"), + + // RFC 2307bis (partial) + /** */ + posixAccount("1.3.6.1.1.1.2.0", "RFC 2307bis"), + /** */ + posixGroup("1.3.6.1.1.1.2.2", "RFC 2307bis"), + + // + ; + + /** MUST be equal to ContentRepository LDAP namespace. */ + final static String LDAP_NAMESPACE_URI = "http://www.argeo.org/ns/ldap"; + /** MUST be equal to ContentRepository LDAP prefix. */ + final static String LDAP_DEFAULT_PREFIX = "ldap"; - private final static String LDAP_ = "ldap:"; private final String oid, spec; + private final QName value; private LdapObjs(String oid, String spec) { this.oid = oid; this.spec = spec; + this.value = new DisplayQName(LDAP_NAMESPACE_URI, name(), LDAP_DEFAULT_PREFIX); + } + + public QName qName() { + return value; } public String getOid() { @@ -107,8 +132,14 @@ public enum LdapObjs implements SpecifiedName { return spec; } + @Deprecated public String property() { - return new StringBuilder(LDAP_).append(name()).toString(); + return get(); + } + + @Override + public String get() { + return LdapObjs.LDAP_DEFAULT_PREFIX + ":" + name(); } }