directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r929927 - /directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Date Thu, 01 Apr 2010 11:14:19 GMT
Author: kayyagari
Date: Thu Apr  1 11:14:19 2010
New Revision: 929927

URL: http://svn.apache.org/viewvc?rev=929927&view=rev
Log:
o added a method to load schema from a single file
o replaced no-javadoc with @{inheritDoc}

Modified:
    directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java

Modified: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=929927&r1=929926&r2=929927&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
(original)
+++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Thu Apr  1 11:14:19 2010
@@ -20,6 +20,7 @@
 package org.apache.directory.ldap.client.api;
 
 
+import java.io.File;
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.net.SocketAddress;
@@ -127,9 +128,14 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.RDN;
+import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.ObjectClass;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.loader.ldif.JarLdifSchemaLoader;
 import org.apache.directory.shared.ldap.schema.manager.impl.DefaultSchemaManager;
+import org.apache.directory.shared.ldap.schema.parsers.OpenLdapSchemaParser;
+import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.shared.ldap.schema.registries.ObjectClassRegistry;
 import org.apache.directory.shared.ldap.util.LdapURL;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.mina.core.filterchain.IoFilter;
@@ -221,8 +227,8 @@ public class LdapNetworkConnection exten
 
 
     //--------------------------- Helper methods ---------------------------//
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#isConnected()
+    /**
+     * {@inheritDoc}
      */
     public boolean isConnected()
     {
@@ -230,8 +236,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#isAuthenticated()
+    /**
+     * {@inheritDoc}
      */
     public boolean isAuthenticated()
     {
@@ -587,8 +593,8 @@ public class LdapNetworkConnection exten
 
 
     //-------------------------- The methods ---------------------------//
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#connect()
+    /**
+     * {@inheritDoc}
      */
     public boolean connect() throws LdapException, IOException
     {
@@ -679,8 +685,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#close()
+    /**
+     * {@inheritDoc}
      */
     public boolean close() throws IOException
     {
@@ -709,8 +715,8 @@ public class LdapNetworkConnection exten
     //------------------------ The LDAP operations ------------------------//
     // Add operations                                                      //
     //---------------------------------------------------------------------//
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#add(org.apache.directory.shared.ldap.entry.Entry)
+    /**
+     * {@inheritDoc}
      */
     public AddResponse add( Entry entry ) throws LdapException
     {
@@ -725,8 +731,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#addAsync(org.apache.directory.shared.ldap.entry.Entry)
+    /**
+     * {@inheritDoc}
      */
     public AddFuture addAsync( Entry entry ) throws LdapException
     {
@@ -741,8 +747,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#add(org.apache.directory.ldap.client.api.message.AddRequest)
+    /**
+     * {@inheritDoc}
      */
     public AddResponse add( AddRequest addRequest ) throws LdapException
     {
@@ -807,8 +813,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#addAsync(org.apache.directory.ldap.client.api.message.AddRequest)
+    /**
+     * {@inheritDoc}
      */
     public AddFuture addAsync( AddRequest addRequest ) throws LdapException
     {
@@ -861,8 +867,8 @@ public class LdapNetworkConnection exten
 
     //------------------------ The LDAP operations ------------------------//
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#abandon(int)
+    /**
+     * {@inheritDoc}
      */
     public void abandon( int messageId )
     {
@@ -873,8 +879,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#abandon(org.apache.directory.ldap.client.api.message.AbandonRequest)
+    /**
+     * {@inheritDoc}
      */
     public void abandon( AbandonRequest abandonRequest )
     {
@@ -931,8 +937,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#bind()
+    /**
+     * {@inheritDoc}
      */
     public BindResponse bind() throws LdapException, IOException
     {
@@ -947,8 +953,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#bindAsync()
+    /**
+     * {@inheritDoc}
      */
     public BindFuture bindAsync() throws LdapException, IOException
     {
@@ -963,8 +969,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#bind(java.lang.String, java.lang.String)
+    /**
+     * {@inheritDoc}
      */
     public BindResponse bind( String name, String credentials ) throws LdapException, IOException
     {
@@ -979,8 +985,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#bindAsync(java.lang.String,
java.lang.String)
+    /**
+     * {@inheritDoc}
      */
     public BindFuture bindAsync( String name, String credentials ) throws LdapException,
IOException
     {
@@ -995,8 +1001,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#bind(org.apache.directory.shared.ldap.name.DN,
java.lang.String)
+    /**
+     * {@inheritDoc}
      */
     public BindResponse bind( DN name, String credentials ) throws LdapException, IOException
     {
@@ -1019,8 +1025,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#bindAsync(org.apache.directory.shared.ldap.name.DN,
java.lang.String)
+    /**
+     * {@inheritDoc}
      */
     public BindFuture bindAsync( DN name, String credentials ) throws LdapException, IOException
     {
@@ -1043,8 +1049,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#bind(org.apache.directory.ldap.client.api.message.BindRequest)
+    /**
+     * {@inheritDoc}
      */
     public BindResponse bind( BindRequest bindRequest ) throws LdapException, IOException
     {
@@ -1257,8 +1263,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#bindAsync(org.apache.directory.ldap.client.api.message.BindRequest)
+    /**
+     * {@inheritDoc}
      */
     public BindFuture bindAsync( BindRequest bindRequest ) throws LdapException, IOException
     {
@@ -1301,8 +1307,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#search(java.lang.String,
java.lang.String, org.apache.directory.shared.ldap.filter.SearchScope, java.lang.String)
+    /**
+     * {@inheritDoc}
      */
     public Cursor<SearchResponse> search( String baseDn, String filter, SearchScope
scope, String... attributes )
         throws LdapException
@@ -1321,8 +1327,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#searchAsync(java.lang.String,
java.lang.String, org.apache.directory.shared.ldap.filter.SearchScope, java.lang.String)
+    /**
+     * {@inheritDoc}
      */
     public SearchFuture searchAsync( String baseDn, String filter, SearchScope scope, String...
attributes )
         throws LdapException
@@ -1341,8 +1347,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#searchAsync(org.apache.directory.ldap.client.api.message.SearchRequest)
+    /**
+     * {@inheritDoc}
      */
     public SearchFuture searchAsync( SearchRequest searchRequest ) throws LdapException
     {
@@ -1376,8 +1382,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#search(org.apache.directory.ldap.client.api.message.SearchRequest)
+    /**
+     * {@inheritDoc}
      */
     public Cursor<SearchResponse> search( SearchRequest searchRequest ) throws LdapException
     {
@@ -1392,8 +1398,8 @@ public class LdapNetworkConnection exten
     //------------------------ The LDAP operations ------------------------//
     // Unbind operations                                                   //
     //---------------------------------------------------------------------//
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#unBind()
+    /**
+     * {@inheritDoc}
      */
     public void unBind() throws Exception
     {
@@ -1453,8 +1459,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#setTimeOut(long)
+    /**
+     * {@inheritDoc}
      */
     public void setTimeOut( long timeOut )
     {
@@ -1861,8 +1867,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#modify(org.apache.directory.shared.ldap.entry.Entry,
org.apache.directory.shared.ldap.entry.ModificationOperation)
+    /**
+     * {@inheritDoc}
      */
     public ModifyResponse modify( Entry entry, ModificationOperation modOp ) throws LdapException
     {
@@ -1884,8 +1890,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#modify(org.apache.directory.ldap.client.api.message.ModifyRequest)
+    /**
+     * {@inheritDoc}
      */
     public ModifyResponse modify( ModifyRequest modRequest ) throws LdapException
     {
@@ -1950,8 +1956,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#modifyAsync(org.apache.directory.ldap.client.api.message.ModifyRequest)
+    /**
+     * {@inheritDoc}
      */
     public ModifyFuture modifyAsync( ModifyRequest modRequest ) throws LdapException
     {
@@ -2002,8 +2008,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#rename(java.lang.String,
java.lang.String)
+    /**
+     * {@inheritDoc}
      */
     public ModifyDnResponse rename( String entryDn, String newRdn ) throws LdapException
     {
@@ -2011,8 +2017,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#rename(org.apache.directory.shared.ldap.name.DN,
org.apache.directory.shared.ldap.name.RDN)
+    /**
+     * {@inheritDoc}
      */
     public ModifyDnResponse rename( DN entryDn, RDN newRdn ) throws LdapException
     {
@@ -2020,8 +2026,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#rename(java.lang.String,
java.lang.String, boolean)
+    /**
+     * {@inheritDoc}
      */
     public ModifyDnResponse rename( String entryDn, String newRdn, boolean deleteOldRdn )
throws LdapException
     {
@@ -2037,8 +2043,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#rename(org.apache.directory.shared.ldap.name.DN,
org.apache.directory.shared.ldap.name.RDN, boolean)
+    /**
+     * {@inheritDoc}
      */
     public ModifyDnResponse rename( DN entryDn, RDN newRdn, boolean deleteOldRdn ) throws
LdapException
     {
@@ -2051,8 +2057,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#move(java.lang.String, java.lang.String)
+    /**
+     * {@inheritDoc}
      */
     public ModifyDnResponse move( String entryDn, String newSuperiorDn ) throws LdapException
     {
@@ -2068,8 +2074,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#move(org.apache.directory.shared.ldap.name.DN,
org.apache.directory.shared.ldap.name.DN)
+    /**
+     * {@inheritDoc}
      */
     public ModifyDnResponse move( DN entryDn, DN newSuperiorDn ) throws LdapException
     {
@@ -2084,8 +2090,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#modifyDn(org.apache.directory.ldap.client.api.message.ModifyDnRequest)
+    /**
+     * {@inheritDoc}
      */
     public ModifyDnResponse modifyDn( ModifyDnRequest modDnRequest ) throws LdapException
     {
@@ -2150,8 +2156,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#modifyDnAsync(org.apache.directory.ldap.client.api.message.ModifyDnRequest)
+    /**
+     * {@inheritDoc}
      */
     public ModifyDnFuture modifyDnAsync( ModifyDnRequest modDnRequest ) throws LdapException
     {
@@ -2204,8 +2210,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#delete(java.lang.String)
+    /**
+     * {@inheritDoc}
      */
     public DeleteResponse delete( String dn ) throws LdapException
     {
@@ -2223,8 +2229,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#delete(org.apache.directory.shared.ldap.name.DN)
+    /**
+     * {@inheritDoc}
      */
     public DeleteResponse delete( DN dn ) throws LdapException
     {
@@ -2389,8 +2395,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#delete(org.apache.directory.ldap.client.api.message.DeleteRequest)
+    /**
+     * {@inheritDoc}
      */
     public DeleteResponse delete( DeleteRequest deleteRequest ) throws LdapException
     {
@@ -2455,8 +2461,8 @@ public class LdapNetworkConnection exten
     }
     
     
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#deleteAsync(org.apache.directory.ldap.client.api.message.DeleteRequest)
+    /**
+     * {@inheritDoc}
      */
     public DeleteFuture deleteAsync( DeleteRequest delRequest ) throws LdapException
     {
@@ -2492,8 +2498,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#compare(java.lang.String,
java.lang.String, java.lang.String)
+    /**
+     * {@inheritDoc}
      */
     public CompareResponse compare( String dn, String attributeName, String value ) throws
LdapException
     {
@@ -2514,8 +2520,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#compare(java.lang.String,
java.lang.String, byte[])
+    /**
+     * {@inheritDoc}
      */
     public CompareResponse compare( String dn, String attributeName, byte[] value ) throws
LdapException
     {
@@ -2536,8 +2542,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#compare(java.lang.String,
java.lang.String, org.apache.directory.shared.ldap.entry.Value)
+    /**
+     * {@inheritDoc}
      */
     public CompareResponse compare( String dn, String attributeName, Value<?> value
) throws LdapException
     {
@@ -2558,8 +2564,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#compare(org.apache.directory.shared.ldap.name.DN,
java.lang.String, java.lang.String)
+    /**
+     * {@inheritDoc}
      */
     public CompareResponse compare( DN dn, String attributeName, String value ) throws LdapException
     {
@@ -2572,8 +2578,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#compare(org.apache.directory.shared.ldap.name.DN,
java.lang.String, byte[])
+    /**
+     * {@inheritDoc}
      */
     public CompareResponse compare( DN dn, String attributeName, byte[] value ) throws LdapException
     {
@@ -2586,8 +2592,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#compare(org.apache.directory.shared.ldap.name.DN,
java.lang.String, org.apache.directory.shared.ldap.entry.Value)
+    /**
+     * {@inheritDoc}
      */
     public CompareResponse compare( DN dn, String attributeName, Value<?> value ) throws
LdapException
     {
@@ -2600,8 +2606,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#compare(org.apache.directory.ldap.client.api.message.CompareRequest)
+    /**
+     * {@inheritDoc}
      */
     public CompareResponse compare( CompareRequest compareRequest ) throws LdapException
     {
@@ -2666,8 +2672,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#compareAsync(org.apache.directory.ldap.client.api.message.CompareRequest)
+    /**
+     * {@inheritDoc}
      */
     public CompareFuture compareAsync( CompareRequest compareRequest ) throws LdapException
     {
@@ -2733,8 +2739,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#extended(java.lang.String)
+    /**
+     * {@inheritDoc}
      */
     public ExtendedResponse extended( String oid ) throws LdapException
     {
@@ -2742,8 +2748,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#extended(java.lang.String,
byte[])
+    /**
+     * {@inheritDoc}
      */
     public ExtendedResponse extended( String oid, byte[] value ) throws LdapException
     {
@@ -2760,8 +2766,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#extended(org.apache.directory.shared.asn1.primitives.OID)
+    /**
+     * {@inheritDoc}
      */
     public ExtendedResponse extended( OID oid ) throws LdapException
     {
@@ -2769,8 +2775,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#extended(org.apache.directory.shared.asn1.primitives.OID,
byte[])
+    /**
+     * {@inheritDoc}
      */
     public ExtendedResponse extended( OID oid, byte[] value ) throws LdapException
     {
@@ -2781,8 +2787,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#extended(org.apache.directory.ldap.client.api.message.ExtendedRequest)
+    /**
+     * {@inheritDoc}
      */
     public ExtendedResponse extended( ExtendedRequest extendedRequest ) throws LdapException
     {
@@ -2847,8 +2853,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#extendedAsync(org.apache.directory.ldap.client.api.message.ExtendedRequest)
+    /**
+     * {@inheritDoc}
      */
     public ExtendedFuture extendedAsync( ExtendedRequest extendedRequest ) throws LdapException
     {
@@ -2884,8 +2890,8 @@ public class LdapNetworkConnection exten
         return extendedFuture;
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#lookup(java.lang.String)
+    /**
+     * {@inheritDoc}
      */
     public SearchResponse lookup( String dn ) throws LdapException
     {
@@ -2893,8 +2899,8 @@ public class LdapNetworkConnection exten
     }
     
     
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#lookup(java.lang.String,
java.lang.String)
+    /**
+     * {@inheritDoc}
      */
     public SearchResponse lookup( String dn, String... attributes ) throws LdapException
     {
@@ -2949,8 +2955,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#isControlSupported(java.lang.String)
+    /**
+     * {@inheritDoc}
      */
     public boolean isControlSupported( String controlOID ) throws LdapException
     {
@@ -2958,8 +2964,8 @@ public class LdapNetworkConnection exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#getSupportedControls()
+    /**
+     * {@inheritDoc}
      */
     public List<String> getSupportedControls() throws LdapException
     {
@@ -2986,8 +2992,8 @@ public class LdapNetworkConnection exten
     }
 
     
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#loadSchema()
+    /**
+     * {@inheritDoc}
      */
     public void loadSchema() throws LdapException
     {
@@ -2997,6 +3003,7 @@ public class LdapNetworkConnection exten
 
             schemaManager = new DefaultSchemaManager( jarSchemaLoader );
             schemaManager.loadAllEnabled();
+            schemaManager.getLoader().getAllSchemas();
             if( ! schemaManager.getErrors().isEmpty() )
             {
                 String msg = "there are errors while loading the schema";
@@ -3006,20 +3013,71 @@ public class LdapNetworkConnection exten
         }
         catch( LdapException le )
         {
-            le.printStackTrace();
             throw le;
         }
         catch( Exception e )
         {
-            e.printStackTrace();
             LOG.error( "failed to load the schema", e );
             throw new LdapException( e );
         }
     }
 
     
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#getSchemaManager()
+    /**
+     * parses the given schema file present in OpenLDAP schema format
+     * and adds all the SchemaObjects present in it to the SchemaManager
+     *
+     * @param schemaFile the schema file in OpenLDAP schema format
+     * @throws LdapException incase of any errors while parsing
+     */
+    public void addSchema( File schemaFile ) throws LdapException
+    {
+        try
+        {
+            if( schemaManager == null )
+            {
+                loadSchema();
+            }
+            
+            OpenLdapSchemaParser olsp = new OpenLdapSchemaParser();
+            olsp.setQuirksMode( true );
+            olsp.parse( schemaFile );
+            
+            List<AttributeType> atList = olsp.getAttributeTypes();
+            AttributeTypeRegistry atRegistry = schemaManager.getRegistries().getAttributeTypeRegistry();
+            for( AttributeType atType : atList )
+            {
+                atRegistry.addMappingFor( atType );
+            }
+            
+            List<ObjectClass> ocList = olsp.getObjectClassTypes();
+            ObjectClassRegistry ocRegistry = schemaManager.getRegistries().getObjectClassRegistry();
+            for( ObjectClass oc : ocList )
+            {
+                ocRegistry.register( oc );
+            }
+            
+            LOG.info( "successfully loaded the schema from file {}", schemaFile.getAbsolutePath()
);
+        }
+        catch( Exception e )
+        {
+            LOG.error( "failed to load the schema from file {}", schemaFile.getAbsolutePath()
);
+            throw new LdapException( e );
+        }
+    }
+    
+    
+    /**
+     * @see #addSchema(File)
+     */
+    public void addSchema( String schemaFileName ) throws LdapException
+    {
+        addSchema( new File( schemaFileName ) );
+    }
+    
+    
+    /**
+     * {@inheritDoc}
      */
     public SchemaManager getSchemaManager()
     {
@@ -3120,8 +3178,8 @@ public class LdapNetworkConnection exten
     }
     
     
-    /* (non-Javadoc)
-     * @see org.apache.directory.ldap.client.api.LdapConnection1#doesFutureExistFor(java.lang.Integer)
+    /**
+     * {@inheritDoc}
      */
     public boolean doesFutureExistFor( Integer messageId )
     {



Mime
View raw message