directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1072239 - in /directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras: ./ extended/ extended/ads_impl/
Date Sat, 19 Feb 2011 03:40:26 GMT
Author: akarasulu
Date: Sat Feb 19 03:40:26 2011
New Revision: 1072239

URL: http://svn.apache.org/viewvc?rev=1072239&view=rev
Log:
DIRSHARED-86: implementing factory for the stored procedure ext op

Added:
    directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/StoredProcedureFactory.java
Modified:
    directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/ExtrasBundleActivator.java
    directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/StoredProcedureRequest.java
    directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/StoredProcedureResponse.java

Modified: directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/ExtrasBundleActivator.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/ExtrasBundleActivator.java?rev=1072239&r1=1072238&r2=1072239&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/ExtrasBundleActivator.java
(original)
+++ directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/ExtrasBundleActivator.java
Sat Feb 19 03:40:26 2011
@@ -40,10 +40,12 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.extras.extended.CertGenerationRequest;
 import org.apache.directory.shared.ldap.extras.extended.GracefulDisconnect;
 import org.apache.directory.shared.ldap.extras.extended.GracefulShutdownRequest;
+import org.apache.directory.shared.ldap.extras.extended.StoredProcedureRequest;
 import org.apache.directory.shared.ldap.extras.extended.ads_impl.CancelFactory;
 import org.apache.directory.shared.ldap.extras.extended.ads_impl.CertGenerationFactory;
 import org.apache.directory.shared.ldap.extras.extended.ads_impl.GracefulDisconnectFactory;
 import org.apache.directory.shared.ldap.extras.extended.ads_impl.GracefulShutdownFactory;
+import org.apache.directory.shared.ldap.extras.extended.ads_impl.StoredProcedureFactory;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
@@ -120,6 +122,10 @@ public class ExtrasBundleActivator imple
         extReqfactory = new GracefulShutdownFactory();
         codec.registerExtendedRequest( extReqfactory );
         
+        extReqfactory = new StoredProcedureFactory();
+        codec.registerExtendedRequest( extReqfactory );
+        
+        
         // --------------------------------------------------------------------
         // Register Unsolicited Response Factories
         // --------------------------------------------------------------------
@@ -147,6 +153,7 @@ public class ExtrasBundleActivator imple
         codec.unregisterExtendedRequest( CancelRequest.EXTENSION_OID );
         codec.unregisterExtendedRequest( CertGenerationRequest.EXTENSION_OID );
         codec.unregisterExtendedRequest( GracefulShutdownRequest.EXTENSION_OID );
+        codec.unregisterExtendedRequest( StoredProcedureRequest.EXTENSION_OID );
         
         codec.unregisterUnsolicitedResponse( GracefulDisconnect.EXTENSION_OID );
     }

Modified: directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/StoredProcedureRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/StoredProcedureRequest.java?rev=1072239&r1=1072238&r2=1072239&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/StoredProcedureRequest.java
(original)
+++ directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/StoredProcedureRequest.java
Sat Feb 19 03:40:26 2011
@@ -75,6 +75,16 @@ public class StoredProcedureRequest exte
 
     /**
      * Instantiates a new stored procedure request.
+     */
+    public StoredProcedureRequest()
+    {
+        this.setRequestName( EXTENSION_OID );
+        this.procedure = new StoredProcedure();
+    }
+
+
+    /**
+     * Instantiates a new stored procedure request.
      *
      * @param messageId the message id
      * @param procedure the procedure

Modified: directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/StoredProcedureResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/StoredProcedureResponse.java?rev=1072239&r1=1072238&r2=1072239&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/StoredProcedureResponse.java
(original)
+++ directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/StoredProcedureResponse.java
Sat Feb 19 03:40:26 2011
@@ -47,4 +47,13 @@ public class StoredProcedureResponse ext
     {
         super( messageId, EXTENSION_OID );
     }
+
+    
+    /**
+     * Instantiates a new stored procedure response.
+     */
+    public StoredProcedureResponse()
+    {
+        super( EXTENSION_OID );
+    }
 }

Added: directory/shared/branches/m1/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/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/StoredProcedureFactory.java?rev=1072239&view=auto
==============================================================================
--- directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/StoredProcedureFactory.java
(added)
+++ directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/StoredProcedureFactory.java
Sat Feb 19 03:40:26 2011
@@ -0,0 +1,64 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.shared.ldap.extras.extended.ads_impl;
+
+
+import org.apache.directory.shared.asn1.DecoderException;
+import org.apache.directory.shared.ldap.codec.api.ExtendedRequestFactory;
+import org.apache.directory.shared.ldap.extras.extended.StoredProcedureRequest;
+import org.apache.directory.shared.ldap.extras.extended.StoredProcedureResponse;
+
+
+/**
+ * An {@link ExtendedRequestFactory} for creating cancel extended request response 
+ * pairs.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StoredProcedureFactory implements ExtendedRequestFactory<StoredProcedureRequest,
StoredProcedureResponse>
+{
+    /**
+     * {@inheritDoc}
+     */
+    public String getOid()
+    {
+        return StoredProcedureRequest.EXTENSION_OID;
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public StoredProcedureRequest newRequest()
+    {
+        return new StoredProcedureRequest();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public StoredProcedureResponse newResponse( byte[] encodedValue ) throws DecoderException
+    {
+        StoredProcedureResponse response = new StoredProcedureResponse();
+        response.setResponseValue( encodedValue );
+        return response;
+    }
+}



Mime
View raw message