directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1072237 - 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:32:10 GMT
Author: akarasulu
Date: Sat Feb 19 03:32:09 2011
New Revision: 1072237

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

Added:
    directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/GracefulShutdownFactory.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/GracefulShutdownRequest.java
    directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/GracefulShutdownResponse.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=1072237&r1=1072236&r2=1072237&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:32:09 2011
@@ -39,9 +39,11 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.extras.extended.CancelRequest;
 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.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.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
@@ -114,7 +116,9 @@ public class ExtrasBundleActivator imple
         
         extReqfactory = new CertGenerationFactory();
         codec.registerExtendedRequest( extReqfactory );
-        
+
+        extReqfactory = new GracefulShutdownFactory();
+        codec.registerExtendedRequest( extReqfactory );
         
         // --------------------------------------------------------------------
         // Register Unsolicited Response Factories
@@ -142,6 +146,7 @@ public class ExtrasBundleActivator imple
         
         codec.unregisterExtendedRequest( CancelRequest.EXTENSION_OID );
         codec.unregisterExtendedRequest( CertGenerationRequest.EXTENSION_OID );
+        codec.unregisterExtendedRequest( GracefulShutdownRequest.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/GracefulShutdownRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/GracefulShutdownRequest.java?rev=1072237&r1=1072236&r2=1072237&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/GracefulShutdownRequest.java
(original)
+++ directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/GracefulShutdownRequest.java
Sat Feb 19 03:32:09 2011
@@ -82,6 +82,17 @@ public class GracefulShutdownRequest ext
      * Instantiates a new graceful shutdown request.
      *
      * @param messageId the message id
+     */
+    public GracefulShutdownRequest()
+    {
+        setRequestName( EXTENSION_OID );
+    }
+
+
+    /**
+     * Instantiates a new graceful shutdown request.
+     *
+     * @param messageId the message id
      * @param timeOffline the offline time after disconnection, in minutes
      * @param delay the delay before disconnection, in seconds
      */

Modified: directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/GracefulShutdownResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/GracefulShutdownResponse.java?rev=1072237&r1=1072236&r2=1072237&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/GracefulShutdownResponse.java
(original)
+++ directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/GracefulShutdownResponse.java
Sat Feb 19 03:32:09 2011
@@ -88,6 +88,17 @@ public class GracefulShutdownResponse ex
     }
 
 
+    /**
+     * Instantiates a new graceful shutdown response.
+     */
+    public GracefulShutdownResponse()
+    {
+        super( EXTENSION_OID );
+        super.getLdapResult().setMatchedDn( null );
+        super.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
+    }
+
+
     // ------------------------------------------------------------------------
     // ExtendedResponse Interface Method Implementations
     // ------------------------------------------------------------------------

Added: directory/shared/branches/m1/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/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/GracefulShutdownFactory.java?rev=1072237&view=auto
==============================================================================
--- directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/GracefulShutdownFactory.java
(added)
+++ directory/shared/branches/m1/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/GracefulShutdownFactory.java
Sat Feb 19 03:32:09 2011
@@ -0,0 +1,65 @@
+/*
+ *   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.GracefulShutdownRequest;
+import org.apache.directory.shared.ldap.extras.extended.GracefulShutdownResponse;
+
+
+/**
+ * An {@link ExtendedRequestFactory} for creating cancel extended request response 
+ * pairs.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class GracefulShutdownFactory 
+    implements ExtendedRequestFactory<GracefulShutdownRequest, GracefulShutdownResponse>
+{
+    /**
+     * {@inheritDoc}
+     */
+    public String getOid()
+    {
+        return GracefulShutdownRequest.EXTENSION_OID;
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public GracefulShutdownRequest newRequest()
+    {
+        return new GracefulShutdownRequest();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public GracefulShutdownResponse newResponse( byte[] encodedValue ) throws DecoderException
+    {
+        GracefulShutdownResponse response = new GracefulShutdownResponse();
+        response.setResponseValue( encodedValue );
+        return response;
+    }
+}



Mime
View raw message