X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.util%2Fsrc%2Forg%2Fargeo%2Futil%2Fnaming%2FLdapObjs.java;h=0e05e2e76cb400036f683efa2fecadfd056c04a7;hb=b8f50d6d8e7b9c9215d156ba33f9dedfcee913a7;hp=6dcb3e9eb4a829d6fcfcae8ebea953153217f8ab;hpb=b897c27d370ad4772b5ae4b2c22cc505ef5d1a3f;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 6dcb3e9eb..0e05e2e76 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, QNamed { +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"), @@ -96,12 +102,17 @@ public enum LdapObjs implements SpecifiedName, QNamed { /** MUST be equal to ContentRepository LDAP prefix. */ final static String LDAP_DEFAULT_PREFIX = "ldap"; - private final static String LDAP_ = LDAP_DEFAULT_PREFIX + ":"; 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() { @@ -112,18 +123,14 @@ public enum LdapObjs implements SpecifiedName, QNamed { return spec; } + @Deprecated public String property() { - return new StringBuilder(LDAP_).append(name()).toString(); - } - - @Override - public String getDefaultPrefix() { - return LdapObjs.LDAP_DEFAULT_PREFIX; + return get(); } @Override - public String getNamespace() { - return LdapObjs.LDAP_NAMESPACE_URI; + public String get() { + return LdapObjs.LDAP_DEFAULT_PREFIX + ":" + name(); } }