directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r753194 - in /directory/shared/branches/shared-replication/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended: CancelRequest.java CancelResponse.java CertGenerationRequest.java CertGenerationResponse.java
Date Fri, 13 Mar 2009 10:36:22 GMT
Author: elecharny
Date: Fri Mar 13 10:36:21 2009
New Revision: 753194

URL: http://svn.apache.org/viewvc?rev=753194&view=rev
Log:
o Added the CancelResponse class
o Fixed some warnings y adding a SerialVersionUUID
o Minor other fixes

Added:
    directory/shared/branches/shared-replication/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CancelResponse.java
Modified:
    directory/shared/branches/shared-replication/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CancelRequest.java
    directory/shared/branches/shared-replication/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CertGenerationRequest.java
    directory/shared/branches/shared-replication/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CertGenerationResponse.java

Modified: directory/shared/branches/shared-replication/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CancelRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-replication/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CancelRequest.java?rev=753194&r1=753193&r2=753194&view=diff
==============================================================================
--- directory/shared/branches/shared-replication/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CancelRequest.java
(original)
+++ directory/shared/branches/shared-replication/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CancelRequest.java
Fri Mar 13 10:36:21 2009
@@ -48,6 +48,9 @@
  */
 public class CancelRequest extends ExtendedRequestImpl
 {
+	/** The serial version UUID */
+	private static final long serialVersionUID = 1L;
+
 	/** A logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( CancelRequest.class );
 
@@ -157,7 +160,7 @@
     {
         if ( response == null )
         {
-            //response = new CancelResponse( getCancelId() );
+            response = new CancelResponse( cancelId );
         }
 
         return response;

Added: directory/shared/branches/shared-replication/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CancelResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-replication/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CancelResponse.java?rev=753194&view=auto
==============================================================================
--- directory/shared/branches/shared-replication/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CancelResponse.java
(added)
+++ directory/shared/branches/shared-replication/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CancelResponse.java
Fri Mar 13 10:36:21 2009
@@ -0,0 +1,116 @@
+/*
+ *  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.message.extended;
+
+import org.apache.directory.shared.ldap.message.ExtendedResponseImpl;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+/**
+ * 
+ * The response sent back from the server after the Cancel extended operation is performed.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class CancelResponse extends ExtendedResponseImpl
+{
+	/** The serial version UUID */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Create a new CancelResponse object
+	 * @param messageId The messageId
+	 * @param rcode the result code
+	 */
+    public CancelResponse( int messageId, ResultCodeEnum rcode )
+    {
+        super( messageId, null );
+
+        switch ( rcode )
+        {
+            case SUCCESS :
+            case CANCELED:
+            case CANNOT_CANCEL :
+            case NO_SUCH_OPERATION :
+            case TOO_LATE :
+                break;
+            
+            default:
+                throw new IllegalArgumentException( "The result code can only be one of:
" + ResultCodeEnum.SUCCESS
+                    + ", " + ResultCodeEnum.OPERATIONS_ERROR + ", " + ResultCodeEnum.INSUFFICIENT_ACCESS_RIGHTS
);
+        }
+        
+        super.getLdapResult().setMatchedDn( null );
+        super.getLdapResult().setResultCode( rcode );
+    }
+
+
+    public CancelResponse( int messageId )
+    {
+        super( messageId, null );
+        super.getLdapResult().setMatchedDn( null );
+        super.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
+    }
+
+
+    // ------------------------------------------------------------------------
+    // ExtendedResponse Interface Method Implementations
+    // ------------------------------------------------------------------------
+    /**
+     * Gets the reponse OID specific encoded response values. It's a null
+     * value for a CancelResponse
+     * 
+     * @return the response specific encoded response values.
+     */
+    public byte[] getResponse()
+    {
+        return null;
+    }
+
+
+    /**
+     * Gets the OID uniquely identifying this extended response (a.k.a. its
+     * name). It's a null value for the Cancel response
+     * 
+     * @return the OID of the extended response type.
+     */
+    public String getResponseName()
+    {
+        return null;
+    }
+
+
+    /**
+     * @see Object#equals(Object)
+     */
+    public boolean equals( Object obj )
+    {
+        if ( obj == this )
+        {
+            return true;
+        }
+
+        if ( obj instanceof CancelResponse )
+        {
+            return true;
+        }
+
+        return false;
+    }
+}

Modified: directory/shared/branches/shared-replication/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CertGenerationRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-replication/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CertGenerationRequest.java?rev=753194&r1=753193&r2=753194&view=diff
==============================================================================
--- directory/shared/branches/shared-replication/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CertGenerationRequest.java
(original)
+++ directory/shared/branches/shared-replication/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CertGenerationRequest.java
Fri Mar 13 10:36:21 2009
@@ -43,7 +43,10 @@
  */
 public class CertGenerationRequest extends ExtendedRequestImpl
 {
-    private CertGenerationObject certGenObj;
+	/** The serial version UUID */
+	private static final long serialVersionUID = 1L;
+
+	private CertGenerationObject certGenObj;
 
     private static final Logger LOG = LoggerFactory.getLogger( CertGenerationRequest.class
);
 

Modified: directory/shared/branches/shared-replication/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CertGenerationResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-replication/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CertGenerationResponse.java?rev=753194&r1=753193&r2=753194&view=diff
==============================================================================
--- directory/shared/branches/shared-replication/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CertGenerationResponse.java
(original)
+++ directory/shared/branches/shared-replication/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/CertGenerationResponse.java
Fri Mar 13 10:36:21 2009
@@ -21,6 +21,7 @@
 
 import org.apache.directory.shared.ldap.message.ExtendedResponseImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.util.StringTools;
 /**
  * 
  * The response sent back from the server after the CertGeneration extended operation is
performed.
@@ -30,12 +31,12 @@
  */
 public class CertGenerationResponse extends ExtendedResponseImpl
 {
-
+	/** The serial version UUID */
+	private static final long serialVersionUID = 1L;
+	
+	/** The CertGenerationResponse OID */
     public static final String EXTENSION_OID = "1.3.6.1.4.1.18060.0.1.7";
 
-    private static final byte[] EMPTY_RESPONSE = new byte[0];
-
-
     public CertGenerationResponse(int messageId, ResultCodeEnum rcode)
     {
         super( messageId, EXTENSION_OID );
@@ -43,11 +44,7 @@
         switch ( rcode )
         {
             case SUCCESS :
-                break;
-            
             case OPERATIONS_ERROR :
-                break;
-            
             case INSUFFICIENT_ACCESS_RIGHTS :
                 break;
             
@@ -80,12 +77,12 @@
      */
     public byte[] getResponse()
     {
-        return EMPTY_RESPONSE;
+        return StringTools.EMPTY_BYTES;
     }
 
 
     /**
-     * Sets the reponse OID specific encoded response values.
+     * Sets the response OID specific encoded response values.
      * 
      * @param value
      *            the response specific encoded response values.



Mime
View raw message