]> git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.api.acr/src/org/argeo/api/acr/ldap/LdapObjs.java
Massive package refactoring
[lgpl/argeo-commons.git] / org.argeo.api.acr / src / org / argeo / api / acr / ldap / LdapObjs.java
1 package org.argeo.api.acr.ldap;
2
3 import static org.argeo.api.acr.ArgeoNamespace.LDAP_DEFAULT_PREFIX;
4 import static org.argeo.api.acr.ArgeoNamespace.LDAP_NAMESPACE_URI;
5
6 import java.util.function.Supplier;
7
8 import javax.xml.namespace.QName;
9
10 import org.argeo.api.acr.ArgeoNamespace;
11 import org.argeo.api.acr.ContentName;
12 import org.argeo.api.acr.QNamed;
13 import org.argeo.api.acr.RuntimeNamespaceContext;
14
15 /**
16 * Standard LDAP object classes as per
17 * <a href="https://www.ldap.com/ldap-oid-reference">https://www.ldap.com/ldap-
18 * oid-reference</a>
19 */
20 public enum LdapObjs implements QNamed, SpecifiedName, Supplier<String> {
21 account("0.9.2342.19200300.100.4.5", "RFC 4524"),
22 /** */
23 document("0.9.2342.19200300.100.4.6", "RFC 4524"),
24 /** */
25 room("0.9.2342.19200300.100.4.7", "RFC 4524"),
26 /** */
27 documentSeries("0.9.2342.19200300.100.4.9", "RFC 4524"),
28 /** */
29 domain("0.9.2342.19200300.100.4.13", "RFC 4524"),
30 /** */
31 rFC822localPart("0.9.2342.19200300.100.4.14", "RFC 4524"),
32 /** */
33 domainRelatedObject("0.9.2342.19200300.100.4.17", "RFC 4524"),
34 /** */
35 friendlyCountry("0.9.2342.19200300.100.4.18", "RFC 4524"),
36 /** */
37 simpleSecurityObject("0.9.2342.19200300.100.4.19", "RFC 4524"),
38 /** */
39 uidObject("1.3.6.1.1.3.1", "RFC 4519"),
40 /** */
41 extensibleObject("1.3.6.1.4.1.1466.101.120.111", "RFC 4512"),
42 /** */
43 dcObject("1.3.6.1.4.1.1466.344", "RFC 4519"),
44 /** */
45 authPasswordObject("1.3.6.1.4.1.4203.1.4.7", "RFC 3112"),
46 /** */
47 namedObject("1.3.6.1.4.1.5322.13.1.1", "draft-howard-namedobject"),
48 /** */
49 inheritableLDAPSubEntry("1.3.6.1.4.1.7628.5.6.1.1", "draft-ietf-ldup-subentry"),
50 /** */
51 top("2.5.6.0", "RFC 4512"),
52 /** */
53 alias("2.5.6.1", "RFC 4512"),
54 /** */
55 country("2.5.6.2", "RFC 4519"),
56 /** */
57 locality("2.5.6.3", "RFC 4519"),
58 /** */
59 organization("2.5.6.4", "RFC 4519"),
60 /** */
61 organizationalUnit("2.5.6.5", "RFC 4519"),
62 /** */
63 person("2.5.6.6", "RFC 4519"),
64 /** */
65 organizationalPerson("2.5.6.7", "RFC 4519"),
66 /** */
67 organizationalRole("2.5.6.8", "RFC 4519"),
68 /** */
69 groupOfNames("2.5.6.9", "RFC 4519"),
70 /** */
71 residentialPerson("2.5.6.10", "RFC 4519"),
72 /** */
73 applicationProcess("2.5.6.11", "RFC 4519"),
74 /** */
75 device("2.5.6.14", "RFC 4519"),
76 /** */
77 strongAuthenticationUser("2.5.6.15", "RFC 4523"),
78 /** */
79 certificationAuthority("2.5.6.16", "RFC 4523"),
80 // /** Should be certificationAuthority-V2 */
81 // certificationAuthority_V2("2.5.6.16.2", "RFC 4523") {
82 // },
83 /** */
84 groupOfUniqueNames("2.5.6.17", "RFC 4519"),
85 /** */
86 userSecurityInformation("2.5.6.18", "RFC 4523"),
87 /** */
88 cRLDistributionPoint("2.5.6.19", "RFC 4523"),
89 /** */
90 pkiUser("2.5.6.21", "RFC 4523"),
91 /** */
92 pkiCA("2.5.6.22", "RFC 4523"),
93 /** */
94 deltaCRL("2.5.6.23", "RFC 4523"),
95 /** */
96 subschema("2.5.20.1", "RFC 4512"),
97 /** */
98 ldapSubEntry("2.16.840.1.113719.2.142.6.1.1", "draft-ietf-ldup-subentry"),
99 /** */
100 changeLogEntry("2.16.840.1.113730.3.2.1", "draft-good-ldap-changelog"),
101 /** */
102 inetOrgPerson("2.16.840.1.113730.3.2.2", "RFC 2798"),
103 /** */
104 referral("2.16.840.1.113730.3.2.6", "RFC 3296"),
105
106 // RFC 2307bis (partial)
107 /** */
108 posixAccount("1.3.6.1.1.1.2.0", "RFC 2307bis"),
109 /** */
110 posixGroup("1.3.6.1.1.1.2.2", "RFC 2307bis"),
111
112 //
113 ;
114
115 private final String oid, spec;
116 private final QName value;
117
118 private LdapObjs(String oid, String spec) {
119 this.oid = oid;
120 this.spec = spec;
121 this.value = new ContentName(ArgeoNamespace.LDAP_NAMESPACE_URI, name());
122 }
123
124 public QName qName() {
125 return value;
126 }
127
128 public String getOid() {
129 return oid;
130 }
131
132 public String getSpec() {
133 return spec;
134 }
135
136 @Deprecated
137 public String property() {
138 return get();
139 }
140
141 @Override
142 public String get() {
143 return RuntimeNamespaceContext.getNamespaceContext().getPrefix(LDAP_NAMESPACE_URI) + ":" + name();
144 }
145
146 @Override
147 public String getNamespace() {
148 return LDAP_NAMESPACE_URI;
149 }
150
151 @Override
152 public String getDefaultPrefix() {
153 return LDAP_DEFAULT_PREFIX;
154 }
155
156 }