Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 43599 invoked from network); 20 Feb 2006 03:47:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Feb 2006 03:47:08 -0000 Received: (qmail 86211 invoked by uid 500); 20 Feb 2006 03:46:53 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 85945 invoked by uid 500); 20 Feb 2006 03:46:51 -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 85702 invoked by uid 99); 20 Feb 2006 03:46:48 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Feb 2006 19:46:48 -0800 X-ASF-Spam-Status: No, hits=-9.2 required=10.0 tests=ALL_TRUSTED,MAILTO_TO_SPAM_ADDR,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 19 Feb 2006 19:46:33 -0800 Received: (qmail 42712 invoked by uid 65534); 20 Feb 2006 03:46:12 -0000 Message-ID: <20060220034612.42711.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r379008 [6/11] - in /directory/trunks/shared: ./ asn1/ asn1/src/main/java/org/apache/directory/shared/asn1/ asn1/src/main/java/org/apache/directory/shared/asn1/ber/ asn1/src/main/java/org/apache/directory/shared/asn1/ber/grammar/ asn1/src/m... Date: Mon, 20 Feb 2006 03:36:53 -0000 To: commits@directory.apache.org From: akarasulu@apache.org X-Mailer: svnmailer-1.0.6 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedResponse.java URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedResponse.java?rev=379008&r1=379007&r2=379008&view=diff ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedResponse.java (original) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedResponse.java Sun Feb 19 19:35:07 2006 @@ -1,67 +1,67 @@ -/* - * 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; - - -/** - * Extended protocol response message used to confirm the results of a extended - * request message. - * - * @author Apache Directory Project - * @version $Revision$ - */ -public interface ExtendedResponse extends ResultResponse, javax.naming.ldap.ExtendedResponse -{ - /** Extended response message type enumeration value */ - MessageTypeEnum TYPE = MessageTypeEnum.EXTENDEDRESP; - - - /** - * Gets the OID uniquely identifying this extended response (a.k.a. its - * name). - * - * @return the OID of the extended response type. - */ - String getResponseName(); - - - /** - * Sets the OID uniquely identifying this extended response (a.k.a. its - * name). - * - * @param oid - * the OID of the extended response type. - */ - void setResponseName( String oid ); - - - /** - * Gets the reponse OID specific encoded response values. - * - * @return the response specific encoded response values. - */ - byte[] getResponse(); - - - /** - * Sets the reponse OID specific encoded response values. - * - * @param value - * the response specific encoded response values. - */ - void setResponse( byte[] value ); -} +/* + * 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; + + +/** + * Extended protocol response message used to confirm the results of a extended + * request message. + * + * @author Apache Directory Project + * @version $Revision$ + */ +public interface ExtendedResponse extends ResultResponse, javax.naming.ldap.ExtendedResponse +{ + /** Extended response message type enumeration value */ + MessageTypeEnum TYPE = MessageTypeEnum.EXTENDEDRESP; + + + /** + * Gets the OID uniquely identifying this extended response (a.k.a. its + * name). + * + * @return the OID of the extended response type. + */ + String getResponseName(); + + + /** + * Sets the OID uniquely identifying this extended response (a.k.a. its + * name). + * + * @param oid + * the OID of the extended response type. + */ + void setResponseName( String oid ); + + + /** + * Gets the reponse OID specific encoded response values. + * + * @return the response specific encoded response values. + */ + byte[] getResponse(); + + + /** + * Sets the reponse OID specific encoded response values. + * + * @param value + * the response specific encoded response values. + */ + void setResponse( byte[] value ); +} Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedResponse.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedResponse.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -1 +1,4 @@ Rev +Revision +Date +Id Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedResponseImpl.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedResponseImpl.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -1 +1,4 @@ Rev +Revision +Date +Id Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/IteratorNamingEnumeration.java URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/IteratorNamingEnumeration.java?rev=379008&r1=379007&r2=379008&view=diff ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/IteratorNamingEnumeration.java (original) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/IteratorNamingEnumeration.java Sun Feb 19 19:35:07 2006 @@ -1,111 +1,111 @@ -/* - * 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: IteratorNamingEnumeration.java,v 1.2 2003/07/31 21:44:48 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; - - -import java.util.Iterator; -import javax.naming.NamingEnumeration; - - -/** - * A NamingEnumeration over an Iterator. - * - * @author Alex Karasulu - * @author Jeff Machols - * @author $Author: akarasulu $ - * @version $Revision$ - */ -public class IteratorNamingEnumeration implements NamingEnumeration -{ - /** the iterator to wrap as in the enumeration */ - private final Iterator m_iterator; - - - /** - * Creates a NamingEnumeration over an Iterator. - * - * @param a_iterator - * the Iterator the NamingEnumeration is based on. - */ - public IteratorNamingEnumeration(final Iterator a_iterator) - { - m_iterator = a_iterator; - } - - - // -------------------------------------------------------------------- - // Enumeration Interface Method Implementations - // -------------------------------------------------------------------- - - /** - * @see java.util.Enumeration#hasMoreElements() - */ - public boolean hasMoreElements() - { - return m_iterator.hasNext(); - } - - - /** - * @see java.util.Enumeration#nextElement() - */ - public Object nextElement() - { - return m_iterator.next(); - } - - - // -------------------------------------------------------------------- - // NamingEnumeration Interface Method Implementations - // -------------------------------------------------------------------- - - /** - * @see javax.naming.NamingEnumeration#close() - */ - public void close() - { - // Does nothing! - } - - - /** - * @see javax.naming.NamingEnumeration#hasMore() - */ - public boolean hasMore() - { - return m_iterator.hasNext(); - } - - - /** - * @see javax.naming.NamingEnumeration#next() - */ - public Object next() - { - return m_iterator.next(); - } -} +/* + * 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; + + +import java.util.Iterator; +import javax.naming.NamingEnumeration; + + +/** + * A NamingEnumeration over an Iterator. + * + * @author Alex Karasulu + * @author Jeff Machols + * @author $Author: akarasulu $ + * @version $Revision$ + */ +public class IteratorNamingEnumeration implements NamingEnumeration +{ + /** the iterator to wrap as in the enumeration */ + private final Iterator m_iterator; + + + /** + * Creates a NamingEnumeration over an Iterator. + * + * @param a_iterator + * the Iterator the NamingEnumeration is based on. + */ + public IteratorNamingEnumeration(final Iterator a_iterator) + { + m_iterator = a_iterator; + } + + + // -------------------------------------------------------------------- + // Enumeration Interface Method Implementations + // -------------------------------------------------------------------- + + /** + * @see java.util.Enumeration#hasMoreElements() + */ + public boolean hasMoreElements() + { + return m_iterator.hasNext(); + } + + + /** + * @see java.util.Enumeration#nextElement() + */ + public Object nextElement() + { + return m_iterator.next(); + } + + + // -------------------------------------------------------------------- + // NamingEnumeration Interface Method Implementations + // -------------------------------------------------------------------- + + /** + * @see javax.naming.NamingEnumeration#close() + */ + public void close() + { + // Does nothing! + } + + + /** + * @see javax.naming.NamingEnumeration#hasMore() + */ + public boolean hasMore() + { + return m_iterator.hasNext(); + } + + + /** + * @see javax.naming.NamingEnumeration#next() + */ + public Object next() + { + return m_iterator.next(); + } +} Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/IteratorNamingEnumeration.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/IteratorNamingEnumeration.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -1 +1,4 @@ Rev +Revision +Date +Id Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapResult.java URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapResult.java?rev=379008&r1=379007&r2=379008&view=diff ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapResult.java (original) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapResult.java Sun Feb 19 19:35:07 2006 @@ -1,142 +1,142 @@ -/* - * 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: LdapResult.java,v 1.4 2003/07/31 21:44:48 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; - - -/** - * LDAPv3 result structure embedded into Responses. See section 4.1.10 in RFC 2251 for a description of the LDAPResult ASN.1 structure, - * here's a snippet from it: - * - *
- *   The LDAPResult is the construct used in this protocol to return
- *   success or failure indications from servers to clients. In response
- *   to various requests servers will return responses containing fields
- *   of type LDAPResult to indicate the final status of a protocol
- *   operation request.
- * 
- * - * @author Apache Directory Project - * @version $Revision$ - */ -public interface LdapResult -{ - /** - * Gets the result code enumeration associated with the response. - * Corresponds to the resultCode field within the LDAPResult ASN.1 - * structure. - * - * @return the result code enum value. - */ - ResultCodeEnum getResultCode(); - - - /** - * Sets the result code enumeration associated with the response. - * Corresponds to the resultCode field within the LDAPResult ASN.1 - * structure. - * - * @param resultCode - * the result code enum value. - */ - void setResultCode( ResultCodeEnum resultCode ); - - - /** - * Gets the lowest entry in the directory that was matched. For result codes - * of noSuchObject, aliasProblem, invalidDNSyntax and - * aliasDereferencingProblem, the matchedDN field is set to the name of the - * lowest entry (object or alias) in the directory that was matched. If no - * aliases were dereferenced while attempting to locate the entry, this will - * be a truncated form of the name provided, or if aliases were - * dereferenced, of the resulting name, as defined in section 12.5 of X.511 - * [8]. The matchedDN field is to be set to a zero length string with all - * other result codes. - * - * @return the Dn of the lowest matched entry. - */ - String getMatchedDn(); - - - /** - * Sets the lowest entry in the directory that was matched. - * - * @see #getMatchedDn() - * @param dn - * the Dn of the lowest matched entry. - */ - void setMatchedDn( String dn ); - - - /** - * Gets the descriptive error message associated with the error code. May be - * null for SUCCESS, COMPARETRUE, COMPAREFALSE and REFERRAL operations. - * - * @return the descriptive error message. - */ - String getErrorMessage(); - - - /** - * Sets the descriptive error message associated with the error code. May be - * null for SUCCESS, COMPARETRUE, and COMPAREFALSE operations. - * - * @param errorMessage - * the descriptive error message. - */ - void setErrorMessage( String errorMessage ); - - - /** - * Gets whether or not this result represents a Referral. For referrals the - * error code is set to REFERRAL and the referral property is not null. - * - * @return true if this result represents a referral. - */ - boolean isReferral(); - - - /** - * Gets the Referral associated with this LdapResult if the resultCode - * property is set to the REFERRAL ResultCodeEnum. - * - * @return the referral on REFERRAL errors, null on all others. - */ - Referral getReferral(); - - - /** - * Sets the Referral associated with this LdapResult if the resultCode - * property is set to the REFERRAL ResultCodeEnum. Setting this property - * will result in a true return from isReferral and the resultCode should be - * set to REFERRAL. - * - * @param referral - * optional referral on REFERRAL errors. - */ - void setReferral( Referral referral ); -} +/* + * 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; + + +/** + * LDAPv3 result structure embedded into Responses. See section 4.1.10 in RFC 2251 for a description of the LDAPResult ASN.1 structure, + * here's a snippet from it: + * + *
+ *   The LDAPResult is the construct used in this protocol to return
+ *   success or failure indications from servers to clients. In response
+ *   to various requests servers will return responses containing fields
+ *   of type LDAPResult to indicate the final status of a protocol
+ *   operation request.
+ * 
+ * + * @author Apache Directory Project + * @version $Revision$ + */ +public interface LdapResult +{ + /** + * Gets the result code enumeration associated with the response. + * Corresponds to the resultCode field within the LDAPResult ASN.1 + * structure. + * + * @return the result code enum value. + */ + ResultCodeEnum getResultCode(); + + + /** + * Sets the result code enumeration associated with the response. + * Corresponds to the resultCode field within the LDAPResult ASN.1 + * structure. + * + * @param resultCode + * the result code enum value. + */ + void setResultCode( ResultCodeEnum resultCode ); + + + /** + * Gets the lowest entry in the directory that was matched. For result codes + * of noSuchObject, aliasProblem, invalidDNSyntax and + * aliasDereferencingProblem, the matchedDN field is set to the name of the + * lowest entry (object or alias) in the directory that was matched. If no + * aliases were dereferenced while attempting to locate the entry, this will + * be a truncated form of the name provided, or if aliases were + * dereferenced, of the resulting name, as defined in section 12.5 of X.511 + * [8]. The matchedDN field is to be set to a zero length string with all + * other result codes. + * + * @return the Dn of the lowest matched entry. + */ + String getMatchedDn(); + + + /** + * Sets the lowest entry in the directory that was matched. + * + * @see #getMatchedDn() + * @param dn + * the Dn of the lowest matched entry. + */ + void setMatchedDn( String dn ); + + + /** + * Gets the descriptive error message associated with the error code. May be + * null for SUCCESS, COMPARETRUE, COMPAREFALSE and REFERRAL operations. + * + * @return the descriptive error message. + */ + String getErrorMessage(); + + + /** + * Sets the descriptive error message associated with the error code. May be + * null for SUCCESS, COMPARETRUE, and COMPAREFALSE operations. + * + * @param errorMessage + * the descriptive error message. + */ + void setErrorMessage( String errorMessage ); + + + /** + * Gets whether or not this result represents a Referral. For referrals the + * error code is set to REFERRAL and the referral property is not null. + * + * @return true if this result represents a referral. + */ + boolean isReferral(); + + + /** + * Gets the Referral associated with this LdapResult if the resultCode + * property is set to the REFERRAL ResultCodeEnum. + * + * @return the referral on REFERRAL errors, null on all others. + */ + Referral getReferral(); + + + /** + * Sets the Referral associated with this LdapResult if the resultCode + * property is set to the REFERRAL ResultCodeEnum. Setting this property + * will result in a true return from isReferral and the resultCode should be + * set to REFERRAL. + * + * @param referral + * optional referral on REFERRAL errors. + */ + void setReferral( Referral referral ); +} Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapResult.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapResult.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -1 +1,4 @@ Rev +Revision +Date +Id Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapResultImpl.java URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapResultImpl.java?rev=379008&r1=379007&r2=379008&view=diff ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapResultImpl.java (original) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapResultImpl.java Sun Feb 19 19:35:07 2006 @@ -16,7 +16,7 @@ */ /* - * $Id: LdapResultImpl.java,v 1.4 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/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapResultImpl.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapResultImpl.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -1 +1,4 @@ Rev +Revision +Date +Id Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/LockableAttributeImpl.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/LockableAttributeImpl.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -1 +1,4 @@ Rev +Revision +Date +Id Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/LockableAttributesImpl.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/LockableAttributesImpl.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -1 +1,4 @@ Rev +Revision +Date +Id Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ManageDsaITControl.java ------------------------------------------------------------------------------ --- svn:keywords (added) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -0,0 +1,4 @@ +Rev +Revision +Date +Id Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ManyReplyRequest.java URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ManyReplyRequest.java?rev=379008&r1=379007&r2=379008&view=diff ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ManyReplyRequest.java (original) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ManyReplyRequest.java Sun Feb 19 19:35:07 2006 @@ -1,36 +1,36 @@ -/* - * 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; - - -/** - * A request that can generate zero, one, or more heterogenous responses for a - * single request. - * - * @author Apache Directory Project - * @version $Rev$ - */ -public interface ManyReplyRequest extends ResultResponseRequest -{ - /** - * Gets the various types of messages that can be generated by this kind of - * request. - * - * @return the messages types generated in response to this Request - */ - MessageTypeEnum[] getResponseTypes(); -} +/* + * 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; + + +/** + * A request that can generate zero, one, or more heterogenous responses for a + * single request. + * + * @author Apache Directory Project + * @version $Rev$ + */ +public interface ManyReplyRequest extends ResultResponseRequest +{ + /** + * Gets the various types of messages that can be generated by this kind of + * request. + * + * @return the messages types generated in response to this Request + */ + MessageTypeEnum[] getResponseTypes(); +} Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ManyReplyRequest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ManyReplyRequest.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -1 +1,4 @@ Rev +Revision +Date +Id Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/Message.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/Message.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -1 +1,4 @@ Rev +Revision +Date +Id Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageDecoder.java URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageDecoder.java?rev=379008&r1=379007&r2=379008&view=diff ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageDecoder.java (original) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageDecoder.java Sun Feb 19 19:35:07 2006 @@ -69,19 +69,6 @@ * Creates a MessageDecoder using default properties for enabling a BER * library provider. * - * @throws MessageException - * if there is a problem creating this decoder. - */ - public MessageDecoder() throws MessageException - { - this( Provider.getEnvironment() ); - } - - - /** - * Creates a MessageDecoder using default properties for enabling a BER - * library provider. - * * @param env * The Map of environment parameters. * @throws MessageException @@ -90,7 +77,13 @@ public MessageDecoder(final Hashtable env) throws MessageException { this.env = ( Hashtable ) env.clone(); - this.provider = Provider.getProvider( this.env ); + + // We need to get the encoder class name + Hashtable providerEnv = Provider.getEnvironment(); + + this.env.put( Provider.BERLIB_PROVIDER, providerEnv.get( Provider.BERLIB_PROVIDER ) ); + this.provider = Provider.getProvider( providerEnv ); + Set binaries; if ( env.containsKey( BINARY_KEY ) ) Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageDecoder.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageDecoder.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -1 +1,4 @@ Rev +Revision +Date +Id Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageEncoder.java URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageEncoder.java?rev=379008&r1=379007&r2=379008&view=diff ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageEncoder.java (original) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageEncoder.java Sun Feb 19 19:35:07 2006 @@ -53,19 +53,6 @@ * Creates a MessageEncoder using default properties for enabling a BER * library provider. * - * @throws MessageException - * if the encoder cannot be created. - */ - public MessageEncoder() throws MessageException - { - this( Provider.getEnvironment() ); - } - - - /** - * Creates a MessageEncoder using default properties for enabling a BER - * library provider. - * * @param env * The Map of environment parameters. * @throws MessageException @@ -73,7 +60,10 @@ */ public MessageEncoder(final Hashtable env) throws MessageException { - this.provider = Provider.getProvider( ( Hashtable ) env.clone() ); + // We need to get the encoder class name + Hashtable providerEnv = Provider.getEnvironment(); + + this.provider = Provider.getProvider( Provider.getEnvironment() ); this.encoder = provider.getEncoder(); this.transformer = provider.getTransformer(); } Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageEncoder.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageEncoder.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -1 +1,4 @@ Rev +Revision +Date +Id Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageException.java URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageException.java?rev=379008&r1=379007&r2=379008&view=diff ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageException.java (original) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageException.java Sun Feb 19 19:35:07 2006 @@ -1,64 +1,64 @@ -/* - * 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: MessageException.java,v 1.3 2003/07/31 21:44:49 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; - - -import org.apache.directory.shared.ldap.RuntimeMultiException; - - -/** - * This exception is thrown when a message processing error occurs. - * - * @author Alex Karasulu - * @author $Author: akarasulu $ - * @version $Revision$ - */ -public class MessageException extends RuntimeMultiException -{ - static final long serialVersionUID = -155089078576745029L; - - - /** - * Constructs an Exception without a message. - */ - public MessageException() - { - super(); - } - - - /** - * Constructs an Exception with a detailed message. - * - * @param a_message - * The message associated with the exception. - */ - public MessageException(String a_message) - { - super( a_message ); - } -} +/* + * 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; + + +import org.apache.directory.shared.ldap.RuntimeMultiException; + + +/** + * This exception is thrown when a message processing error occurs. + * + * @author Alex Karasulu + * @author $Author: akarasulu $ + * @version $Revision$ + */ +public class MessageException extends RuntimeMultiException +{ + static final long serialVersionUID = -155089078576745029L; + + + /** + * Constructs an Exception without a message. + */ + public MessageException() + { + super(); + } + + + /** + * Constructs an Exception with a detailed message. + * + * @param a_message + * The message associated with the exception. + */ + public MessageException(String a_message) + { + super( a_message ); + } +} Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageException.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageException.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -1 +1,4 @@ Rev +Revision +Date +Id Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageTypeEnum.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageTypeEnum.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -1 +1,4 @@ Rev +Revision +Date +Id Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyDnRequest.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -1 +1,4 @@ Rev +Revision +Date +Id Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyDnRequestImpl.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyDnRequestImpl.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -1 +1,4 @@ Rev +Revision +Date +Id Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyDnResponse.java URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyDnResponse.java?rev=379008&r1=379007&r2=379008&view=diff ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyDnResponse.java (original) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyDnResponse.java Sun Feb 19 19:35:07 2006 @@ -1,31 +1,31 @@ -/* - * 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; - - -/** - * Modify DN protocol response message used to confirm the results of a modify - * DN request message. - * - * @author Apache Directory Project - * @version $Revision$ - */ -public interface ModifyDnResponse extends ResultResponse -{ - /** Modify DN response message type enumeration value */ - MessageTypeEnum TYPE = MessageTypeEnum.MODDNRESPONSE; -} +/* + * 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; + + +/** + * Modify DN protocol response message used to confirm the results of a modify + * DN request message. + * + * @author Apache Directory Project + * @version $Revision$ + */ +public interface ModifyDnResponse extends ResultResponse +{ + /** Modify DN response message type enumeration value */ + MessageTypeEnum TYPE = MessageTypeEnum.MODDNRESPONSE; +} Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyDnResponse.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyDnResponse.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -1 +1,4 @@ Rev +Revision +Date +Id Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyDnResponseImpl.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyDnResponseImpl.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -1 +1,4 @@ Rev +Revision +Date +Id Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyRequest.java URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyRequest.java?rev=379008&r1=379007&r2=379008&view=diff ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyRequest.java (original) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyRequest.java Sun Feb 19 19:35:07 2006 @@ -1,150 +1,150 @@ -/* - * 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.Collection; - -import javax.naming.directory.ModificationItem; - - -/** - * Modify request protocol message used to alter the attributes and values of an - * existing entry. Here's what RFC 2255 says about it: - * - *
- *  4.6. Modify Operation
- * 
- *   The Modify Operation allows a client to request that a modification
- *   of an entry be performed on its behalf by a server.  The Modify
- *   Request is defined as follows:
- * 
- *        ModifyRequest ::= [APPLICATION 6] SEQUENCE {
- *                object          LDAPDN,
- *                modification    SEQUENCE OF SEQUENCE {
- * 
- *                        operation       ENUMERATED {
- *                                                add     (0),
- *                                                delete  (1),
- *                                                replace (2) },
- *                        modification    AttributeTypeAndValues } }
- * 
- *        AttributeTypeAndValues ::= SEQUENCE {
- *                type    AttributeDescription,
- *                vals    SET OF AttributeValue }
- * 
- *   Parameters of the Modify Request are:
- * 
- *   - object: The object to be modified. The value of this field contains
- *     the DN of the entry to be modified.  The server will not perform
- *     any alias dereferencing in determining the object to be modified.
- * 
- *   - modification: A list of modifications to be performed on the entry.
- *     The entire list of entry modifications MUST be performed
- *     in the order they are listed, as a single atomic operation.  While
- *     individual modifications may violate the directory schema, the
- *     resulting entry after the entire list of modifications is performed
- *     MUST conform to the requirements of the directory schema. The
- *     values that may be taken on by the 'operation' field in each
- *     modification construct have the following semantics respectively:
- *  
- * 
- *             add: add values listed to the given attribute, creating
- *             the attribute if necessary;
- * 
- *             delete: delete values listed from the given attribute,
- *             removing the entire attribute if no values are listed, or
- *             if all current values of the attribute are listed for
- *             deletion;
- * 
- *             replace: replace all existing values of the given attribute
- *             with the new values listed, creating the attribute if it
- *             did not already exist.  A replace with no value will delete
- *             the entire attribute if it exists, and is ignored if the
- *             attribute does not exist.
- *  <pre>
- * 
- *  Notice that we tried to leverage as much as we already can from the JNDI.
- *  Both the Names and ModificationItems are used here to make the API as easy
- *  as possible to understand.  We do not attempt here to write a JNDI provider
- *  which losses the explicit request type usage that we are looking for.  Also
- *  note that this library is both for the client side as well as the server side
- *  unlike the JNDI which is strictly for the client side.  From the JNDI we
- *  borrow good ideas and familiar signatures, interfaces and classes where we
- *  can.
- *  
- *  @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- *  @version $Revision$
- * 
- */
-public interface ModifyRequest extends SingleReplyRequest, AbandonableRequest
-{
-    /** Modify request message type enumeration value */
-    MessageTypeEnum TYPE = MessageTypeEnum.MODIFYREQUEST;
-
-    /** Modify response message type enumeration value */
-    MessageTypeEnum RESP_TYPE = ModifyResponse.TYPE;
-
-
-    /**
-     * Gets the distinguished name of the entry to be modified by this request.
-     * This property represents the PDU's object field.
-     * 
-     * @return the DN of the modified entry.
-     */
-    String getName();
-
-
-    /**
-     * Sets the distinguished name of the entry to be modified by this request.
-     * This property represents the PDU's object field.
-     * 
-     * @param name
-     *            the DN of the modified entry.
-     */
-    void setName( String name );
-
-
-    /**
-     * Gets an immutable Collection of modification items representing the
-     * atomic changes to perform on the candidate entry to modify.
-     * 
-     * @return an immutatble Collection of ModificationItem instances.
-     * @see javax.naming.directory.ModificationItem
-     */
-    Collection getModificationItems();
-
-
-    /**
-     * Adds a ModificationItem to the set of modifications composing this modify
-     * request.
-     * 
-     * @param mod
-     *            a ModificationItem to add.
-     */
-    void addModification( ModificationItem mod );
-
-
-    /**
-     * Removes a ModificationItem to the set of modifications composing this
-     * modify request.
-     * 
-     * @param mod
-     *            a ModificationItem to remove.
-     */
-    void removeModification( ModificationItem mod );
-}
+/*
+ *   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.Collection;
+
+import javax.naming.directory.ModificationItem;
+
+
+/**
+ * Modify request protocol message used to alter the attributes and values of an
+ * existing entry. Here's what RFC 2255 says about it:
+ * 
+ * 
+ *  4.6. Modify Operation
+ * 
+ *   The Modify Operation allows a client to request that a modification
+ *   of an entry be performed on its behalf by a server.  The Modify
+ *   Request is defined as follows:
+ * 
+ *        ModifyRequest ::= [APPLICATION 6] SEQUENCE {
+ *                object          LDAPDN,
+ *                modification    SEQUENCE OF SEQUENCE {
+ * 
+ *                        operation       ENUMERATED {
+ *                                                add     (0),
+ *                                                delete  (1),
+ *                                                replace (2) },
+ *                        modification    AttributeTypeAndValues } }
+ * 
+ *        AttributeTypeAndValues ::= SEQUENCE {
+ *                type    AttributeDescription,
+ *                vals    SET OF AttributeValue }
+ * 
+ *   Parameters of the Modify Request are:
+ * 
+ *   - object: The object to be modified. The value of this field contains
+ *     the DN of the entry to be modified.  The server will not perform
+ *     any alias dereferencing in determining the object to be modified.
+ * 
+ *   - modification: A list of modifications to be performed on the entry.
+ *     The entire list of entry modifications MUST be performed
+ *     in the order they are listed, as a single atomic operation.  While
+ *     individual modifications may violate the directory schema, the
+ *     resulting entry after the entire list of modifications is performed
+ *     MUST conform to the requirements of the directory schema. The
+ *     values that may be taken on by the 'operation' field in each
+ *     modification construct have the following semantics respectively:
+ *  
+ * 
+ *             add: add values listed to the given attribute, creating
+ *             the attribute if necessary;
+ * 
+ *             delete: delete values listed from the given attribute,
+ *             removing the entire attribute if no values are listed, or
+ *             if all current values of the attribute are listed for
+ *             deletion;
+ * 
+ *             replace: replace all existing values of the given attribute
+ *             with the new values listed, creating the attribute if it
+ *             did not already exist.  A replace with no value will delete
+ *             the entire attribute if it exists, and is ignored if the
+ *             attribute does not exist.
+ *  <pre>
+ * 
+ *  Notice that we tried to leverage as much as we already can from the JNDI.
+ *  Both the Names and ModificationItems are used here to make the API as easy
+ *  as possible to understand.  We do not attempt here to write a JNDI provider
+ *  which losses the explicit request type usage that we are looking for.  Also
+ *  note that this library is both for the client side as well as the server side
+ *  unlike the JNDI which is strictly for the client side.  From the JNDI we
+ *  borrow good ideas and familiar signatures, interfaces and classes where we
+ *  can.
+ *  
+ *  @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ *  @version $Revision$
+ * 
+ */
+public interface ModifyRequest extends SingleReplyRequest, AbandonableRequest
+{
+    /** Modify request message type enumeration value */
+    MessageTypeEnum TYPE = MessageTypeEnum.MODIFYREQUEST;
+
+    /** Modify response message type enumeration value */
+    MessageTypeEnum RESP_TYPE = ModifyResponse.TYPE;
+
+
+    /**
+     * Gets the distinguished name of the entry to be modified by this request.
+     * This property represents the PDU's object field.
+     * 
+     * @return the DN of the modified entry.
+     */
+    String getName();
+
+
+    /**
+     * Sets the distinguished name of the entry to be modified by this request.
+     * This property represents the PDU's object field.
+     * 
+     * @param name
+     *            the DN of the modified entry.
+     */
+    void setName( String name );
+
+
+    /**
+     * Gets an immutable Collection of modification items representing the
+     * atomic changes to perform on the candidate entry to modify.
+     * 
+     * @return an immutatble Collection of ModificationItem instances.
+     * @see javax.naming.directory.ModificationItem
+     */
+    Collection getModificationItems();
+
+
+    /**
+     * Adds a ModificationItem to the set of modifications composing this modify
+     * request.
+     * 
+     * @param mod
+     *            a ModificationItem to add.
+     */
+    void addModification( ModificationItem mod );
+
+
+    /**
+     * Removes a ModificationItem to the set of modifications composing this
+     * modify request.
+     * 
+     * @param mod
+     *            a ModificationItem to remove.
+     */
+    void removeModification( ModificationItem mod );
+}

Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyRequest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyRequest.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:35:07 2006
@@ -1 +1,4 @@
 Rev
+Revision
+Date
+Id

Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyRequestImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyRequestImpl.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:35:07 2006
@@ -1 +1,4 @@
 Rev
+Revision
+Date
+Id

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyResponse.java
URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyResponse.java?rev=379008&r1=379007&r2=379008&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyResponse.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyResponse.java Sun Feb 19 19:35:07 2006
@@ -1,30 +1,30 @@
-/*
- *   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;
-
-
-/**
- * Modify protocol response message used to confirm the results of a modify
- * request message.
- * 
- * @version $Revision$
- */
-public interface ModifyResponse extends ResultResponse
-{
-    /** Modify response message type enumeration value */
-    MessageTypeEnum TYPE = MessageTypeEnum.MODIFYRESPONSE;
-}
+/*
+ *   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;
+
+
+/**
+ * Modify protocol response message used to confirm the results of a modify
+ * request message.
+ * 
+ * @version $Revision$
+ */
+public interface ModifyResponse extends ResultResponse
+{
+    /** Modify response message type enumeration value */
+    MessageTypeEnum TYPE = MessageTypeEnum.MODIFYRESPONSE;
+}

Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyResponse.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyResponse.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:35:07 2006
@@ -1 +1,4 @@
 Rev
+Revision
+Date
+Id

Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyResponseImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyResponseImpl.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:35:07 2006
@@ -1 +1,4 @@
 Rev
+Revision
+Date
+Id

Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/PersistentSearchControl.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Sun Feb 19 19:35:07 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id

Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/Referral.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/Referral.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:35:07 2006
@@ -1 +1,4 @@
 Rev
+Revision
+Date
+Id

Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ReferralImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ReferralImpl.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:35:07 2006
@@ -1 +1,4 @@
 Rev
+Revision
+Date
+Id

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/Request.java
URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/Request.java?rev=379008&r1=379007&r2=379008&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/Request.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/Request.java Sun Feb 19 19:35:07 2006
@@ -1,34 +1,34 @@
-/*
- *   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;
-
-
-/**
- * Ldap protocol request messages derive from this super interface.
- * 
- * @author  Apache Directory Project
- * @version $Rev$
- */
-public interface Request extends Message
-{
-    /**
-     * Tests to see if this Request produces one or more response types.
-     * 
-     * @return true if a response can be expected, false otherwise.
-     */
-    boolean 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;
+
+
+/**
+ * Ldap protocol request messages derive from this super interface.
+ * 
+ * @author  Apache Directory Project
+ * @version $Rev$
+ */
+public interface Request extends Message
+{
+    /**
+     * Tests to see if this Request produces one or more response types.
+     * 
+     * @return true if a response can be expected, false otherwise.
+     */
+    boolean hasResponse();
+}

Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/Request.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/Request.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:35:07 2006
@@ -1 +1,4 @@
 Rev
+Revision
+Date
+Id

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/Response.java
URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/Response.java?rev=379008&r1=379007&r2=379008&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/Response.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/Response.java Sun Feb 19 19:35:07 2006
@@ -1,52 +1,52 @@
-/*
- *   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: Response.java,v 1.6 2003/05/02 04:03:13 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;
-
-
-/**
- * Super interface used as a marker for all protocol response type messages.
- * Note that only 4 response interfaces directly extend this interfaces. They
- * are listed below:
- * 
    - *
  • UnbindResponse
  • - *
  • AbandonResponse
  • - *
  • SearchResponseEntry
  • - *
  • SearchResponseReference
  • - *
- *
- * All other responses derive from the ResultResponse interface. These responses - * unlike the three above have an LdapResult component. The ResultResponse - * interface takes this into account providing a Response with an LdapResult - * property. - * - * @author Alex Karasulu - * @author $Author: akarasulu $ - * @version $Revision$ - */ -public interface Response extends Message -{ -} +/* + * 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; + + +/** + * Super interface used as a marker for all protocol response type messages. + * Note that only 4 response interfaces directly extend this interfaces. They + * are listed below: + *
    + *
  • UnbindResponse
  • + *
  • AbandonResponse
  • + *
  • SearchResponseEntry
  • + *
  • SearchResponseReference
  • + *
+ *
+ * All other responses derive from the ResultResponse interface. These responses + * unlike the three above have an LdapResult component. The ResultResponse + * interface takes this into account providing a Response with an LdapResult + * property. + * + * @author Alex Karasulu + * @author $Author: akarasulu $ + * @version $Revision$ + */ +public interface Response extends Message +{ +} Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/Response.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/Response.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -1 +1,4 @@ Rev +Revision +Date +Id Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultCodeEnum.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultCodeEnum.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -1 +1,4 @@ Rev +Revision +Date +Id Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultResponse.java URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultResponse.java?rev=379008&r1=379007&r2=379008&view=diff ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultResponse.java (original) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultResponse.java Sun Feb 19 19:35:07 2006 @@ -1,34 +1,34 @@ -/* - * 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; - - -/** - * An LDAP Response that contains an LDAPResult structure within it. - * - * @author Apache Directory Project - * @version $Revision$ - */ -public interface ResultResponse extends Response -{ - /** - * Gets the LdapResult components of this Response. - * - * @return the LdapResult for this Response. - */ - LdapResult getLdapResult(); -} +/* + * 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; + + +/** + * An LDAP Response that contains an LDAPResult structure within it. + * + * @author Apache Directory Project + * @version $Revision$ + */ +public interface ResultResponse extends Response +{ + /** + * Gets the LdapResult components of this Response. + * + * @return the LdapResult for this Response. + */ + LdapResult getLdapResult(); +} Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultResponse.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultResponse.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -1 +1,4 @@ Rev +Revision +Date +Id Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultResponseRequest.java ------------------------------------------------------------------------------ --- svn:keywords (added) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -0,0 +1,4 @@ +Rev +Revision +Date +Id Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ScopeEnum.java URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ScopeEnum.java?rev=379008&r1=379007&r2=379008&view=diff ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ScopeEnum.java (original) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ScopeEnum.java Sun Feb 19 19:35:07 2006 @@ -1,125 +1,125 @@ -/* - * 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 javax.naming.directory.SearchControls; - -import org.apache.directory.shared.ldap.util.ValuedEnum; - - -/** - * Type-safe scope parameter enumeration. - * - * @author Alex Karasulu - * @author $Author: akarasulu $ - * @version $Revision$ - */ -public class ScopeEnum extends ValuedEnum -{ - static final long serialVersionUID = 6354503944147675151L; - - /** Search scope parameter value for base object search */ - public static final int BASEOBJECT_VAL = SearchControls.OBJECT_SCOPE; - - /** Search scope parameter value for single level search */ - public static final int SINGLELEVEL_VAL = SearchControls.ONELEVEL_SCOPE; - - /** Search scope parameter value for whole subtree level search */ - public static final int WHOLESUBTREE_VAL = SearchControls.SUBTREE_SCOPE; - - /** LDAP search scope parameter value for base object search */ - public static final int BASEOBJECT_LDAPVAL = 0; - - /** LDAP search scope parameter value for single level search */ - public static final int SINGLELEVEL_LDAPVAL = 1; - - /** LDAP search scope parameter value for whole subtree level search */ - public static final int WHOLESUBTREE_LDAPVAL = 2; - - /** Search scope parameter enum for base object search */ - public static final ScopeEnum BASEOBJECT = new ScopeEnum( "BASEOBJECT", BASEOBJECT_VAL ); - - /** Search scope parameter enum for single level search */ - public static final ScopeEnum SINGLELEVEL = new ScopeEnum( "SINGLELEVEL", SINGLELEVEL_VAL ); - - /** Search scope parameter enum for whole subtree level search */ - public static final ScopeEnum WHOLESUBTREE = new ScopeEnum( "WHOLESUBTREE", WHOLESUBTREE_VAL ); - - - /** - * Private construct so no other instances can be created other than the - * public static constants in this class. - * - * @param a_name - * a string name for the enumeration value. - * @param a_value - * the integer value of the enumeration. - */ - private ScopeEnum(final String a_name, final int a_value) - { - super( a_name, a_value ); - } - - - /** - * Gets the type safe enumeration constant corresponding to a SearchControls - * scope value. - * - * @param a_controls - * the SearchControls whose scope value we convert to enum - * @return the SopeEnum for the scope int value - */ - public static ScopeEnum getScope( SearchControls a_controls ) - { - switch ( a_controls.getSearchScope() ) - { - case ( SearchControls.OBJECT_SCOPE ): - return BASEOBJECT; - case ( SearchControls.ONELEVEL_SCOPE ): - return SINGLELEVEL; - case ( SearchControls.SUBTREE_SCOPE ): - return WHOLESUBTREE; - default: - throw new IllegalArgumentException( "Unrecognized search scope in SearchControls: " - + a_controls.getSearchScope() ); - } - } - - - /** - * Gets the LdapValue for the scope enumeration as opposed to the JNDI value - * which is returned using getValue(). - * - * @return the LDAP enumeration value for the scope parameter on a search - * request. - */ - public int getLdapValue() - { - switch ( getValue() ) - { - case ( BASEOBJECT_VAL ): - return BASEOBJECT_LDAPVAL; - case ( SINGLELEVEL_VAL ): - return SINGLELEVEL_LDAPVAL; - case ( WHOLESUBTREE_VAL ): - return WHOLESUBTREE_LDAPVAL; - default: - throw new IllegalArgumentException( "Unrecognized value: " + getValue() ); - } - } -} +/* + * 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 javax.naming.directory.SearchControls; + +import org.apache.directory.shared.ldap.util.ValuedEnum; + + +/** + * Type-safe scope parameter enumeration. + * + * @author Alex Karasulu + * @author $Author: akarasulu $ + * @version $Revision$ + */ +public class ScopeEnum extends ValuedEnum +{ + static final long serialVersionUID = 6354503944147675151L; + + /** Search scope parameter value for base object search */ + public static final int BASEOBJECT_VAL = SearchControls.OBJECT_SCOPE; + + /** Search scope parameter value for single level search */ + public static final int SINGLELEVEL_VAL = SearchControls.ONELEVEL_SCOPE; + + /** Search scope parameter value for whole subtree level search */ + public static final int WHOLESUBTREE_VAL = SearchControls.SUBTREE_SCOPE; + + /** LDAP search scope parameter value for base object search */ + public static final int BASEOBJECT_LDAPVAL = 0; + + /** LDAP search scope parameter value for single level search */ + public static final int SINGLELEVEL_LDAPVAL = 1; + + /** LDAP search scope parameter value for whole subtree level search */ + public static final int WHOLESUBTREE_LDAPVAL = 2; + + /** Search scope parameter enum for base object search */ + public static final ScopeEnum BASEOBJECT = new ScopeEnum( "BASEOBJECT", BASEOBJECT_VAL ); + + /** Search scope parameter enum for single level search */ + public static final ScopeEnum SINGLELEVEL = new ScopeEnum( "SINGLELEVEL", SINGLELEVEL_VAL ); + + /** Search scope parameter enum for whole subtree level search */ + public static final ScopeEnum WHOLESUBTREE = new ScopeEnum( "WHOLESUBTREE", WHOLESUBTREE_VAL ); + + + /** + * Private construct so no other instances can be created other than the + * public static constants in this class. + * + * @param a_name + * a string name for the enumeration value. + * @param a_value + * the integer value of the enumeration. + */ + private ScopeEnum(final String a_name, final int a_value) + { + super( a_name, a_value ); + } + + + /** + * Gets the type safe enumeration constant corresponding to a SearchControls + * scope value. + * + * @param a_controls + * the SearchControls whose scope value we convert to enum + * @return the SopeEnum for the scope int value + */ + public static ScopeEnum getScope( SearchControls a_controls ) + { + switch ( a_controls.getSearchScope() ) + { + case ( SearchControls.OBJECT_SCOPE ): + return BASEOBJECT; + case ( SearchControls.ONELEVEL_SCOPE ): + return SINGLELEVEL; + case ( SearchControls.SUBTREE_SCOPE ): + return WHOLESUBTREE; + default: + throw new IllegalArgumentException( "Unrecognized search scope in SearchControls: " + + a_controls.getSearchScope() ); + } + } + + + /** + * Gets the LdapValue for the scope enumeration as opposed to the JNDI value + * which is returned using getValue(). + * + * @return the LDAP enumeration value for the scope parameter on a search + * request. + */ + public int getLdapValue() + { + switch ( getValue() ) + { + case ( BASEOBJECT_VAL ): + return BASEOBJECT_LDAPVAL; + case ( SINGLELEVEL_VAL ): + return SINGLELEVEL_LDAPVAL; + case ( WHOLESUBTREE_VAL ): + return WHOLESUBTREE_LDAPVAL; + default: + throw new IllegalArgumentException( "Unrecognized value: " + getValue() ); + } + } +} Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ScopeEnum.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ScopeEnum.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Sun Feb 19 19:35:07 2006 @@ -1 +1,4 @@ Rev +Revision +Date +Id