directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r748168 - /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java
Date Thu, 26 Feb 2009 14:53:47 GMT
Author: elecharny
Date: Thu Feb 26 14:53:46 2009
New Revision: 748168

URL: http://svn.apache.org/viewvc?rev=748168&view=rev
Log:
Added the missing transformation of replication controls

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java?rev=748168&r1=748167&r2=748168&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java
Thu Feb 26 14:53:46 2009
@@ -38,6 +38,10 @@
 import org.apache.directory.shared.ldap.codec.bind.SimpleAuthentication;
 import org.apache.directory.shared.ldap.codec.compare.CompareRequest;
 import org.apache.directory.shared.ldap.codec.compare.CompareResponse;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControlCodec;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.SyncInfoValueControlCodec;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncRequestValue.SyncRequestValueControlCodec;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncStateValue.SyncStateValueControlCodec;
 import org.apache.directory.shared.ldap.codec.del.DelRequest;
 import org.apache.directory.shared.ldap.codec.del.DelResponse;
 import org.apache.directory.shared.ldap.codec.extended.ExtendedRequest;
@@ -109,6 +113,13 @@
 import org.apache.directory.shared.ldap.message.control.PagedSearchControl;
 import org.apache.directory.shared.ldap.message.control.PersistentSearchControl;
 import org.apache.directory.shared.ldap.message.control.SubentriesControl;
+import org.apache.directory.shared.ldap.message.control.replication.SyncDoneValueControl;
+import org.apache.directory.shared.ldap.message.control.replication.SyncInfoValueNewCookieControl;
+import org.apache.directory.shared.ldap.message.control.replication.SyncInfoValueRefreshDeleteControl;
+import org.apache.directory.shared.ldap.message.control.replication.SyncInfoValueRefreshPresentControl;
+import org.apache.directory.shared.ldap.message.control.replication.SyncInfoValueSyncIdSetControl;
+import org.apache.directory.shared.ldap.message.control.replication.SyncRequestValueControl;
+import org.apache.directory.shared.ldap.message.control.replication.SyncStateValueControl;
 import org.apache.directory.shared.ldap.message.extended.GracefulShutdownRequest;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.LdapURL;
@@ -946,6 +957,87 @@
                     neutralPagedSearchControl.setSize( twixPagedSearchControl.getSize() );
                     neutralPagedSearchControl.setCritical( twixControl.getCriticality() );
                 }
+                else if ( twixControl.getControlValue() instanceof SyncDoneValueControlCodec
)
+                {
+                    SyncDoneValueControl neutralSyncDoneValueControl = new SyncDoneValueControl();
+                    SyncDoneValueControlCodec twixSyncDoneValueControl = (SyncDoneValueControlCodec)twixControl.getControlValue();
+                    neutralControl = neutralSyncDoneValueControl;
+                    neutralSyncDoneValueControl.setCritical( twixControl.getCriticality()
);
+                    neutralSyncDoneValueControl.setCookie( twixSyncDoneValueControl.getCookie()
);
+                    neutralSyncDoneValueControl.setRefreshDeletes( twixSyncDoneValueControl.isRefreshDeletes()
);
+                }
+                else if ( twixControl.getControlValue() instanceof SyncInfoValueControlCodec
)
+                {
+                    SyncInfoValueControlCodec twixSyncInfoValueControlCodec = (SyncInfoValueControlCodec)twixControl.getControlValue();
+                    
+                    switch ( twixSyncInfoValueControlCodec.getType() )
+                    {
+                        case NEW_COOKIE :
+                            SyncInfoValueNewCookieControl neutralSyncInfoValueNewCookieControl
= new SyncInfoValueNewCookieControl();
+                            neutralControl = neutralSyncInfoValueNewCookieControl; 
+                            neutralSyncInfoValueNewCookieControl.setCritical( twixControl.getCriticality()
);
+                            neutralSyncInfoValueNewCookieControl.setCookie( twixSyncInfoValueControlCodec.getCookie()
);
+                            
+                            break;
+                            
+                        case REFRESH_DELETE :
+                            SyncInfoValueRefreshDeleteControl neutralSyncInfoValueRefreshDeleteControl
= new SyncInfoValueRefreshDeleteControl();
+                            neutralControl = neutralSyncInfoValueRefreshDeleteControl; 
+                            neutralSyncInfoValueRefreshDeleteControl.setCritical( twixControl.getCriticality()
);
+                            neutralSyncInfoValueRefreshDeleteControl.setCookie( twixSyncInfoValueControlCodec.getCookie()
);
+                            neutralSyncInfoValueRefreshDeleteControl.setRefreshDone( twixSyncInfoValueControlCodec.isRefreshDone()
);
+                            
+                            break;
+                            
+                        case REFRESH_PRESENT :
+                            SyncInfoValueRefreshPresentControl neutralSyncInfoValueRefreshPresentControl
= new SyncInfoValueRefreshPresentControl();
+                            neutralControl = neutralSyncInfoValueRefreshPresentControl; 
+                            neutralSyncInfoValueRefreshPresentControl.setCritical( twixControl.getCriticality()
);
+                            neutralSyncInfoValueRefreshPresentControl.setCookie( twixSyncInfoValueControlCodec.getCookie()
);
+                            neutralSyncInfoValueRefreshPresentControl.setRefreshDone( twixSyncInfoValueControlCodec.isRefreshDone()
);
+                            
+                            break;
+                            
+                        case SYNC_ID_SET :
+                            SyncInfoValueSyncIdSetControl neutralSyncInfoValueSyncIdSetControl
= new SyncInfoValueSyncIdSetControl();
+                            neutralControl = neutralSyncInfoValueSyncIdSetControl; 
+                            neutralSyncInfoValueSyncIdSetControl.setCritical( twixControl.getCriticality()
);
+                            neutralSyncInfoValueSyncIdSetControl.setCookie( twixSyncInfoValueControlCodec.getCookie()
);
+                            neutralSyncInfoValueSyncIdSetControl.setRefreshDeletes( twixSyncInfoValueControlCodec.isRefreshDeletes()
);
+                            
+                            List<byte[]> uuids = twixSyncInfoValueControlCodec.getSyncUUIDs();
+                            
+                            if ( uuids != null )
+                            {
+                                for ( byte[] uuid:uuids )
+                                {
+                                    neutralSyncInfoValueSyncIdSetControl.addSyncUUID( uuid
);
+                                }
+                            }
+                            
+                            break;
+                    }
+                }
+                else if ( twixControl.getControlValue() instanceof SyncRequestValueControlCodec
)
+                {
+                    SyncRequestValueControl neutralSyncRequestValueControl = new SyncRequestValueControl();
+                    SyncRequestValueControlCodec twixSyncDoneValueControlCodec = (SyncRequestValueControlCodec)twixControl.getControlValue();
+                    neutralControl = neutralSyncRequestValueControl;
+                    neutralSyncRequestValueControl.setCritical( twixControl.getCriticality()
);
+                    neutralSyncRequestValueControl.setMode( twixSyncDoneValueControlCodec.getMode()
);
+                    neutralSyncRequestValueControl.setCookie( twixSyncDoneValueControlCodec.getCookie()
);
+                    neutralSyncRequestValueControl.setReloadHint( twixSyncDoneValueControlCodec.isReloadHint()
);
+                }
+                else if ( twixControl.getControlValue() instanceof SyncStateValueControl
)
+                {
+                    SyncStateValueControl neutralSyncStateValueControl = new SyncStateValueControl();
+                    SyncStateValueControlCodec twixSyncStateValueControlCodec = (SyncStateValueControlCodec)twixControl.getControlValue();
+                    neutralControl = neutralSyncStateValueControl;
+                    neutralSyncStateValueControl.setCritical( twixControl.getCriticality()
);
+                    neutralSyncStateValueControl.setSyncStateType( twixSyncStateValueControlCodec.getSyncStateType()
);
+                    neutralSyncStateValueControl.setEntryUUID( twixSyncStateValueControlCodec.getEntryUUID()
);
+                    neutralSyncStateValueControl.setCookie( twixSyncStateValueControlCodec.getCookie()
);
+                }
                 else if ( twixControl.getControlValue() instanceof byte[] )
                 {
                     neutralControl = new AbstractMutableControlImpl()



Mime
View raw message