directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r377135 [26/36] - in /directory/sandbox/akarasulu/rc1: apacheds/core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/ apacheds/core-plugin/src/test/java/org/apache/directory/server/core/tools/schema/ apacheds/core-shared/...
Date Sun, 12 Feb 2006 05:51:22 GMT
Modified: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AbstractRequest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AbstractRequest.java?rev=377135&r1=377134&r2=377135&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AbstractRequest.java (original)
+++ directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AbstractRequest.java Sat Feb 11 21:50:03 2006
@@ -1,62 +1,62 @@
-/*
- *   Copyright 2004 The Apache Software Foundation
- *
- *   Licensed 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;
-
-
-/**
- * The base request message class.
- * 
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- * @version $Rev$
- */
-public class AbstractRequest extends AbstractMessage implements Request
-{
-    static final long serialVersionUID = -4511116249089399040L;
-
-    /** Flag indicating whether or not this request returns a response. */
-    private final boolean hasResponse;
-
-
-    /**
-     * Subclasses must provide these parameters via a super constructor call.
-     * 
-     * @param id
-     *            the sequential message identifier
-     * @param type
-     *            the request type enum
-     * @param hasResponse
-     *            flag indicating if this request generates a response
-     */
-    protected AbstractRequest(final int id, final MessageTypeEnum type, boolean hasResponse)
-    {
-        super( id, type );
-
-        this.hasResponse = hasResponse;
-    }
-
-
-    /**
-     * Indicator flag used to determine whether or not this type of request
-     * produces a reply.
-     * 
-     * @return true if any reply is generated, false if no response is generated
-     */
-    public boolean hasResponse()
-    {
-        return hasResponse;
-    }
-}
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed 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;
+
+
+/**
+ * The base request message class.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class AbstractRequest extends AbstractMessage implements Request
+{
+    static final long serialVersionUID = -4511116249089399040L;
+
+    /** Flag indicating whether or not this request returns a response. */
+    private final boolean hasResponse;
+
+
+    /**
+     * Subclasses must provide these parameters via a super constructor call.
+     * 
+     * @param id
+     *            the sequential message identifier
+     * @param type
+     *            the request type enum
+     * @param hasResponse
+     *            flag indicating if this request generates a response
+     */
+    protected AbstractRequest(final int id, final MessageTypeEnum type, boolean hasResponse)
+    {
+        super( id, type );
+
+        this.hasResponse = hasResponse;
+    }
+
+
+    /**
+     * Indicator flag used to determine whether or not this type of request
+     * produces a reply.
+     * 
+     * @return true if any reply is generated, false if no response is generated
+     */
+    public boolean hasResponse()
+    {
+        return hasResponse;
+    }
+}

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AbstractRequest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AbstractRequest.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sat Feb 11 21:50:03 2006
@@ -1 +1,4 @@
 Rev
+Revision
+Date
+Id

Modified: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AbstractResponse.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AbstractResponse.java?rev=377135&r1=377134&r2=377135&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AbstractResponse.java (original)
+++ directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AbstractResponse.java Sat Feb 11 21:50:03 2006
@@ -1,45 +1,45 @@
-/*
- *   Copyright 2004 The Apache Software Foundation
- *
- *   Licensed 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;
-
-
-/**
- * Abstract base for a Lockable Response message.
- * 
- * @author <a href="mailto:dev@directory.apache.org"> Apache Directory Project</a>
- * @version $Rev$
- */
-public abstract class AbstractResponse extends AbstractMessage implements Response
-{
-    // ------------------------------------------------------------------------
-    // Response Interface Method Implementations
-    // ------------------------------------------------------------------------
-
-    /**
-     * Allows subclasses based on the abstract type to create a response to a
-     * request.
-     * 
-     * @param id
-     *            the response eliciting this Request
-     * @param type
-     *            the message type of the response
-     */
-    protected AbstractResponse(final int id, final MessageTypeEnum type)
-    {
-        super( id, type );
-    }
-}
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed 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;
+
+
+/**
+ * Abstract base for a Lockable Response message.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org"> Apache Directory Project</a>
+ * @version $Rev$
+ */
+public abstract class AbstractResponse extends AbstractMessage implements Response
+{
+    // ------------------------------------------------------------------------
+    // Response Interface Method Implementations
+    // ------------------------------------------------------------------------
+
+    /**
+     * Allows subclasses based on the abstract type to create a response to a
+     * request.
+     * 
+     * @param id
+     *            the response eliciting this Request
+     * @param type
+     *            the message type of the response
+     */
+    protected AbstractResponse(final int id, final MessageTypeEnum type)
+    {
+        super( id, type );
+    }
+}

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AbstractResponse.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AbstractResponse.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sat Feb 11 21:50:03 2006
@@ -1 +1,4 @@
 Rev
+Revision
+Date
+Id

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AbstractResultResponse.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AbstractResultResponse.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sat Feb 11 21:50:03 2006
@@ -1 +1,4 @@
 Rev
+Revision
+Date
+Id

Modified: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddRequest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddRequest.java?rev=377135&r1=377134&r2=377135&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddRequest.java (original)
+++ directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddRequest.java Sat Feb 11 21:50:03 2006
@@ -16,7 +16,7 @@
  */
 
 /*
- * $Id: AddRequest.java,v 1.7 2003/07/31 21:44:48 akarasulu Exp $
+ * $Id$
  *
  * -- (c) LDAPd Group                                                    --
  * -- Please refer to the LICENSE.txt file in the root directory of      --

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddRequest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddRequest.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sat Feb 11 21:50:03 2006
@@ -1 +1,4 @@
 Rev
+Revision
+Date
+Id

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddRequestImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddRequestImpl.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sat Feb 11 21:50:03 2006
@@ -1 +1,4 @@
 Rev
+Revision
+Date
+Id

Modified: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddResponse.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddResponse.java?rev=377135&r1=377134&r2=377135&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddResponse.java (original)
+++ directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddResponse.java Sat Feb 11 21:50:03 2006
@@ -1,42 +1,42 @@
-/*
- *   Copyright 2004 The Apache Software Foundation
- *
- *   Licensed 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.
- *
- */
-
-/*
- * $Id: AddResponse.java,v 1.2 2003/05/02 00:49:06 akarasulu Exp $
- *
- * -- (c) LDAPd Group                                                    --
- * -- Please refer to the LICENSE.txt file in the root directory of      --
- * -- any LDAPd project for copyright and distribution information.      --
- *
- */
-
-package org.apache.directory.shared.ldap.message;
-
-
-/**
- * Add protocol response message used to confirm the results of a add request
- * message.
- * 
- * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
- * @author $Author: akarasulu $
- * @version $Revision$
- */
-public interface AddResponse extends ResultResponse
-{
-    /** Add response message type enumeration value */
-    MessageTypeEnum TYPE = MessageTypeEnum.ADDRESPONSE;
-}
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed 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.
+ *
+ */
+
+/*
+ * $Id$
+ *
+ * -- (c) LDAPd Group                                                    --
+ * -- Please refer to the LICENSE.txt file in the root directory of      --
+ * -- any LDAPd project for copyright and distribution information.      --
+ *
+ */
+
+package org.apache.directory.shared.ldap.message;
+
+
+/**
+ * Add protocol response message used to confirm the results of a add request
+ * message.
+ * 
+ * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
+ * @author $Author: akarasulu $
+ * @version $Revision$
+ */
+public interface AddResponse extends ResultResponse
+{
+    /** Add response message type enumeration value */
+    MessageTypeEnum TYPE = MessageTypeEnum.ADDRESPONSE;
+}

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddResponse.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddResponse.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sat Feb 11 21:50:03 2006
@@ -1 +1,4 @@
 Rev
+Revision
+Date
+Id

Modified: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddResponseImpl.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddResponseImpl.java?rev=377135&r1=377134&r2=377135&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddResponseImpl.java (original)
+++ directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddResponseImpl.java Sat Feb 11 21:50:03 2006
@@ -1,62 +1,62 @@
-/*
- *   Copyright 2004 The Apache Software Foundation
- *
- *   Licensed 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;
-
-
-/**
- * Lockable AddResponse implementation.
- * 
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- * @version $Rev$
- */
-public class AddResponseImpl extends AbstractResultResponse implements AddResponse
-{
-    // ------------------------------------------------------------------------
-    // Constructors
-    // ------------------------------------------------------------------------
-
-    static final long serialVersionUID = 4027132942339551383L;
-
-
-    /**
-     * Creates a Lockable AddResponse as a reply to an AddRequest.
-     * 
-     * @param id
-     *            the session unique message id
-     */
-    public AddResponseImpl(final int id)
-    {
-        super( id, TYPE );
-    }
-
-
-    /**
-     * Get a String representation of an AddResponse
-     * 
-     * @return An AddResponse String
-     */
-    public String toString()
-    {
-
-        StringBuffer sb = new StringBuffer();
-
-        sb.append( "    Add Response\n" );
-        sb.append( super.toString() );
-
-        return sb.toString();
-    }
-}
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed 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;
+
+
+/**
+ * Lockable AddResponse implementation.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class AddResponseImpl extends AbstractResultResponse implements AddResponse
+{
+    // ------------------------------------------------------------------------
+    // Constructors
+    // ------------------------------------------------------------------------
+
+    static final long serialVersionUID = 4027132942339551383L;
+
+
+    /**
+     * Creates a Lockable AddResponse as a reply to an AddRequest.
+     * 
+     * @param id
+     *            the session unique message id
+     */
+    public AddResponseImpl(final int id)
+    {
+        super( id, TYPE );
+    }
+
+
+    /**
+     * Get a String representation of an AddResponse
+     * 
+     * @return An AddResponse String
+     */
+    public String toString()
+    {
+
+        StringBuffer sb = new StringBuffer();
+
+        sb.append( "    Add Response\n" );
+        sb.append( super.toString() );
+
+        return sb.toString();
+    }
+}

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddResponseImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddResponseImpl.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sat Feb 11 21:50:03 2006
@@ -1 +1,4 @@
 Rev
+Revision
+Date
+Id

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ArrayNamingEnumeration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ArrayNamingEnumeration.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sat Feb 11 21:50:03 2006
@@ -1 +1,4 @@
 Rev
+Revision
+Date
+Id

Modified: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequest.java?rev=377135&r1=377134&r2=377135&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequest.java (original)
+++ directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequest.java Sat Feb 11 21:50:03 2006
@@ -1,170 +1,170 @@
-/*
- *   Copyright 2004 The Apache Software Foundation
- *
- *   Licensed 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;
-
-
-/**
- * Bind protocol operation request which authenticates and begins a client
- * session. Does not yet contain interfaces for SASL authentication mechanisms.
- * 
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- * @version $Rev$
- */
-public interface BindRequest extends SingleReplyRequest
-{
-    /** Bind request message type enumeration value */
-    MessageTypeEnum TYPE = MessageTypeEnum.BINDREQUEST;
-
-    /** Bind response message type enumeration value */
-    MessageTypeEnum RESP_TYPE = BindResponse.TYPE;
-
-
-    /**
-     * Checks to see if the authentication mechanism is simple and not SASL
-     * based.
-     * 
-     * @return true if the mechanism is simple false if it is SASL based.
-     */
-    boolean isSimple();
-
-
-    /**
-     * Checks to see if the authentication mechanism is simple and not SASL
-     * based.
-     * 
-     * @return true if the mechanism is simple false if it is SASL based.
-     */
-    boolean getSimple();
-
-
-    /**
-     * Sets the authentication mechanism to simple or to SASL based
-     * authentication.
-     * 
-     * @param isSimple
-     *            true if authentication is simple, false otherwise.
-     */
-    void setSimple( boolean isSimple );
-
-
-    /**
-     * Gets the simple credentials associated with a simple authentication
-     * attempt or null if this request uses SASL authentication mechanisms.
-     * 
-     * @return null if the mechanism is SASL or the credentials if it is simple.
-     */
-    byte[] getCredentials();
-
-
-    /**
-     * Sets the simple credentials associated with a simple authentication
-     * attempt ignored if this request uses SASL authentication mechanisms.
-     * 
-     * @param credentials
-     *            the credentials if authentication is simple, null otherwise
-     */
-    void setCredentials( byte[] credentials );
-
-
-    /**
-     * Gets the distinguished name of the subject in this authentication
-     * request. This field may take on a null value (a zero length string) for
-     * the purposes of anonymous binds, when authentication has been performed
-     * at a lower layer, or when using SASL credentials with a mechanism that
-     * includes the LDAPDN in the credentials.
-     * 
-     * @return the DN of the authenticating user.
-     */
-    String getName();
-
-
-    /**
-     * Sets the distinguished name of the subject in this authentication
-     * request. This field may take on a null value (or a zero length string)
-     * for the purposes of anonymous binds, when authentication has been
-     * performed at a lower layer, or when using SASL credentials with a
-     * mechanism that includes the LDAPDN in the credentials.
-     * 
-     * @param name
-     *            the DN of the authenticating user - leave null for annonymous
-     *            user.
-     */
-    void setName( String name );
-
-
-    /**
-     * Checks to see if the Ldap v3 protocol is used. Normally this would
-     * extract a version number from the bind request sent by the client
-     * indicating the version of the protocol to be used in this protocol
-     * session. The integer is either a 2 or a 3 at the moment. We thought it
-     * was better to just check if the protocol used is 3 or not rather than use
-     * an type-safe enumeration type for a binary value. If an LDAPv4 comes out
-     * then we shall convert the return type to a type safe enumeration.
-     * 
-     * @return true if client using version 3 false if it is version 2.
-     */
-    boolean isVersion3();
-
-
-    /**
-     * Gets whether or not the Ldap v3 protocol is used. Normally this would
-     * extract a version number from the bind request sent by the client
-     * indicating the version of the protocol to be used in this protocol
-     * session. The integer is either a 2 or a 3 at the moment. We thought it
-     * was better to just check if the protocol used is 3 or not rather than use
-     * an type-safe enumeration type for a binary value. If an LDAPv4 comes out
-     * then we shall convert the return type to a type safe enumeration.
-     * 
-     * @return true if client using version 3 false if it is version 2.
-     */
-    boolean getVersion3();
-
-
-    /**
-     * Sets whether or not the LDAP v3 or v2 protocol is used. Normally this
-     * would extract a version number from the bind request sent by the client
-     * indicating the version of the protocol to be used in this protocol
-     * session. The integer is either a 2 or a 3 at the moment. We thought it
-     * was better to just check if the protocol used is 3 or not rather than use
-     * an type-safe enumeration type for a binary value. If an LDAPv4 comes out
-     * then we shall convert the return type to a type safe enumeration.
-     * 
-     * @param isVersion3
-     *            if true the client will be exhibiting version 3 bind behavoir,
-     *            if false is used version 2 behavoir will be exhibited.
-     */
-    void setVersion3( boolean isVersion3 );
-
-
-    /**
-     * Gets the SASL mechanism String associated with this BindRequest if the
-     * bind operation is using SASL.
-     * 
-     * @return the SASL mechanism or null if the bind op is simple
-     */
-    String getSaslMechanism();
-
-
-    /**
-     * Sets the SASL mechanism String associated with this BindRequest if the
-     * bind operation is using SASL.
-     * 
-     * @param saslMechanism
-     *            the SASL mechanism
-     */
-    void setSaslMechanism( String saslMechanism );
-}
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed 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;
+
+
+/**
+ * Bind protocol operation request which authenticates and begins a client
+ * session. Does not yet contain interfaces for SASL authentication mechanisms.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public interface BindRequest extends SingleReplyRequest
+{
+    /** Bind request message type enumeration value */
+    MessageTypeEnum TYPE = MessageTypeEnum.BINDREQUEST;
+
+    /** Bind response message type enumeration value */
+    MessageTypeEnum RESP_TYPE = BindResponse.TYPE;
+
+
+    /**
+     * Checks to see if the authentication mechanism is simple and not SASL
+     * based.
+     * 
+     * @return true if the mechanism is simple false if it is SASL based.
+     */
+    boolean isSimple();
+
+
+    /**
+     * Checks to see if the authentication mechanism is simple and not SASL
+     * based.
+     * 
+     * @return true if the mechanism is simple false if it is SASL based.
+     */
+    boolean getSimple();
+
+
+    /**
+     * Sets the authentication mechanism to simple or to SASL based
+     * authentication.
+     * 
+     * @param isSimple
+     *            true if authentication is simple, false otherwise.
+     */
+    void setSimple( boolean isSimple );
+
+
+    /**
+     * Gets the simple credentials associated with a simple authentication
+     * attempt or null if this request uses SASL authentication mechanisms.
+     * 
+     * @return null if the mechanism is SASL or the credentials if it is simple.
+     */
+    byte[] getCredentials();
+
+
+    /**
+     * Sets the simple credentials associated with a simple authentication
+     * attempt ignored if this request uses SASL authentication mechanisms.
+     * 
+     * @param credentials
+     *            the credentials if authentication is simple, null otherwise
+     */
+    void setCredentials( byte[] credentials );
+
+
+    /**
+     * Gets the distinguished name of the subject in this authentication
+     * request. This field may take on a null value (a zero length string) for
+     * the purposes of anonymous binds, when authentication has been performed
+     * at a lower layer, or when using SASL credentials with a mechanism that
+     * includes the LDAPDN in the credentials.
+     * 
+     * @return the DN of the authenticating user.
+     */
+    String getName();
+
+
+    /**
+     * Sets the distinguished name of the subject in this authentication
+     * request. This field may take on a null value (or a zero length string)
+     * for the purposes of anonymous binds, when authentication has been
+     * performed at a lower layer, or when using SASL credentials with a
+     * mechanism that includes the LDAPDN in the credentials.
+     * 
+     * @param name
+     *            the DN of the authenticating user - leave null for annonymous
+     *            user.
+     */
+    void setName( String name );
+
+
+    /**
+     * Checks to see if the Ldap v3 protocol is used. Normally this would
+     * extract a version number from the bind request sent by the client
+     * indicating the version of the protocol to be used in this protocol
+     * session. The integer is either a 2 or a 3 at the moment. We thought it
+     * was better to just check if the protocol used is 3 or not rather than use
+     * an type-safe enumeration type for a binary value. If an LDAPv4 comes out
+     * then we shall convert the return type to a type safe enumeration.
+     * 
+     * @return true if client using version 3 false if it is version 2.
+     */
+    boolean isVersion3();
+
+
+    /**
+     * Gets whether or not the Ldap v3 protocol is used. Normally this would
+     * extract a version number from the bind request sent by the client
+     * indicating the version of the protocol to be used in this protocol
+     * session. The integer is either a 2 or a 3 at the moment. We thought it
+     * was better to just check if the protocol used is 3 or not rather than use
+     * an type-safe enumeration type for a binary value. If an LDAPv4 comes out
+     * then we shall convert the return type to a type safe enumeration.
+     * 
+     * @return true if client using version 3 false if it is version 2.
+     */
+    boolean getVersion3();
+
+
+    /**
+     * Sets whether or not the LDAP v3 or v2 protocol is used. Normally this
+     * would extract a version number from the bind request sent by the client
+     * indicating the version of the protocol to be used in this protocol
+     * session. The integer is either a 2 or a 3 at the moment. We thought it
+     * was better to just check if the protocol used is 3 or not rather than use
+     * an type-safe enumeration type for a binary value. If an LDAPv4 comes out
+     * then we shall convert the return type to a type safe enumeration.
+     * 
+     * @param isVersion3
+     *            if true the client will be exhibiting version 3 bind behavoir,
+     *            if false is used version 2 behavoir will be exhibited.
+     */
+    void setVersion3( boolean isVersion3 );
+
+
+    /**
+     * Gets the SASL mechanism String associated with this BindRequest if the
+     * bind operation is using SASL.
+     * 
+     * @return the SASL mechanism or null if the bind op is simple
+     */
+    String getSaslMechanism();
+
+
+    /**
+     * Sets the SASL mechanism String associated with this BindRequest if the
+     * bind operation is using SASL.
+     * 
+     * @param saslMechanism
+     *            the SASL mechanism
+     */
+    void setSaslMechanism( String saslMechanism );
+}

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequest.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sat Feb 11 21:50:03 2006
@@ -1 +1,4 @@
 Rev
+Revision
+Date
+Id

Modified: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequestImpl.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequestImpl.java?rev=377135&r1=377134&r2=377135&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequestImpl.java (original)
+++ directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequestImpl.java Sat Feb 11 21:50:03 2006
@@ -1,363 +1,363 @@
-/*
- *   Copyright 2004 The Apache Software Foundation
- *
- *   Licensed 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;
-
-
-import org.apache.directory.shared.ldap.util.ArrayUtils;
-import org.apache.directory.shared.ldap.util.StringTools;
-
-
-/**
- * Bind protocol operation request which authenticates and begins a client
- * session. Does not yet contain interfaces for SASL authentication mechanisms.
- * 
- * @author <a href="mailto:dev@directory.apache.org"> Apache Directory Project</a>
- * @version $Rev$
- */
-public class BindRequestImpl extends AbstractRequest implements BindRequest
-{
-    static final long serialVersionUID = 7945504184130380071L;
-
-    /**
-     * Distinguished name identifying the name of the authenticating subject -
-     * defaults to the empty string
-     */
-    private String name = "";
-
-    /** The passwords, keys or tickets used to verify user identity */
-    private byte[] credentials;
-
-    /** The mechanism used to decode user identity */
-    private String mechanism;
-
-    /** Simple vs. SASL authentication mode flag */
-    private boolean isSimple = true;
-
-    /** Bind behavoir exhibity by protocol version */
-    private boolean isVersion3 = true;
-
-    public BindResponse response;
-
-
-    // ------------------------------------------------------------------------
-    // Constructors
-    // ------------------------------------------------------------------------
-
-    /**
-     * Creates an BindRequest implementation to bind to an LDAP server.
-     * 
-     * @param id
-     *            the sequence identifier of the BindRequest message.
-     */
-    public BindRequestImpl(final int id)
-    {
-        super( id, TYPE, true );
-    }
-
-
-    // -----------------------------------------------------------------------
-    // BindRequest Interface Method Implementations
-    // -----------------------------------------------------------------------
-
-    /**
-     * Checks to see if the authentication mechanism is simple and not SASL
-     * based.
-     * 
-     * @return true if the mechanism is simple false if it is SASL based.
-     */
-    public boolean isSimple()
-    {
-        return isSimple;
-    }
-
-
-    /**
-     * Checks to see if the authentication mechanism is simple and not SASL
-     * based.
-     * 
-     * @return true if the mechanism is simple false if it is SASL based.
-     */
-    public boolean getSimple()
-    {
-        return isSimple;
-    }
-
-
-    /**
-     * Sets the authentication mechanism to simple or to SASL based
-     * authentication.
-     * 
-     * @param isSimple
-     *            true if authentication is simple, false otherwise.
-     */
-    public void setSimple( boolean isSimple )
-    {
-        this.isSimple = isSimple;
-    }
-
-
-    /**
-     * Gets the simple credentials associated with a simple authentication
-     * attempt or null if this request uses SASL authentication mechanisms.
-     * 
-     * @return null if the mechanism is SASL or the credentials if it is simple.
-     */
-    public byte[] getCredentials()
-    {
-        return credentials;
-    }
-
-
-    /**
-     * Sets the simple credentials associated with a simple authentication
-     * attempt ignored if this request uses SASL authentication mechanisms.
-     * 
-     * @param credentials
-     *            the credentials if authentication is simple, null otherwise
-     */
-    public void setCredentials( byte[] credentials )
-    {
-        this.credentials = credentials;
-    }
-
-
-    /**
-     * Gets the mechanism if this request uses SASL authentication mechanisms.
-     * 
-     * @return The mechanism if SASL.
-     */
-    public String getSaslMechanism()
-    {
-        return mechanism;
-    }
-
-
-    /**
-     * Sets the mechanism associated with a SASL authentication
-     * 
-     * @param mechanism
-     *            the mechanism otherwise
-     */
-    public void setSaslMechanism( String mechanism )
-    {
-        this.mechanism = mechanism;
-    }
-
-
-    /**
-     * Gets the distinguished name of the subject in this authentication
-     * request. This field may take on a null value (a zero length string) for
-     * the purposes of anonymous binds, when authentication has been performed
-     * at a lower layer, or when using SASL credentials with a mechanism that
-     * includes the LDAPDN in the credentials.
-     * 
-     * @return the DN of the authenticating user.
-     */
-    public String getName()
-    {
-        return name;
-    }
-
-
-    /**
-     * Sets the distinguished name of the subject in this authentication
-     * request. This field may take on a null value (or a zero length string)
-     * for the purposes of anonymous binds, when authentication has been
-     * performed at a lower layer, or when using SASL credentials with a
-     * mechanism that includes the LDAPDN in the credentials.
-     * 
-     * @param name
-     *            the DN of the authenticating user - leave null for annonymous
-     *            user.
-     */
-    public void setName( String name )
-    {
-        this.name = name;
-    }
-
-
-    /**
-     * Checks to see if the Ldap v3 protocol is used. Normally this would
-     * extract a version number from the bind request sent by the client
-     * indicating the version of the protocol to be used in this protocol
-     * session. The integer is either a 2 or a 3 at the moment. We thought it
-     * was better to just check if the protocol used is 3 or not rather than use
-     * an type-safe enumeration type for a binary value. If an LDAPv4 comes out
-     * then we shall convert the return type to a type safe enumeration.
-     * 
-     * @return true if client using version 3 false if it is version 2.
-     */
-    public boolean isVersion3()
-    {
-        return isVersion3;
-    }
-
-
-    /**
-     * Gets whether or not the Ldap v3 protocol is used. Normally this would
-     * extract a version number from the bind request sent by the client
-     * indicating the version of the protocol to be used in this protocol
-     * session. The integer is either a 2 or a 3 at the moment. We thought it
-     * was better to just check if the protocol used is 3 or not rather than use
-     * an type-safe enumeration type for a binary value. If an LDAPv4 comes out
-     * then we shall convert the return type to a type safe enumeration.
-     * 
-     * @return true if client using version 3 false if it is version 2.
-     */
-    public boolean getVersion3()
-    {
-        return isVersion3;
-    }
-
-
-    /**
-     * Sets whether or not the LDAP v3 or v2 protocol is used. Normally this
-     * would extract a version number from the bind request sent by the client
-     * indicating the version of the protocol to be used in this protocol
-     * session. The integer is either a 2 or a 3 at the moment. We thought it
-     * was better to just check if the protocol used is 3 or not rather than use
-     * an type-safe enumeration type for a binary value. If an LDAPv4 comes out
-     * then we shall convert the return type to a type safe enumeration.
-     * 
-     * @param isVersion3
-     *            if true the client will be exhibiting version 3 bind behavoir,
-     *            if false is used version 2 behavoir will be exhibited.
-     */
-    public void setVersion3( boolean isVersion3 )
-    {
-        this.isVersion3 = isVersion3;
-    }
-
-
-    // -----------------------------------------------------------------------
-    // BindRequest Interface Method Implementations
-    // -----------------------------------------------------------------------
-
-    /**
-     * Gets the protocol response message type for this request which produces
-     * at least one response.
-     * 
-     * @return the message type of the response.
-     */
-    public MessageTypeEnum getResponseType()
-    {
-        return RESP_TYPE;
-    }
-
-
-    /**
-     * The result containing response for this request.
-     * 
-     * @return the result containing response for this request
-     */
-    public ResultResponse getResultResponse()
-    {
-        if ( response == null )
-        {
-            response = new BindResponseImpl( getMessageId() );
-        }
-
-        return response;
-    }
-
-
-    public boolean equals( Object obj )
-    {
-        if ( obj == this )
-        {
-            return true;
-        }
-
-        if ( !super.equals( obj ) )
-        {
-            return false;
-        }
-
-        BindRequest req = ( BindRequest ) obj;
-
-        if ( req.isSimple() != isSimple() )
-        {
-            return false;
-        }
-
-        if ( req.isVersion3() != isVersion3() )
-        {
-            return false;
-        }
-
-        if ( !req.getName().equals( getName() ) )
-        {
-            return false;
-        }
-
-        if ( !ArrayUtils.isEquals( req.getCredentials(), getCredentials() ) )
-        {
-            return false;
-        }
-
-        return true;
-    }
-
-
-    /**
-     * Get a String representation of a BindRequest
-     * 
-     * @return A BindRequest String
-     */
-    public String toString()
-    {
-        StringBuffer sb = new StringBuffer();
-        sb.append( "    BindRequest\n" );
-        sb.append( "        Version : '" ).append( isVersion3 ? "3" : "2" ).append( "'\n" );
-
-        if ( StringTools.isEmpty( name.toString() ) )
-        {
-            sb.append( "        Name : anonymous\n" );
-        }
-        else
-        {
-            sb.append( "        Name : '" ).append( name.toString() ).append( "'\n" );
-
-            if ( isSimple )
-            {
-                sb.append( "        Simple authentication : '" ).append( StringTools.utf8ToString( credentials ) )
-                    .append( '/' ).append( StringTools.dumpBytes( credentials ) ).append( "'\n" );
-            }
-            else
-            {
-                sb.append( "        Sasl credentials\n" );
-                sb.append( "            Mechanism :'" ).append( mechanism ).append( "'\n" );
-
-                sb.append( "            Credentials : '" ).append( StringTools.utf8ToString( credentials ) ).append(
-                    '/' ).append( StringTools.dumpBytes( credentials ) ).append( "'\n" );
-            }
-        }
-
-        return sb.toString();
-    }
-
-
-    /**
-     * RFC 2251 [Section 4.11]: Abandon, Bind, Unbind, and StartTLS operations
-     * cannot be abandoned.
-     */
-    public void abandon()
-    {
-        throw new UnsupportedOperationException(
-            "RFC 2251 [Section 4.11]: Abandon, Bind, Unbind, and StartTLS operations cannot be abandoned. " );
-    }
-}
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed 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;
+
+
+import org.apache.directory.shared.ldap.util.ArrayUtils;
+import org.apache.directory.shared.ldap.util.StringTools;
+
+
+/**
+ * Bind protocol operation request which authenticates and begins a client
+ * session. Does not yet contain interfaces for SASL authentication mechanisms.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org"> Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class BindRequestImpl extends AbstractRequest implements BindRequest
+{
+    static final long serialVersionUID = 7945504184130380071L;
+
+    /**
+     * Distinguished name identifying the name of the authenticating subject -
+     * defaults to the empty string
+     */
+    private String name = "";
+
+    /** The passwords, keys or tickets used to verify user identity */
+    private byte[] credentials;
+
+    /** The mechanism used to decode user identity */
+    private String mechanism;
+
+    /** Simple vs. SASL authentication mode flag */
+    private boolean isSimple = true;
+
+    /** Bind behavoir exhibity by protocol version */
+    private boolean isVersion3 = true;
+
+    public BindResponse response;
+
+
+    // ------------------------------------------------------------------------
+    // Constructors
+    // ------------------------------------------------------------------------
+
+    /**
+     * Creates an BindRequest implementation to bind to an LDAP server.
+     * 
+     * @param id
+     *            the sequence identifier of the BindRequest message.
+     */
+    public BindRequestImpl(final int id)
+    {
+        super( id, TYPE, true );
+    }
+
+
+    // -----------------------------------------------------------------------
+    // BindRequest Interface Method Implementations
+    // -----------------------------------------------------------------------
+
+    /**
+     * Checks to see if the authentication mechanism is simple and not SASL
+     * based.
+     * 
+     * @return true if the mechanism is simple false if it is SASL based.
+     */
+    public boolean isSimple()
+    {
+        return isSimple;
+    }
+
+
+    /**
+     * Checks to see if the authentication mechanism is simple and not SASL
+     * based.
+     * 
+     * @return true if the mechanism is simple false if it is SASL based.
+     */
+    public boolean getSimple()
+    {
+        return isSimple;
+    }
+
+
+    /**
+     * Sets the authentication mechanism to simple or to SASL based
+     * authentication.
+     * 
+     * @param isSimple
+     *            true if authentication is simple, false otherwise.
+     */
+    public void setSimple( boolean isSimple )
+    {
+        this.isSimple = isSimple;
+    }
+
+
+    /**
+     * Gets the simple credentials associated with a simple authentication
+     * attempt or null if this request uses SASL authentication mechanisms.
+     * 
+     * @return null if the mechanism is SASL or the credentials if it is simple.
+     */
+    public byte[] getCredentials()
+    {
+        return credentials;
+    }
+
+
+    /**
+     * Sets the simple credentials associated with a simple authentication
+     * attempt ignored if this request uses SASL authentication mechanisms.
+     * 
+     * @param credentials
+     *            the credentials if authentication is simple, null otherwise
+     */
+    public void setCredentials( byte[] credentials )
+    {
+        this.credentials = credentials;
+    }
+
+
+    /**
+     * Gets the mechanism if this request uses SASL authentication mechanisms.
+     * 
+     * @return The mechanism if SASL.
+     */
+    public String getSaslMechanism()
+    {
+        return mechanism;
+    }
+
+
+    /**
+     * Sets the mechanism associated with a SASL authentication
+     * 
+     * @param mechanism
+     *            the mechanism otherwise
+     */
+    public void setSaslMechanism( String mechanism )
+    {
+        this.mechanism = mechanism;
+    }
+
+
+    /**
+     * Gets the distinguished name of the subject in this authentication
+     * request. This field may take on a null value (a zero length string) for
+     * the purposes of anonymous binds, when authentication has been performed
+     * at a lower layer, or when using SASL credentials with a mechanism that
+     * includes the LDAPDN in the credentials.
+     * 
+     * @return the DN of the authenticating user.
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+
+    /**
+     * Sets the distinguished name of the subject in this authentication
+     * request. This field may take on a null value (or a zero length string)
+     * for the purposes of anonymous binds, when authentication has been
+     * performed at a lower layer, or when using SASL credentials with a
+     * mechanism that includes the LDAPDN in the credentials.
+     * 
+     * @param name
+     *            the DN of the authenticating user - leave null for annonymous
+     *            user.
+     */
+    public void setName( String name )
+    {
+        this.name = name;
+    }
+
+
+    /**
+     * Checks to see if the Ldap v3 protocol is used. Normally this would
+     * extract a version number from the bind request sent by the client
+     * indicating the version of the protocol to be used in this protocol
+     * session. The integer is either a 2 or a 3 at the moment. We thought it
+     * was better to just check if the protocol used is 3 or not rather than use
+     * an type-safe enumeration type for a binary value. If an LDAPv4 comes out
+     * then we shall convert the return type to a type safe enumeration.
+     * 
+     * @return true if client using version 3 false if it is version 2.
+     */
+    public boolean isVersion3()
+    {
+        return isVersion3;
+    }
+
+
+    /**
+     * Gets whether or not the Ldap v3 protocol is used. Normally this would
+     * extract a version number from the bind request sent by the client
+     * indicating the version of the protocol to be used in this protocol
+     * session. The integer is either a 2 or a 3 at the moment. We thought it
+     * was better to just check if the protocol used is 3 or not rather than use
+     * an type-safe enumeration type for a binary value. If an LDAPv4 comes out
+     * then we shall convert the return type to a type safe enumeration.
+     * 
+     * @return true if client using version 3 false if it is version 2.
+     */
+    public boolean getVersion3()
+    {
+        return isVersion3;
+    }
+
+
+    /**
+     * Sets whether or not the LDAP v3 or v2 protocol is used. Normally this
+     * would extract a version number from the bind request sent by the client
+     * indicating the version of the protocol to be used in this protocol
+     * session. The integer is either a 2 or a 3 at the moment. We thought it
+     * was better to just check if the protocol used is 3 or not rather than use
+     * an type-safe enumeration type for a binary value. If an LDAPv4 comes out
+     * then we shall convert the return type to a type safe enumeration.
+     * 
+     * @param isVersion3
+     *            if true the client will be exhibiting version 3 bind behavoir,
+     *            if false is used version 2 behavoir will be exhibited.
+     */
+    public void setVersion3( boolean isVersion3 )
+    {
+        this.isVersion3 = isVersion3;
+    }
+
+
+    // -----------------------------------------------------------------------
+    // BindRequest Interface Method Implementations
+    // -----------------------------------------------------------------------
+
+    /**
+     * Gets the protocol response message type for this request which produces
+     * at least one response.
+     * 
+     * @return the message type of the response.
+     */
+    public MessageTypeEnum getResponseType()
+    {
+        return RESP_TYPE;
+    }
+
+
+    /**
+     * The result containing response for this request.
+     * 
+     * @return the result containing response for this request
+     */
+    public ResultResponse getResultResponse()
+    {
+        if ( response == null )
+        {
+            response = new BindResponseImpl( getMessageId() );
+        }
+
+        return response;
+    }
+
+
+    public boolean equals( Object obj )
+    {
+        if ( obj == this )
+        {
+            return true;
+        }
+
+        if ( !super.equals( obj ) )
+        {
+            return false;
+        }
+
+        BindRequest req = ( BindRequest ) obj;
+
+        if ( req.isSimple() != isSimple() )
+        {
+            return false;
+        }
+
+        if ( req.isVersion3() != isVersion3() )
+        {
+            return false;
+        }
+
+        if ( !req.getName().equals( getName() ) )
+        {
+            return false;
+        }
+
+        if ( !ArrayUtils.isEquals( req.getCredentials(), getCredentials() ) )
+        {
+            return false;
+        }
+
+        return true;
+    }
+
+
+    /**
+     * Get a String representation of a BindRequest
+     * 
+     * @return A BindRequest String
+     */
+    public String toString()
+    {
+        StringBuffer sb = new StringBuffer();
+        sb.append( "    BindRequest\n" );
+        sb.append( "        Version : '" ).append( isVersion3 ? "3" : "2" ).append( "'\n" );
+
+        if ( StringTools.isEmpty( name.toString() ) )
+        {
+            sb.append( "        Name : anonymous\n" );
+        }
+        else
+        {
+            sb.append( "        Name : '" ).append( name.toString() ).append( "'\n" );
+
+            if ( isSimple )
+            {
+                sb.append( "        Simple authentication : '" ).append( StringTools.utf8ToString( credentials ) )
+                    .append( '/' ).append( StringTools.dumpBytes( credentials ) ).append( "'\n" );
+            }
+            else
+            {
+                sb.append( "        Sasl credentials\n" );
+                sb.append( "            Mechanism :'" ).append( mechanism ).append( "'\n" );
+
+                sb.append( "            Credentials : '" ).append( StringTools.utf8ToString( credentials ) ).append(
+                    '/' ).append( StringTools.dumpBytes( credentials ) ).append( "'\n" );
+            }
+        }
+
+        return sb.toString();
+    }
+
+
+    /**
+     * RFC 2251 [Section 4.11]: Abandon, Bind, Unbind, and StartTLS operations
+     * cannot be abandoned.
+     */
+    public void abandon()
+    {
+        throw new UnsupportedOperationException(
+            "RFC 2251 [Section 4.11]: Abandon, Bind, Unbind, and StartTLS operations cannot be abandoned. " );
+    }
+}

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequestImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequestImpl.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sat Feb 11 21:50:03 2006
@@ -1 +1,4 @@
 Rev
+Revision
+Date
+Id

Modified: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindResponse.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindResponse.java?rev=377135&r1=377134&r2=377135&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindResponse.java (original)
+++ directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindResponse.java Sat Feb 11 21:50:03 2006
@@ -1,53 +1,53 @@
-/*
- *   Copyright 2004 The Apache Software Foundation
- *
- *   Licensed 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;
-
-
-/**
- * Bind protocol response message used to confirm the results of a bind request
- * message. BindResponse consists simply of an indication from the server of the
- * status of the client's request for authentication.
- * 
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- * @version $Rev$
- */
-public interface BindResponse extends ResultResponse
-{
-    /** Bind response message type enumeration value */
-    MessageTypeEnum TYPE = MessageTypeEnum.BINDRESPONSE;
-
-
-    /**
-     * Gets the optional property holding SASL authentication response paramters
-     * that are SASL mechanism specific. Will return null if the authentication
-     * is simple.
-     * 
-     * @return the sasl mech. specific credentials or null of auth. is simple
-     */
-    byte[] getServerSaslCreds();
-
-
-    /**
-     * Sets the optional property holding SASL authentication response paramters
-     * that are SASL mechanism specific. Leave null if authentication mode is
-     * simple.
-     * 
-     * @param a_serverSaslCreds
-     *            the sasl auth. mech. specific credentials
-     */
-    void setServerSaslCreds( byte[] a_serverSaslCreds );
-}
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed 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;
+
+
+/**
+ * Bind protocol response message used to confirm the results of a bind request
+ * message. BindResponse consists simply of an indication from the server of the
+ * status of the client's request for authentication.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public interface BindResponse extends ResultResponse
+{
+    /** Bind response message type enumeration value */
+    MessageTypeEnum TYPE = MessageTypeEnum.BINDRESPONSE;
+
+
+    /**
+     * Gets the optional property holding SASL authentication response paramters
+     * that are SASL mechanism specific. Will return null if the authentication
+     * is simple.
+     * 
+     * @return the sasl mech. specific credentials or null of auth. is simple
+     */
+    byte[] getServerSaslCreds();
+
+
+    /**
+     * Sets the optional property holding SASL authentication response paramters
+     * that are SASL mechanism specific. Leave null if authentication mode is
+     * simple.
+     * 
+     * @param a_serverSaslCreds
+     *            the sasl auth. mech. specific credentials
+     */
+    void setServerSaslCreds( byte[] a_serverSaslCreds );
+}

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindResponse.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindResponse.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sat Feb 11 21:50:03 2006
@@ -1 +1,4 @@
 Rev
+Revision
+Date
+Id

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindResponseImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindResponseImpl.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sat Feb 11 21:50:03 2006
@@ -1 +1,4 @@
 Rev
+Revision
+Date
+Id

Modified: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequest.java?rev=377135&r1=377134&r2=377135&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequest.java (original)
+++ directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequest.java Sat Feb 11 21:50:03 2006
@@ -1,96 +1,96 @@
-/*
- *   Copyright 2004 The Apache Software Foundation
- *
- *   Licensed 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;
-
-
-/**
- * Compare request protocol message that tests an entry to see if it abides by
- * an attribute value assertion.
- * 
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- * @version $Revision$
- */
-public interface CompareRequest extends SingleReplyRequest, AbandonableRequest
-{
-    /** Compare request message type enum code */
-    MessageTypeEnum TYPE = MessageTypeEnum.COMPAREREQUEST;
-
-    /** Compare response message type enum code */
-    MessageTypeEnum RESP_TYPE = CompareResponse.TYPE;
-
-
-    /**
-     * Gets the distinguished name of the entry to be compared using the
-     * attribute value assertion.
-     * 
-     * @return the DN of the compared entry.
-     */
-    String getName();
-
-
-    /**
-     * Sets the distinguished name of the entry to be compared using the
-     * attribute value assertion.
-     * 
-     * @param a_name
-     *            the DN of the compared entry.
-     */
-    void setName( String a_name );
-
-
-    /**
-     * Gets the attribute value to use in making the comparison.
-     * 
-     * @return the attribute value to used in comparison.
-     */
-    byte[] getAssertionValue();
-
-
-    /**
-     * Sets the attribute value to use in the comparison.
-     * 
-     * @param a_value
-     *            the attribute value used in comparison.
-     */
-    void setAssertionValue( String a_value );
-
-
-    /**
-     * Sets the attribute value to use in the comparison.
-     * 
-     * @param a_value
-     *            the attribute value used in comparison.
-     */
-    void setAssertionValue( byte[] value );
-
-
-    /**
-     * Gets the attribute id use in making the comparison.
-     * 
-     * @return the attribute id used in comparison.
-     */
-    String getAttributeId();
-
-
-    /**
-     * Sets the attribute id used in the comparison.
-     * 
-     * @param a_attrId
-     *            the attribute id used in comparison.
-     */
-    void setAttributeId( String a_attrId );
-}
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed 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;
+
+
+/**
+ * Compare request protocol message that tests an entry to see if it abides by
+ * an attribute value assertion.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Revision$
+ */
+public interface CompareRequest extends SingleReplyRequest, AbandonableRequest
+{
+    /** Compare request message type enum code */
+    MessageTypeEnum TYPE = MessageTypeEnum.COMPAREREQUEST;
+
+    /** Compare response message type enum code */
+    MessageTypeEnum RESP_TYPE = CompareResponse.TYPE;
+
+
+    /**
+     * Gets the distinguished name of the entry to be compared using the
+     * attribute value assertion.
+     * 
+     * @return the DN of the compared entry.
+     */
+    String getName();
+
+
+    /**
+     * Sets the distinguished name of the entry to be compared using the
+     * attribute value assertion.
+     * 
+     * @param a_name
+     *            the DN of the compared entry.
+     */
+    void setName( String a_name );
+
+
+    /**
+     * Gets the attribute value to use in making the comparison.
+     * 
+     * @return the attribute value to used in comparison.
+     */
+    byte[] getAssertionValue();
+
+
+    /**
+     * Sets the attribute value to use in the comparison.
+     * 
+     * @param a_value
+     *            the attribute value used in comparison.
+     */
+    void setAssertionValue( String a_value );
+
+
+    /**
+     * Sets the attribute value to use in the comparison.
+     * 
+     * @param a_value
+     *            the attribute value used in comparison.
+     */
+    void setAssertionValue( byte[] value );
+
+
+    /**
+     * Gets the attribute id use in making the comparison.
+     * 
+     * @return the attribute id used in comparison.
+     */
+    String getAttributeId();
+
+
+    /**
+     * Sets the attribute id used in the comparison.
+     * 
+     * @param a_attrId
+     *            the attribute id used in comparison.
+     */
+    void setAttributeId( String a_attrId );
+}

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequest.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sat Feb 11 21:50:03 2006
@@ -1 +1,4 @@
 Rev
+Revision
+Date
+Id

Modified: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequestImpl.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequestImpl.java?rev=377135&r1=377134&r2=377135&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequestImpl.java (original)
+++ directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequestImpl.java Sat Feb 11 21:50:03 2006
@@ -1,279 +1,279 @@
-/*
- *   Copyright 2004 The Apache Software Foundation
- *
- *   Licensed 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;
-
-
-import java.util.Arrays;
-
-import org.apache.directory.shared.ldap.util.StringTools;
-
-
-/**
- * Lockable comparison request implementation.
- * 
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- * @version $Rev$
- */
-public class CompareRequestImpl extends AbstractAbandonableRequest implements CompareRequest
-{
-    static final long serialVersionUID = 1699731530016468977L;
-
-    /** Distinguished name identifying the compared entry */
-    private String name;
-
-    /** The id of the attribute used in the comparison */
-    private String attrId;
-
-    /** The value of the attribute used in the comparison */
-    private byte[] attrVal;
-
-    private CompareResponse response;
-
-
-    // ------------------------------------------------------------------------
-    // Constructors
-    // ------------------------------------------------------------------------
-
-    /**
-     * Creates an CompareRequest implementation to compare a named entry with an
-     * attribute value assertion pair.
-     * 
-     * @param id
-     *            the sequence identifier of the CompareRequest message.
-     */
-    public CompareRequestImpl(final int id)
-    {
-        super( id, TYPE );
-    }
-
-
-    // ------------------------------------------------------------------------
-    // ComparisonRequest Interface Method Implementations
-    // ------------------------------------------------------------------------
-
-    /**
-     * Gets the distinguished name of the entry to be compared using the
-     * attribute value assertion.
-     * 
-     * @return the DN of the compared entry.
-     */
-    public String getName()
-    {
-        return name;
-    }
-
-
-    /**
-     * Sets the distinguished name of the entry to be compared using the
-     * attribute value assertion.
-     * 
-     * @param name
-     *            the DN of the compared entry.
-     */
-    public void setName( String name )
-    {
-        this.name = name;
-    }
-
-
-    /**
-     * Gets the attribute value to use in making the comparison.
-     * 
-     * @return the attribute value to used in comparison.
-     */
-    public byte[] getAssertionValue()
-    {
-        return attrVal;
-    }
-
-
-    /**
-     * Sets the attribute value to use in the comparison.
-     * 
-     * @param attrVal
-     *            the attribute value used in comparison.
-     */
-    public void setAssertionValue( String attrVal )
-    {
-        this.attrVal = StringTools.getBytesUtf8( attrVal );
-    }
-
-
-    /**
-     * Sets the attribute value to use in the comparison.
-     * 
-     * @param attrVal
-     *            the attribute value used in comparison.
-     */
-    public void setAssertionValue( byte[] attrVal )
-    {
-        this.attrVal = attrVal;
-    }
-
-
-    /**
-     * Gets the attribute id use in making the comparison.
-     * 
-     * @return the attribute id used in comparison.
-     */
-    public String getAttributeId()
-    {
-        return attrId;
-    }
-
-
-    /**
-     * Sets the attribute id used in the comparison.
-     * 
-     * @param attrId
-     *            the attribute id used in comparison.
-     */
-    public void setAttributeId( String attrId )
-    {
-        this.attrId = attrId;
-    }
-
-
-    // ------------------------------------------------------------------------
-    // SingleReplyRequest Interface Method Implementations
-    // ------------------------------------------------------------------------
-
-    /**
-     * Gets the protocol response message type for this request which produces
-     * at least one response.
-     * 
-     * @return the message type of the response.
-     */
-    public MessageTypeEnum getResponseType()
-    {
-        return RESP_TYPE;
-    }
-
-
-    /**
-     * The result containing response for this request.
-     * 
-     * @return the result containing response for this request
-     */
-    public ResultResponse getResultResponse()
-    {
-        if ( response == null )
-        {
-            response = new CompareResponseImpl( getMessageId() );
-        }
-
-        return response;
-    }
-
-
-    /**
-     * Checks to see if an object is equivalent to this CompareRequest.
-     * 
-     * @param obj
-     *            the obj to compare with this CompareRequest
-     * @return true if the obj is equal to this request, false otherwise
-     */
-    public boolean equals( Object obj )
-    {
-        if ( obj == this )
-        {
-            return true;
-        }
-
-        if ( !super.equals( obj ) )
-        {
-            return false;
-        }
-
-        CompareRequest req = ( CompareRequest ) obj;
-
-        if ( name != null && req.getName() == null )
-        {
-            return false;
-        }
-
-        if ( name == null && req.getName() != null )
-        {
-            return false;
-        }
-
-        if ( name != null && req.getName() != null )
-        {
-            if ( !name.equals( req.getName() ) )
-            {
-                return false;
-            }
-        }
-
-        if ( attrId != null && req.getAttributeId() == null )
-        {
-            return false;
-        }
-
-        if ( attrId == null && req.getAttributeId() != null )
-        {
-            return false;
-        }
-
-        if ( attrId != null && req.getAttributeId() != null )
-        {
-            if ( !attrId.equals( req.getAttributeId() ) )
-            {
-                return false;
-            }
-        }
-
-        if ( attrVal != null && req.getAssertionValue() == null )
-        {
-            return false;
-        }
-
-        if ( attrVal == null && req.getAssertionValue() != null )
-        {
-            return false;
-        }
-
-        if ( attrVal != null && req.getAssertionValue() != null )
-        {
-            if ( !Arrays.equals( attrVal, req.getAssertionValue() ) )
-            {
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-
-    /**
-     * Get a String representation of a Compare Request
-     * 
-     * @return A Compare Request String
-     */
-    public String toString()
-    {
-        StringBuffer sb = new StringBuffer();
-
-        sb.append( "    Compare request\n" );
-        sb.append( "        Entry : '" ).append( name.toString() ).append( "'\n" );
-        sb.append( "        Attribute description : '" ).append( attrId ).append( "'\n" );
-        sb.append( "        Attribute value : '" ).append( StringTools.utf8ToString( attrVal ) ).append( '/' ).append(
-            StringTools.dumpBytes( attrVal ) ).append( "'\n" );
-
-        return sb.toString();
-    }
-}
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed 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;
+
+
+import java.util.Arrays;
+
+import org.apache.directory.shared.ldap.util.StringTools;
+
+
+/**
+ * Lockable comparison request implementation.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class CompareRequestImpl extends AbstractAbandonableRequest implements CompareRequest
+{
+    static final long serialVersionUID = 1699731530016468977L;
+
+    /** Distinguished name identifying the compared entry */
+    private String name;
+
+    /** The id of the attribute used in the comparison */
+    private String attrId;
+
+    /** The value of the attribute used in the comparison */
+    private byte[] attrVal;
+
+    private CompareResponse response;
+
+
+    // ------------------------------------------------------------------------
+    // Constructors
+    // ------------------------------------------------------------------------
+
+    /**
+     * Creates an CompareRequest implementation to compare a named entry with an
+     * attribute value assertion pair.
+     * 
+     * @param id
+     *            the sequence identifier of the CompareRequest message.
+     */
+    public CompareRequestImpl(final int id)
+    {
+        super( id, TYPE );
+    }
+
+
+    // ------------------------------------------------------------------------
+    // ComparisonRequest Interface Method Implementations
+    // ------------------------------------------------------------------------
+
+    /**
+     * Gets the distinguished name of the entry to be compared using the
+     * attribute value assertion.
+     * 
+     * @return the DN of the compared entry.
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+
+    /**
+     * Sets the distinguished name of the entry to be compared using the
+     * attribute value assertion.
+     * 
+     * @param name
+     *            the DN of the compared entry.
+     */
+    public void setName( String name )
+    {
+        this.name = name;
+    }
+
+
+    /**
+     * Gets the attribute value to use in making the comparison.
+     * 
+     * @return the attribute value to used in comparison.
+     */
+    public byte[] getAssertionValue()
+    {
+        return attrVal;
+    }
+
+
+    /**
+     * Sets the attribute value to use in the comparison.
+     * 
+     * @param attrVal
+     *            the attribute value used in comparison.
+     */
+    public void setAssertionValue( String attrVal )
+    {
+        this.attrVal = StringTools.getBytesUtf8( attrVal );
+    }
+
+
+    /**
+     * Sets the attribute value to use in the comparison.
+     * 
+     * @param attrVal
+     *            the attribute value used in comparison.
+     */
+    public void setAssertionValue( byte[] attrVal )
+    {
+        this.attrVal = attrVal;
+    }
+
+
+    /**
+     * Gets the attribute id use in making the comparison.
+     * 
+     * @return the attribute id used in comparison.
+     */
+    public String getAttributeId()
+    {
+        return attrId;
+    }
+
+
+    /**
+     * Sets the attribute id used in the comparison.
+     * 
+     * @param attrId
+     *            the attribute id used in comparison.
+     */
+    public void setAttributeId( String attrId )
+    {
+        this.attrId = attrId;
+    }
+
+
+    // ------------------------------------------------------------------------
+    // SingleReplyRequest Interface Method Implementations
+    // ------------------------------------------------------------------------
+
+    /**
+     * Gets the protocol response message type for this request which produces
+     * at least one response.
+     * 
+     * @return the message type of the response.
+     */
+    public MessageTypeEnum getResponseType()
+    {
+        return RESP_TYPE;
+    }
+
+
+    /**
+     * The result containing response for this request.
+     * 
+     * @return the result containing response for this request
+     */
+    public ResultResponse getResultResponse()
+    {
+        if ( response == null )
+        {
+            response = new CompareResponseImpl( getMessageId() );
+        }
+
+        return response;
+    }
+
+
+    /**
+     * Checks to see if an object is equivalent to this CompareRequest.
+     * 
+     * @param obj
+     *            the obj to compare with this CompareRequest
+     * @return true if the obj is equal to this request, false otherwise
+     */
+    public boolean equals( Object obj )
+    {
+        if ( obj == this )
+        {
+            return true;
+        }
+
+        if ( !super.equals( obj ) )
+        {
+            return false;
+        }
+
+        CompareRequest req = ( CompareRequest ) obj;
+
+        if ( name != null && req.getName() == null )
+        {
+            return false;
+        }
+
+        if ( name == null && req.getName() != null )
+        {
+            return false;
+        }
+
+        if ( name != null && req.getName() != null )
+        {
+            if ( !name.equals( req.getName() ) )
+            {
+                return false;
+            }
+        }
+
+        if ( attrId != null && req.getAttributeId() == null )
+        {
+            return false;
+        }
+
+        if ( attrId == null && req.getAttributeId() != null )
+        {
+            return false;
+        }
+
+        if ( attrId != null && req.getAttributeId() != null )
+        {
+            if ( !attrId.equals( req.getAttributeId() ) )
+            {
+                return false;
+            }
+        }
+
+        if ( attrVal != null && req.getAssertionValue() == null )
+        {
+            return false;
+        }
+
+        if ( attrVal == null && req.getAssertionValue() != null )
+        {
+            return false;
+        }
+
+        if ( attrVal != null && req.getAssertionValue() != null )
+        {
+            if ( !Arrays.equals( attrVal, req.getAssertionValue() ) )
+            {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+
+    /**
+     * Get a String representation of a Compare Request
+     * 
+     * @return A Compare Request String
+     */
+    public String toString()
+    {
+        StringBuffer sb = new StringBuffer();
+
+        sb.append( "    Compare request\n" );
+        sb.append( "        Entry : '" ).append( name.toString() ).append( "'\n" );
+        sb.append( "        Attribute description : '" ).append( attrId ).append( "'\n" );
+        sb.append( "        Attribute value : '" ).append( StringTools.utf8ToString( attrVal ) ).append( '/' ).append(
+            StringTools.dumpBytes( attrVal ) ).append( "'\n" );
+
+        return sb.toString();
+    }
+}

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequestImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/sandbox/akarasulu/rc1/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequestImpl.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sat Feb 11 21:50:03 2006
@@ -1 +1,4 @@
 Rev
+Revision
+Date
+Id



Mime
View raw message