diff --git a/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/connection/DefaultLdapConnection.java b/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/connection/DefaultLdapConnection.java
new file mode 100644
index 00000000..0c9a6cf0
--- /dev/null
+++ b/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/connection/DefaultLdapConnection.java
@@ -0,0 +1,276 @@
+package org.apache.archiva.redback.common.ldap.connection;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import com.sun.jndi.ldap.LdapCtxFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.InitialDirContext;
+import javax.naming.ldap.LdapName;
+import javax.naming.ldap.Rdn;
+import java.util.Collections;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Properties;
+
+/**
+ * The configuration for a connection will not change.
+ *
+ * @author trygvis
+ */
+public class DefaultLdapConnection
+{
+
+ private static LdapCtxFactory ctxFactory;// = new LdapCtxFactory();
+
+
+ static
+ {
+ initCtxFactory();
+ }
+
+
+ private Logger log = LoggerFactory.getLogger( getClass() );
+
+ private LdapConnectionConfiguration config;
+
+ private DirContext context;
+
+ private List baseDnRdns;
+
+ private static void initCtxFactory()
+ {
+ ctxFactory = new LdapCtxFactory();
+ }
+
+ public DefaultLdapConnection( LdapConnectionConfiguration config, Rdn subRdn )
+ throws LdapException
+ {
+ this.config = config;
+
+ LdapName baseDn = new LdapName( config.getBaseDn().getRdns() );
+
+ if ( subRdn != null )
+ {
+ baseDn.add( subRdn );
+ }
+
+ log.debug( "baseDn: {}", baseDn );
+
+ baseDnRdns = Collections.unmodifiableList( baseDn.getRdns() );
+
+ if ( context != null )
+ {
+ throw new LdapException( "Already connected." );
+ }
+
+ log.debug( "baseDnRdns: {}", baseDnRdns );
+
+ Hashtable