Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 40134 invoked from network); 3 Feb 2011 22:48:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Feb 2011 22:48:53 -0000 Received: (qmail 87077 invoked by uid 500); 3 Feb 2011 22:48:53 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 87021 invoked by uid 500); 3 Feb 2011 22:48:53 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 87014 invoked by uid 99); 3 Feb 2011 22:48:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Feb 2011 22:48:53 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Feb 2011 22:48:52 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id EFBA723889E3; Thu, 3 Feb 2011 22:48:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1067019 - in /directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls: ppolicy_impl/ syncrepl_impl/ Date: Thu, 03 Feb 2011 22:48:31 -0000 To: commits@directory.apache.org From: akarasulu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110203224831.EFBA723889E3@eris.apache.org> Author: akarasulu Date: Thu Feb 3 22:48:31 2011 New Revision: 1067019 URL: http://svn.apache.org/viewvc?rev=1067019&view=rev Log: DIRSHARED-81: o cleaning up, documentation o removing unnecessary JNDI converstion methods Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyFactory.java directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncDoneValueFactory.java directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncInfoValueFactory.java directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncModifyDnFactory.java directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncRequestValueFactory.java directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncStateValueFactory.java Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyFactory.java URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyFactory.java?rev=1067019&r1=1067018&r2=1067019&view=diff ============================================================================== --- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyFactory.java (original) +++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyFactory.java Thu Feb 3 22:48:31 2011 @@ -20,13 +20,6 @@ package org.apache.directory.shared.ldap.extras.controls.ppolicy_impl; -import java.nio.ByteBuffer; - -import javax.naming.ldap.BasicControl; -import javax.naming.ldap.Control; - -import org.apache.directory.shared.asn1.DecoderException; -import org.apache.directory.shared.asn1.EncoderException; import org.apache.directory.shared.ldap.codec.IControlFactory; import org.apache.directory.shared.ldap.codec.ILdapCodecService; import org.apache.directory.shared.ldap.extras.controls.PasswordPolicy; @@ -75,6 +68,10 @@ public class PasswordPolicyFactory imple } + /** + * + * {@inheritDoc} + */ public PasswordPolicyDecorator decorate( PasswordPolicy control ) { PasswordPolicyDecorator decorator = null; @@ -93,39 +90,12 @@ public class PasswordPolicyFactory imple } + /** + * + * {@inheritDoc} + */ public PasswordPolicy newControl() { return new PasswordPolicyImpl(); } - - - public Control toJndiControl( PasswordPolicy control ) throws EncoderException - { - PasswordPolicyDecorator decorator = decorate( control ); - ByteBuffer bb = ByteBuffer.allocate( decorator.computeLength() ); - decorator.encode( bb ); - bb.flip(); - return new BasicControl( control.getOid(), control.isCritical(), decorator.getValue() ); - } - - - public PasswordPolicy fromJndiControl( Control jndi ) throws DecoderException - { - PasswordPolicyDecorator decorator = null; - - if ( jndi.getEncodedValue() == null || jndi.getEncodedValue().length == 0 ) - { - decorator = new PasswordPolicyDecorator( codec, false ); - } - else - { - decorator = new PasswordPolicyDecorator( codec, true ); - } - - decorator.setCritical( jndi.isCritical() ); - decorator.setValue( jndi.getEncodedValue() ); - byte[] controlBytes = new byte[ decorator.computeLength() ]; - decorator.decode( controlBytes ); - return decorator.getDecorated(); - } } Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncDoneValueFactory.java URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncDoneValueFactory.java?rev=1067019&r1=1067018&r2=1067019&view=diff ============================================================================== --- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncDoneValueFactory.java (original) +++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncDoneValueFactory.java Thu Feb 3 22:48:31 2011 @@ -20,13 +20,6 @@ package org.apache.directory.shared.ldap.extras.controls.syncrepl_impl; -import java.nio.ByteBuffer; - -import javax.naming.ldap.BasicControl; -import javax.naming.ldap.Control; - -import org.apache.directory.shared.asn1.DecoderException; -import org.apache.directory.shared.asn1.EncoderException; import org.apache.directory.shared.ldap.codec.IControlFactory; import org.apache.directory.shared.ldap.codec.ILdapCodecService; import org.apache.directory.shared.ldap.extras.controls.SyncDoneValue; @@ -97,26 +90,4 @@ public class SyncDoneValueFactory implem { return new SyncDoneValueImpl(); } - - - public Control toJndiControl( SyncDoneValue control ) throws EncoderException - { - SyncDoneValueDecorator decorator = decorate( control ); - ByteBuffer bb = ByteBuffer.allocate( decorator.computeLength() ); - decorator.encode( bb ); - bb.flip(); - return new BasicControl( control.getOid(), control.isCritical(), decorator.getValue() ); - } - - - public SyncDoneValue fromJndiControl( Control jndi ) throws DecoderException - { - SyncDoneValueDecorator decorator = newCodecControl(); - decorator.setCritical( jndi.isCritical() ); - decorator.setValue( jndi.getEncodedValue() ); - byte[] controlBytes = new byte[ decorator.computeLength() ]; - decorator.decode( controlBytes ); - return decorator.getDecorated(); - } - } Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncInfoValueFactory.java URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncInfoValueFactory.java?rev=1067019&r1=1067018&r2=1067019&view=diff ============================================================================== --- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncInfoValueFactory.java (original) +++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncInfoValueFactory.java Thu Feb 3 22:48:31 2011 @@ -20,13 +20,6 @@ package org.apache.directory.shared.ldap.extras.controls.syncrepl_impl; -import java.nio.ByteBuffer; - -import javax.naming.ldap.BasicControl; -import javax.naming.ldap.Control; - -import org.apache.directory.shared.asn1.DecoderException; -import org.apache.directory.shared.asn1.EncoderException; import org.apache.directory.shared.ldap.codec.IControlFactory; import org.apache.directory.shared.ldap.codec.ILdapCodecService; import org.apache.directory.shared.ldap.extras.controls.SyncInfoValue; @@ -97,26 +90,4 @@ public class SyncInfoValueFactory implem { return new SyncInfoValueImpl(); } - - - public Control toJndiControl( SyncInfoValue control ) throws EncoderException - { - SyncInfoValueDecorator decorator = decorate( control ); - ByteBuffer bb = ByteBuffer.allocate( decorator.computeLength() ); - decorator.encode( bb ); - bb.flip(); - return new BasicControl( control.getOid(), control.isCritical(), decorator.getValue() ); - } - - - public SyncInfoValue fromJndiControl( Control jndi ) throws DecoderException - { - SyncInfoValueDecorator decorator = newCodecControl(); - decorator.setCritical( jndi.isCritical() ); - decorator.setValue( jndi.getEncodedValue() ); - byte[] controlBytes = new byte[ decorator.computeLength() ]; - decorator.decode( controlBytes ); - return decorator.getDecorated(); - } - } Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncModifyDnFactory.java URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncModifyDnFactory.java?rev=1067019&r1=1067018&r2=1067019&view=diff ============================================================================== --- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncModifyDnFactory.java (original) +++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncModifyDnFactory.java Thu Feb 3 22:48:31 2011 @@ -20,13 +20,6 @@ package org.apache.directory.shared.ldap.extras.controls.syncrepl_impl; -import java.nio.ByteBuffer; - -import javax.naming.ldap.BasicControl; -import javax.naming.ldap.Control; - -import org.apache.directory.shared.asn1.DecoderException; -import org.apache.directory.shared.asn1.EncoderException; import org.apache.directory.shared.ldap.codec.IControlFactory; import org.apache.directory.shared.ldap.codec.ILdapCodecService; import org.apache.directory.shared.ldap.extras.controls.SyncModifyDn; @@ -97,26 +90,4 @@ public class SyncModifyDnFactory impleme { return new SyncModifyDnImpl(); } - - - public Control toJndiControl( SyncModifyDn control ) throws EncoderException - { - SyncModifyDnDecorator decorator = decorate( control ); - ByteBuffer bb = ByteBuffer.allocate( decorator.computeLength() ); - decorator.encode( bb ); - bb.flip(); - return new BasicControl( control.getOid(), control.isCritical(), decorator.getValue() ); - } - - - public SyncModifyDn fromJndiControl( Control jndi ) throws DecoderException - { - SyncModifyDnDecorator decorator = newCodecControl(); - decorator.setCritical( jndi.isCritical() ); - decorator.setValue( jndi.getEncodedValue() ); - byte[] controlBytes = new byte[ decorator.computeLength() ]; - decorator.decode( controlBytes ); - return decorator.getDecorated(); - } - } Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncRequestValueFactory.java URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncRequestValueFactory.java?rev=1067019&r1=1067018&r2=1067019&view=diff ============================================================================== --- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncRequestValueFactory.java (original) +++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncRequestValueFactory.java Thu Feb 3 22:48:31 2011 @@ -20,13 +20,6 @@ package org.apache.directory.shared.ldap.extras.controls.syncrepl_impl; -import java.nio.ByteBuffer; - -import javax.naming.ldap.BasicControl; -import javax.naming.ldap.Control; - -import org.apache.directory.shared.asn1.DecoderException; -import org.apache.directory.shared.asn1.EncoderException; import org.apache.directory.shared.ldap.codec.IControlFactory; import org.apache.directory.shared.ldap.codec.ILdapCodecService; import org.apache.directory.shared.ldap.extras.controls.SyncRequestValue; @@ -97,26 +90,4 @@ public class SyncRequestValueFactory imp { return new SyncRequestValueImpl(); } - - - public Control toJndiControl( SyncRequestValue control ) throws EncoderException - { - SyncRequestValueDecorator decorator = decorate( control ); - ByteBuffer bb = ByteBuffer.allocate( decorator.computeLength() ); - decorator.encode( bb ); - bb.flip(); - return new BasicControl( control.getOid(), control.isCritical(), decorator.getValue() ); - } - - - public SyncRequestValue fromJndiControl( Control jndi ) throws DecoderException - { - SyncRequestValueDecorator decorator = newCodecControl(); - decorator.setCritical( jndi.isCritical() ); - decorator.setValue( jndi.getEncodedValue() ); - byte[] controlBytes = new byte[ decorator.computeLength() ]; - decorator.decode( controlBytes ); - return decorator.getDecorated(); - } - } Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncStateValueFactory.java URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncStateValueFactory.java?rev=1067019&r1=1067018&r2=1067019&view=diff ============================================================================== --- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncStateValueFactory.java (original) +++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncStateValueFactory.java Thu Feb 3 22:48:31 2011 @@ -20,13 +20,6 @@ package org.apache.directory.shared.ldap.extras.controls.syncrepl_impl; -import java.nio.ByteBuffer; - -import javax.naming.ldap.BasicControl; -import javax.naming.ldap.Control; - -import org.apache.directory.shared.asn1.DecoderException; -import org.apache.directory.shared.asn1.EncoderException; import org.apache.directory.shared.ldap.codec.IControlFactory; import org.apache.directory.shared.ldap.codec.ILdapCodecService; @@ -94,25 +87,4 @@ public class SyncStateValueFactory imple { return new SyncStateValueImpl(); } - - - public Control toJndiControl( SyncStateValue control ) throws EncoderException - { - SyncStateValueDecorator decorator = decorate( control ); - ByteBuffer bb = ByteBuffer.allocate( decorator.computeLength() ); - decorator.encode( bb ); - bb.flip(); - return new BasicControl( control.getOid(), control.isCritical(), decorator.getValue() ); - } - - - public SyncStateValue fromJndiControl( Control jndi ) throws DecoderException - { - SyncStateValueDecorator decorator = newCodecControl(); - decorator.setCritical( jndi.isCritical() ); - decorator.setValue( jndi.getEncodedValue() ); - byte[] controlBytes = new byte[ decorator.computeLength() ]; - decorator.decode( controlBytes ); - return decorator.getDecorated(); - } }