directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1073571 - in /directory/shared/branches/akarasulu: dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/ ldap-codec-standalone/src/main/java/org/apache/dir...
Date Wed, 23 Feb 2011 01:14:22 GMT
Author: akarasulu
Date: Wed Feb 23 01:14:21 2011
New Revision: 1073571

URL: http://svn.apache.org/viewvc?rev=1073571&view=rev
Log:
DIRSHARED-86: adding unimplemented methods

Modified:
    directory/shared/branches/akarasulu/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
    directory/shared/branches/akarasulu/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
    directory/shared/branches/akarasulu/ldap-codec-standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java
    directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/extendedRequest/InitExtendedRequest.java
    directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/ExtendedRequestFactory.java
    directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/LdapCodecService.java
    directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/osgi/DefaultLdapCodecService.java
    directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CancelFactory.java
    directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationFactory.java
    directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/GracefulShutdownFactory.java
    directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/StoredProcedureFactory.java
    directory/shared/branches/akarasulu/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/message/ExtendedRequestImpl.java

Modified: directory/shared/branches/akarasulu/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java?rev=1073571&r1=1073570&r2=1073571&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
(original)
+++ directory/shared/branches/akarasulu/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
Wed Feb 23 01:14:21 2011
@@ -57,8 +57,9 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.CompareRequestImpl;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.DeleteRequestImpl;
+import org.apache.directory.shared.ldap.model.message.ExtendedRequest;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequestImpl;
-import org.apache.directory.shared.ldap.model.message.ExtendedResponseImpl;
+import org.apache.directory.shared.ldap.model.message.ExtendedResponse;
 import org.apache.directory.shared.ldap.model.message.ModifyDnRequestImpl;
 import org.apache.directory.shared.ldap.model.message.ModifyRequestImpl;
 import org.apache.directory.shared.ldap.model.message.Request;
@@ -1528,7 +1529,7 @@ public final class Dsmlv2Grammar extends
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
             ExtendedRequestDsml<?,?> extendedRequest = 
-                new ExtendedRequestDsml<ExtendedRequestImpl,ExtendedResponseImpl>(
codec, new ExtendedRequestImpl() );
+                new ExtendedRequestDsml<ExtendedRequest<ExtendedResponse>,ExtendedResponse>(
codec, new ExtendedRequestImpl() );
             container.getBatchRequest().addRequest( extendedRequest );
 
             XmlPullParser xpp = container.getParser();

Modified: directory/shared/branches/akarasulu/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=1073571&r1=1073570&r2=1073571&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
(original)
+++ directory/shared/branches/akarasulu/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Wed Feb 23 01:14:21 2011
@@ -2927,12 +2927,9 @@ public class LdapNetworkConnection exten
      */
     public ExtendedResponse extended( OID oid, byte[] value ) throws LdapException
     {
-        ExtendedRequest<?> extendedRequest = new ExtendedRequestImpl();
-        extendedRequest.setRequestName( oid.toString() );
-        // extendedRequest.setRequestValue( value );
-
-        // return extended( extendedRequest );
-        throw new NotImplementedException( "need to figure out what to do with request value"
);
+        ExtendedRequest<?> extendedRequest = 
+            LdapCodecServiceFactory.getSingleton().newExtendedRequest( oid.toString(), value
);
+        return extended( extendedRequest );
     }
 
 

Modified: directory/shared/branches/akarasulu/ldap-codec-standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-codec-standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java?rev=1073571&r1=1073570&r2=1073571&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-codec-standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java
(original)
+++ directory/shared/branches/akarasulu/ldap-codec-standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java
Wed Feb 23 01:14:21 2011
@@ -35,6 +35,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.ldap.codec.BasicControlDecorator;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
 import org.apache.directory.shared.ldap.codec.api.ControlFactory;
+import org.apache.directory.shared.ldap.codec.api.ExtendedRequestDecorator;
 import org.apache.directory.shared.ldap.codec.api.ExtendedRequestFactory;
 import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.api.LdapMessageContainer;
@@ -49,6 +50,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.protocol.mina.LdapProtocolCodecFactory;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequest;
+import org.apache.directory.shared.ldap.model.message.ExtendedRequestImpl;
 import org.apache.directory.shared.ldap.model.message.ExtendedResponse;
 import org.apache.directory.shared.ldap.model.message.Message;
 import org.apache.directory.shared.ldap.model.message.controls.OpaqueControl;
@@ -811,4 +813,30 @@ public class StandaloneLdapCodecService 
         // TODO Auto-generated method stub
         return null;
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ExtendedRequest<?> newExtendedRequest( String oid, byte[] value )
+    {
+        ExtendedRequest<?> req = null;
+        
+        ExtendedRequestFactory<?,?> extendedRequestFactory = extReqFactories.get( oid
);
+        if ( extendedRequestFactory != null )
+        {
+            req = extendedRequestFactory.newRequest( value );
+        }
+        else
+        {
+            ExtendedRequestDecorator<ExtendedRequest<ExtendedResponse>, ExtendedResponse>
decorator = 
+                new ExtendedRequestDecorator<ExtendedRequest<ExtendedResponse>,
ExtendedResponse>( this, 
+                    new ExtendedRequestImpl() );
+            decorator.setRequestName( oid );
+            decorator.setRequestValue( value );
+            req = decorator;
+        }
+        
+        return req;
+    }
 }

Modified: directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/extendedRequest/InitExtendedRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/extendedRequest/InitExtendedRequest.java?rev=1073571&r1=1073570&r2=1073571&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/extendedRequest/InitExtendedRequest.java
(original)
+++ directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/extendedRequest/InitExtendedRequest.java
Wed Feb 23 01:14:21 2011
@@ -24,8 +24,9 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.ldap.codec.api.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.ExtendedRequestDecorator;
+import org.apache.directory.shared.ldap.model.message.ExtendedRequest;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequestImpl;
-import org.apache.directory.shared.ldap.model.message.ExtendedResponseImpl;
+import org.apache.directory.shared.ldap.model.message.ExtendedResponse;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -59,7 +60,7 @@ public class InitExtendedRequest extends
     {
         // Now, we can allocate the ExtendedRequest Object
         ExtendedRequestDecorator<?,?> extendedRequest = 
-            new ExtendedRequestDecorator<ExtendedRequestImpl,ExtendedResponseImpl>(
+            new ExtendedRequestDecorator<ExtendedRequest<ExtendedResponse>,ExtendedResponse>(
                 container.getLdapCodecService(), 
                 new ExtendedRequestImpl( container.getMessageId() ) );
         container.setMessage( extendedRequest );

Modified: directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/ExtendedRequestFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/ExtendedRequestFactory.java?rev=1073571&r1=1073570&r2=1073571&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/ExtendedRequestFactory.java
(original)
+++ directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/ExtendedRequestFactory.java
Wed Feb 23 01:14:21 2011
@@ -43,9 +43,18 @@ public interface ExtendedRequestFactory<
     
     
     /**
-     *  @return A new instance of the ExtendedRequest.
+     *  @return A new instance of the {@link ExtendedRequestDecorator}.
      */
     Q newRequest();
+
+    
+    /**
+     * Returns a new {@link ExtendedRequestDecorator} with the following encoded value.
+     * 
+     * @param value the encoded value
+     * @return the decorator for the extended request type
+     */
+    Q newRequest( byte[] value );
     
     
     /**

Modified: directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/LdapCodecService.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/LdapCodecService.java?rev=1073571&r1=1073570&r2=1073571&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/LdapCodecService.java
(original)
+++ directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/LdapCodecService.java
Wed Feb 23 01:14:21 2011
@@ -249,4 +249,14 @@ public interface LdapCodecService
 
 
     <E extends ExtendedResponse> E newExtendedResponse( ExtendedRequest<E> req,
byte[] serializedResponse );
+
+
+    /**
+     * Creates a new ExtendedRequest instance.
+     * 
+     * @param oid the extended request's object identifier
+     * @param value the encoded value of the extended request
+     * @return The new extended request
+     */
+    ExtendedRequest<?> newExtendedRequest( String oid, byte[] value );
 }

Modified: directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/osgi/DefaultLdapCodecService.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/osgi/DefaultLdapCodecService.java?rev=1073571&r1=1073570&r2=1073571&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/osgi/DefaultLdapCodecService.java
(original)
+++ directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/osgi/DefaultLdapCodecService.java
Wed Feb 23 01:14:21 2011
@@ -24,6 +24,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.ldap.codec.BasicControlDecorator;
+import org.apache.directory.shared.ldap.codec.api.ExtendedRequestDecorator;
 import org.apache.directory.shared.ldap.codec.api.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
 import org.apache.directory.shared.ldap.codec.api.ControlFactory;
@@ -40,6 +41,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.protocol.mina.LdapProtocolCodecFactory;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequest;
+import org.apache.directory.shared.ldap.model.message.ExtendedRequestImpl;
 import org.apache.directory.shared.ldap.model.message.ExtendedResponse;
 import org.apache.directory.shared.ldap.model.message.Message;
 import org.apache.directory.shared.ldap.model.message.controls.OpaqueControl;
@@ -411,4 +413,30 @@ public class DefaultLdapCodecService imp
         // TODO Auto-generated method stub
         throw new NotImplementedException();
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ExtendedRequest<?> newExtendedRequest( String oid, byte[] value )
+    {
+        ExtendedRequest<?> req = null;
+        
+        ExtendedRequestFactory<?,?> extendedRequestFactory = extReqFactories.get( oid
);
+        if ( extendedRequestFactory != null )
+        {
+            req = extendedRequestFactory.newRequest( value );
+        }
+        else
+        {
+            ExtendedRequestDecorator<ExtendedRequest<ExtendedResponse>, ExtendedResponse>
decorator = 
+                new ExtendedRequestDecorator<ExtendedRequest<ExtendedResponse>,
ExtendedResponse>( this, 
+                    new ExtendedRequestImpl() );
+            decorator.setRequestName( oid );
+            decorator.setRequestValue( value );
+            req = decorator;
+        }
+        
+        return req;
+    }
 }

Modified: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CancelFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CancelFactory.java?rev=1073571&r1=1073570&r2=1073571&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CancelFactory.java
(original)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CancelFactory.java
Wed Feb 23 01:14:21 2011
@@ -73,4 +73,12 @@ public class CancelFactory implements Ex
         response.setResponseValue( encodedValue );
         return response;
     }
+
+
+    public CancelRequest newRequest( byte[] value )
+    {
+        CancelRequestDecorator req = new CancelRequestDecorator( codec, new CancelRequestImpl()
);
+        req.setRequestValue( value );
+        return req;
+    }
 }

Modified: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationFactory.java?rev=1073571&r1=1073570&r2=1073571&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationFactory.java
(original)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationFactory.java
Wed Feb 23 01:14:21 2011
@@ -74,4 +74,15 @@ public class CertGenerationFactory 
         response.setResponseValue( encodedValue );
         return response;
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public CertGenerationRequest newRequest( byte[] value )
+    {
+        CertGenerationRequestDecorator req = new CertGenerationRequestDecorator( codec, new
CertGenerationRequestImpl() );
+        req.setRequestValue( value );
+        return req;
+    }
 }

Modified: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/GracefulShutdownFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/GracefulShutdownFactory.java?rev=1073571&r1=1073570&r2=1073571&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/GracefulShutdownFactory.java
(original)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/GracefulShutdownFactory.java
Wed Feb 23 01:14:21 2011
@@ -75,4 +75,15 @@ public class GracefulShutdownFactory 
         response.setResponseValue( encodedValue );
         return response;
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public GracefulShutdownRequest newRequest( byte[] value )
+    {
+        GracefulShutdownRequestDecorator req = new GracefulShutdownRequestDecorator( codec,
new GracefulShutdownRequestImpl() );
+        req.setRequestValue( value );
+        return req;
+    }
 }

Modified: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/StoredProcedureFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/StoredProcedureFactory.java?rev=1073571&r1=1073570&r2=1073571&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/StoredProcedureFactory.java
(original)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/StoredProcedureFactory.java
Wed Feb 23 01:14:21 2011
@@ -78,4 +78,15 @@ public class StoredProcedureFactory impl
         response.setResponseValue( encodedValue );
         return response;
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public StoredProcedureRequest newRequest( byte[] value )
+    {
+        StoredProcedureRequestDecorator req = new StoredProcedureRequestDecorator( codec,
new StoredProcedureRequestImpl() );
+        req.setRequestValue( value );
+        return req;
+    }
 }

Modified: directory/shared/branches/akarasulu/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/message/ExtendedRequestImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/message/ExtendedRequestImpl.java?rev=1073571&r1=1073570&r2=1073571&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/message/ExtendedRequestImpl.java
(original)
+++ directory/shared/branches/akarasulu/ldap-model/src/main/java/org/apache/directory/shared/ldap/model/message/ExtendedRequestImpl.java
Wed Feb 23 01:14:21 2011
@@ -25,7 +25,7 @@ package org.apache.directory.shared.ldap
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ExtendedRequestImpl extends AbstractRequest implements ExtendedRequest<ExtendedResponseImpl>
+public class ExtendedRequestImpl extends AbstractRequest implements ExtendedRequest<ExtendedResponse>
 {
     static final long serialVersionUID = 7916990159044177480L;
 



Mime
View raw message