Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 98443 invoked from network); 31 Mar 2009 22:36:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Mar 2009 22:36:17 -0000 Received: (qmail 54431 invoked by uid 500); 31 Mar 2009 22:36:17 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 54374 invoked by uid 500); 31 Mar 2009 22:36:17 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 54365 invoked by uid 99); 31 Mar 2009 22:36:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Mar 2009 22:36:17 +0000 X-ASF-Spam-Status: No, hits=-1998.8 required=10.0 tests=ALL_TRUSTED,FS_REPLICA X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Mar 2009 22:36:15 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id AC24723889BA; Tue, 31 Mar 2009 22:35:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090331223553.AC24723889BA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 Apache Directory Project + */ +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 Apache Directory Project + */ +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 Apache Directory Project + * @version $Rev$, $Date$ + */ +public class AbstractRequest implements Message +{ + /** The set of controls */ + private Map controls; + + /** The client request timeout */ + private long timeout = 0; + + + /** + * {@inheritDoc} + */ + public void add( Control control ) throws MessageException + { + if ( controls == null ) + { + controls = new HashMap(); + } + + controls.put( control.getID(), control ); + } + + + /** + * {@inheritDoc} + */ + public void addAll( Control[] controls ) throws MessageException + { + if ( controls == null ) + { + this.controls = new HashMap(); + } + + for ( Control control:controls ) + { + this.controls.put( control.getID(), control ); + } + } + + + /** + * {@inheritDoc} + */ + public Map 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 Apache Directory Project * @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 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(); - } - - controls.put( control.getID(), control ); - } - - - /** - * {@inheritDoc} - */ - public void addAll( Control[] controls ) throws MessageException - { - if ( controls == null ) - { - this.controls = new HashMap(); - } - - for ( Control control:controls ) - { - this.controls.put( control.getID(), control ); - } - } - - - /** - * {@inheritDoc} - */ - public Map 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; - } }