directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r760700 - in /directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages: AbandonRequest.java AbandonRequestImpl.java AbstractRequest.java BindRequestImpl.java
Date Tue, 31 Mar 2009 22:35:53 GMT
Author: elecharny
Date: Tue Mar 31 22:35:53 2009
New Revision: 760700

URL: http://svn.apache.org/viewvc?rev=760700&view=rev
Log:
o Created the AbandonRequest interface and class
o Created an AbstractRequest class, containing the controls and timeout parameters
o Changed the BindRequestImpl to extends this class

Added:
    directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbandonRequest.java
    directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbandonRequestImpl.java
    directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbstractRequest.java
Modified:
    directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/BindRequestImpl.java

Added: directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbandonRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbandonRequest.java?rev=760700&view=auto
==============================================================================
--- directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbandonRequest.java
(added)
+++ directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbandonRequest.java
Tue Mar 31 22:35:53 2009
@@ -0,0 +1,43 @@
+/*
+ *  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.client.api.messages;
+
+/**
+ * Abandon protocol operation request. It abandon the given message.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public interface AbandonRequest extends Message
+{
+    /**
+     * Get the abandoned message ID
+     * 
+     * @return Returns the abandoned MessageId.
+     */
+    int getAbandonedMessageId();
+
+    
+    /**
+     * Set the abandoned message ID
+     * 
+     * @param abandonedMessageId The abandoned messageID to set.
+     */
+    void setAbandonedMessageId( int abandonedMessageId );
+}

Added: directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbandonRequestImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbandonRequestImpl.java?rev=760700&view=auto
==============================================================================
--- directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbandonRequestImpl.java
(added)
+++ directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbandonRequestImpl.java
Tue Mar 31 22:35:53 2009
@@ -0,0 +1,60 @@
+/*
+ *  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.client.api.messages;
+
+/**
+ * A AbandonRequest Message. 
+ * 
+ * Its syntax is : 
+ * AbandonRequest ::= [APPLICATION 16] MessageID 
+ * 
+ * MessageID ::= INTEGER (0 .. maxInt) 
+ * 
+ * maxInt INTEGER ::= 2147483647 -- (2^^31 - 1) --
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class AbandonRequestImpl extends AbstractRequest implements AbandonRequest
+{
+    /** The abandoned message ID */
+    private int abandonedMessageId;
+    
+    
+    /**
+     * Get the abandoned message ID
+     * 
+     * @return Returns the abandoned MessageId.
+     */
+    public int getAbandonedMessageId()
+    {
+        return abandonedMessageId;
+    }
+
+
+    /**
+     * Set the abandoned message ID
+     * 
+     * @param abandonedMessageId The abandoned messageID to set.
+     */
+    public void setAbandonedMessageId( int abandonedMessageId )
+    {
+        this.abandonedMessageId = abandonedMessageId;
+    }
+}

Added: directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbstractRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbstractRequest.java?rev=760700&view=auto
==============================================================================
--- directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbstractRequest.java
(added)
+++ directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbstractRequest.java
Tue Mar 31 22:35:53 2009
@@ -0,0 +1,121 @@
+/*
+ *  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.client.api.messages;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.naming.ldap.Control;
+
+import org.apache.directory.shared.ldap.message.MessageException;
+
+/**
+ * An abstract class containing the Controls and timeout for all the requests.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class AbstractRequest implements Message
+{
+    /** The set of controls */
+    private Map<String, Control> controls;
+    
+    /** The client request timeout */
+    private long timeout = 0;
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void add( Control control ) throws MessageException
+    {
+        if ( controls == null )
+        {
+            controls = new HashMap<String, Control>();
+        }
+        
+        controls.put( control.getID(), control );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addAll( Control[] controls ) throws MessageException
+    {
+        if ( controls == null )
+        {
+            this.controls = new HashMap<String, Control>();
+        }
+        
+        for ( Control control:controls )
+        {
+            this.controls.put( control.getID(), control );
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Map<String, Control> getControls()
+    {
+        return controls;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public long getTimeout()
+    {
+        return timeout;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean hasControl( String oid )
+    {
+        return ( controls != null ) && ( controls.size() > 0 );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void remove( Control control ) throws MessageException
+    {
+        if ( controls != null )
+        {
+            controls.remove( control.getID() );
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setTimeout( long timeout )
+    {
+        this.timeout = timeout;
+    }
+}

Modified: directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/BindRequestImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/BindRequestImpl.java?rev=760700&r1=760699&r2=760700&view=diff
==============================================================================
--- directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/BindRequestImpl.java
(original)
+++ directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/BindRequestImpl.java
Tue Mar 31 22:35:53 2009
@@ -19,12 +19,6 @@
  */
 package org.apache.directory.shared.ldap.client.api.messages;
 
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.naming.ldap.Control;
-
-import org.apache.directory.shared.ldap.message.MessageException;
 
 /**
  * A client implementation of the client BindRequest LDAP message.
@@ -32,7 +26,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class BindRequestImpl implements BindRequest
+public class BindRequestImpl extends AbstractRequest implements BindRequest
 {
     /**
      * Distinguished name identifying the name of the authenticating subject -
@@ -51,12 +45,6 @@
 
     /** Returns the protocol version */
     private int version = 3;
-    
-    /** The set of controls */
-    private Map<String, Control> controls;
-    
-    /** The client request timeout */
-    private long timeout = 0;
 
 
     /**
@@ -164,83 +152,4 @@
     {
         this.version = version;
     }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void add( Control control ) throws MessageException
-    {
-        if ( controls == null )
-        {
-            controls = new HashMap<String, Control>();
-        }
-        
-        controls.put( control.getID(), control );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void addAll( Control[] controls ) throws MessageException
-    {
-        if ( controls == null )
-        {
-            this.controls = new HashMap<String, Control>();
-        }
-        
-        for ( Control control:controls )
-        {
-            this.controls.put( control.getID(), control );
-        }
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public Map<String, Control> getControls()
-    {
-        return controls;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public long getTimeout()
-    {
-        return timeout;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public boolean hasControl( String oid )
-    {
-        return ( controls != null ) && ( controls.size() > 0 );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void remove( Control control ) throws MessageException
-    {
-        if ( controls != null )
-        {
-            controls.remove( control.getID() );
-        }
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void setTimeout( long timeout )
-    {
-        this.timeout = timeout;
-    }
 }



Mime
View raw message