| | |
| | | import static org.forgerock.opendj.rest2ldap.ReadOnUpdatePolicy.CONTROLS; |
| | | import static org.forgerock.opendj.rest2ldap.Utils.ensureNotNull; |
| | | import static org.forgerock.opendj.ldap.LDAPConnectionFactory.*; |
| | | import static org.forgerock.opendj.ldap.LDAPListener.*; |
| | | |
| | | import java.io.IOException; |
| | | import java.security.GeneralSecurityException; |
| | |
| | | import org.forgerock.opendj.ldap.schema.Schema; |
| | | import org.forgerock.util.Options; |
| | | |
| | | /** |
| | | * Provides core factory methods and builders for constructing LDAP resource |
| | | * collections. |
| | | */ |
| | | /** Provides core factory methods and builders for constructing LDAP resource collections. */ |
| | | public final class Rest2LDAP { |
| | | /** |
| | | * Indicates whether or not LDAP client connections should use SSL or |
| | | * StartTLS. |
| | | */ |
| | | /** Indicates whether or not LDAP client connections should use SSL or StartTLS. */ |
| | | private enum ConnectionSecurity { |
| | | NONE, SSL, STARTTLS |
| | | } |
| | |
| | | TRUSTALL, JVM, FILE |
| | | } |
| | | |
| | | /** |
| | | * A builder for incrementally constructing LDAP resource collections. |
| | | */ |
| | | /** A builder for incrementally constructing LDAP resource collections. */ |
| | | public static final class Builder { |
| | | private final List<Attribute> additionalLDAPAttributes = new LinkedList<>(); |
| | | private AuthorizationPolicy authzPolicy = AuthorizationPolicy.NONE; |
| | |
| | | } |
| | | |
| | | /** |
| | | * Sets the base DN beneath which LDAP entries (resources) are to be |
| | | * found. |
| | | * Sets the base DN beneath which LDAP entries (resources) are to be found. |
| | | * |
| | | * @param dn |
| | | * The base DN. |
| | |
| | | } |
| | | |
| | | /** |
| | | * Sets the base DN beneath which LDAP entries (resources) are to be |
| | | * found. |
| | | * Sets the base DN beneath which LDAP entries (resources) are to be found. |
| | | * |
| | | * @param dn |
| | | * The base DN. |
| | |
| | | final String rdnValue = entry.parseAttribute(dnAttribute).asString(); |
| | | final RDN rdn = new RDN(dnAttribute.getAttributeType(), rdnValue); |
| | | entry.setName(baseDN.child(rdn)); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | private RDN rdn(final String resourceId) { |
| | | return new RDN(attribute.getAttributeType(), resourceId); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | final JsonValue normalizedConfiguration = |
| | | normalizeConnectionFactory(configuration, name, 0); |
| | | return configureConnectionFactory(normalizedConfiguration, providerClassLoader); |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | private Rest2LDAP() { |
| | | // Prevent instantiation. |
| | | } |
| | | |
| | | } |