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
* <a href="https://www.ldap.com/ldap-oid-reference">https://www.ldap.com/ldap-
* oid-reference</a>
*/
-public enum LdapObjs implements SpecifiedName, QNamed {
+public enum LdapObjs implements SpecifiedName, Supplier<String> {
account("0.9.2342.19200300.100.4.5", "RFC 4524"),
/** */
document("0.9.2342.19200300.100.4.6", "RFC 4524"),
/** 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() {
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();
}
}