directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r905511 - in /directory/apacheds/trunk/syncrepl: pom.xml src/main/java/org/apache/directory/server/syncrepl/EntryInjector.java src/main/java/org/apache/directory/server/syncrepl/SyncReplConsumer.java
Date Tue, 02 Feb 2010 04:29:28 GMT
Author: kayyagari
Date: Tue Feb  2 04:29:22 2010
New Revision: 905511

URL: http://svn.apache.org/viewvc?rev=905511&view=rev
Log:
o added dependency on ldap-client-api
o fixed imports
o fixed the way controls are decoded

Modified:
    directory/apacheds/trunk/syncrepl/pom.xml
    directory/apacheds/trunk/syncrepl/src/main/java/org/apache/directory/server/syncrepl/EntryInjector.java
    directory/apacheds/trunk/syncrepl/src/main/java/org/apache/directory/server/syncrepl/SyncReplConsumer.java

Modified: directory/apacheds/trunk/syncrepl/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/syncrepl/pom.xml?rev=905511&r1=905510&r2=905511&view=diff
==============================================================================
--- directory/apacheds/trunk/syncrepl/pom.xml (original)
+++ directory/apacheds/trunk/syncrepl/pom.xml Tue Feb  2 04:29:22 2010
@@ -47,9 +47,9 @@
   <!-- =======  Dependencies are declared here  ======= -->
   <dependencies>
     <dependency>
-      <groupId>org.apache.directory.shared</groupId>
-      <artifactId>shared-ldap-client-api</artifactId>
-      <version>${org.apache.directory.shared.version}</version>
+      <groupId>org.apache.directory.client.ldap</groupId>
+      <artifactId>ldap-client-api</artifactId>
+      <version>0.1-SNAPSHOT</version>
     </dependency>
 
     <dependency>

Modified: directory/apacheds/trunk/syncrepl/src/main/java/org/apache/directory/server/syncrepl/EntryInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/syncrepl/src/main/java/org/apache/directory/server/syncrepl/EntryInjector.java?rev=905511&r1=905510&r2=905511&view=diff
==============================================================================
--- directory/apacheds/trunk/syncrepl/src/main/java/org/apache/directory/server/syncrepl/EntryInjector.java
(original)
+++ directory/apacheds/trunk/syncrepl/src/main/java/org/apache/directory/server/syncrepl/EntryInjector.java
Tue Feb  2 04:29:22 2010
@@ -30,9 +30,9 @@
 import javax.swing.JTextField;
 import javax.swing.border.TitledBorder;
 
-import org.apache.directory.shared.ldap.client.api.LdapConnection;
-import org.apache.directory.shared.ldap.client.api.messages.SearchResponse;
-import org.apache.directory.shared.ldap.client.api.messages.SearchResultEntry;
+import org.apache.directory.ldap.client.api.LdapConnection;
+import org.apache.directory.ldap.client.api.message.SearchResponse;
+import org.apache.directory.ldap.client.api.message.SearchResultEntry;
 import org.apache.directory.shared.ldap.cursor.Cursor;
 import org.apache.directory.shared.ldap.entry.client.DefaultClientEntry;
 import org.apache.directory.shared.ldap.filter.SearchScope;
@@ -80,7 +80,7 @@
         try
         {
             String cn = "entry-" + System.currentTimeMillis();
-            LdapDN dn = new LdapDN( "cn=" + cn + ",dc=test,dc=nodomain" );
+            LdapDN dn = new LdapDN( "cn=" + cn + "," + config.getBaseDn() );
             DefaultClientEntry entry = new DefaultClientEntry();
             entry.add( "objectclass", "inetOrgPerson", "organizationalPerson", "person" );
             entry.add( "cn", cn );
@@ -107,7 +107,7 @@
             }
             else if( dn == null )
             {
-                Cursor<SearchResponse> cursor = connection.search( config.getBaseDn(),
config.getFilter(), SearchScope.getSearchScope( config.getSearchScope() ), config.getAttributes().split(
"," ) );
+                Cursor<SearchResponse> cursor = connection.search( config.getBaseDn(),
config.getFilter(), SearchScope.getSearchScope( config.getSearchScope() ), config.getAttributes()
);
                 cursor.beforeFirst();
                 if( cursor.next() && cursor.next() ) // to skip the baseDN
                 {

Modified: directory/apacheds/trunk/syncrepl/src/main/java/org/apache/directory/server/syncrepl/SyncReplConsumer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/syncrepl/src/main/java/org/apache/directory/server/syncrepl/SyncReplConsumer.java?rev=905511&r1=905510&r2=905511&view=diff
==============================================================================
--- directory/apacheds/trunk/syncrepl/src/main/java/org/apache/directory/server/syncrepl/SyncReplConsumer.java
(original)
+++ directory/apacheds/trunk/syncrepl/src/main/java/org/apache/directory/server/syncrepl/SyncReplConsumer.java
Tue Feb  2 04:29:22 2010
@@ -28,30 +28,29 @@
 import java.util.Iterator;
 import java.util.List;
 
-import javax.naming.ldap.Control;
-
+import org.apache.directory.ldap.client.api.LdapConnection;
+import org.apache.directory.ldap.client.api.exception.LdapException;
+import org.apache.directory.ldap.client.api.listener.IntermediateResponseListener;
+import org.apache.directory.ldap.client.api.listener.SearchListener;
+import org.apache.directory.ldap.client.api.message.BindResponse;
+import org.apache.directory.ldap.client.api.message.IntermediateResponse;
+import org.apache.directory.ldap.client.api.message.LdapResult;
+import org.apache.directory.ldap.client.api.message.SearchRequest;
+import org.apache.directory.ldap.client.api.message.SearchResultDone;
+import org.apache.directory.ldap.client.api.message.SearchResultEntry;
+import org.apache.directory.ldap.client.api.message.SearchResultReference;
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.entry.DefaultServerEntry;
 import org.apache.directory.server.core.entry.ServerModification;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
-import org.apache.directory.shared.ldap.client.api.LdapConnection;
-import org.apache.directory.shared.ldap.client.api.exception.LdapException;
-import org.apache.directory.shared.ldap.client.api.listeners.IntermediateResponseListener;
-import org.apache.directory.shared.ldap.client.api.listeners.SearchListener;
-import org.apache.directory.shared.ldap.client.api.messages.BindResponse;
-import org.apache.directory.shared.ldap.client.api.messages.IntermediateResponse;
-import org.apache.directory.shared.ldap.client.api.messages.LdapResult;
-import org.apache.directory.shared.ldap.client.api.messages.SearchRequest;
-import org.apache.directory.shared.ldap.client.api.messages.SearchResultDone;
-import org.apache.directory.shared.ldap.client.api.messages.SearchResultEntry;
-import org.apache.directory.shared.ldap.client.api.messages.SearchResultReference;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControlCodec;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControl;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControlDecoder;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.SyncInfoValueControlCodec;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.SyncInfoValueControl;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.SyncInfoValueControlDecoder;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncStateValue.SyncStateValueControlCodec;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncRequestValue.SyncRequestValueControl;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncStateValue.SyncStateValueControl;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncStateValue.SyncStateValueControlDecoder;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Entry;
@@ -65,10 +64,8 @@
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.message.control.replication.SyncDoneValueControl;
-import org.apache.directory.shared.ldap.message.control.replication.SyncRequestValueControl;
+import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.message.control.replication.SyncStateTypeEnum;
-import org.apache.directory.shared.ldap.message.control.replication.SyncStateValueControl;
 import org.apache.directory.shared.ldap.message.control.replication.SynchronizationModeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
@@ -262,10 +259,10 @@
         LOG.debug( "///////////////// handleSearchDone //////////////////" );
 
         Control ctrl = searchDone.getControl( SyncDoneValueControl.CONTROL_OID );
-        SyncDoneValueControlCodec syncDoneCtrl = null;
+        SyncDoneValueControl syncDoneCtrl = new SyncDoneValueControl();
         try
         {
-            syncDoneCtrl = ( SyncDoneValueControlCodec ) syncDoneControlDecoder.decode( ctrl.getEncodedValue()
);
+            syncDoneCtrl = ( SyncDoneValueControl ) syncDoneControlDecoder.decode( ctrl.getValue(),
syncDoneCtrl );
             refreshDeletes = syncDoneCtrl.isRefreshDeletes();
         }
         catch ( Exception e )
@@ -321,11 +318,11 @@
             Entry remoteEntry = syncResult.getEntry();
 
             Control ctrl = syncResult.getControl( SyncStateValueControl.CONTROL_OID );
-            SyncStateValueControlCodec syncStateCtrl = null;
+            SyncStateValueControl syncStateCtrl = new SyncStateValueControl();
 
             try
             {
-                syncStateCtrl = ( SyncStateValueControlCodec ) syncStateControlDecoder.decode(
ctrl.getEncodedValue() );
+                syncStateCtrl = ( SyncStateValueControl ) syncStateControlDecoder.decode(
ctrl.getValue(), syncStateCtrl );
             }
             catch ( Exception e )
             {
@@ -400,7 +397,7 @@
         {
             LOG.debug( "............... inside handleSyncInfo ..............." );
 
-            SyncInfoValueControlCodec syncInfoValue = ( SyncInfoValueControlCodec ) decoder.decode(
syncinfo );
+            SyncInfoValueControl syncInfoValue = ( SyncInfoValueControl ) decoder.decode(
syncinfo, null );
 
             byte[] cookie = syncInfoValue.getCookie();
 



Mime
View raw message