You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2004/10/01 08:20:16 UTC
svn commit: rev 47634 - incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve
Author: akarasulu
Date: Thu Sep 30 23:20:15 2004
New Revision: 47634
Added:
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/PartitionNexus.java
- copied, changed from rev 47436, incubator/directory/eve/trunk/backend/sandbox/backend-nexus-api/src/java/org/apache/ldap/server/nexus/BackendNexus.java
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/PartitionNexusImpl.java
- copied, changed from rev 47436, incubator/directory/eve/trunk/backend/sandbox/backend-nexus-impl/src/java/org/apache/ldap/server/nexus/impl/NexusModule.java
Modified:
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/BackingStore.java
Log:
Commit changes ...
o copied and renamed BackendNexus from sandbox to PartitionNexus
o copied and renamed NexusModule from sandbox to PartitionNexusImpl
o cleaned up code formating and style
o corrected packages and changed names classes to reflect the new names
Notes ...
o it might be worth while changing the name of PartitionNexusImpl to either
of the following:
- BasePartitionNexus
- PartitionNexusSingleton
- DefaultPartitionNexus
o we also should add the ASL 2 boilerplate and add javadoc tags
Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/BackingStore.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/BackingStore.java (original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/BackingStore.java Thu Sep 30 23:20:15 2004
@@ -60,8 +60,7 @@
* @param entry the entry to add to this BackingStore
* @throws NamingException if there are any problems
*/
- void add( String upName, Name normName, Attributes entry )
- throws NamingException;
+ void add( String upName, Name normName, Attributes entry ) throws NamingException;
/**
* Modifies an entry by adding, removing or replacing a set of attributes.
Copied: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/PartitionNexus.java (from rev 47436, incubator/directory/eve/trunk/backend/sandbox/backend-nexus-api/src/java/org/apache/ldap/server/nexus/BackendNexus.java)
==============================================================================
--- incubator/directory/eve/trunk/backend/sandbox/backend-nexus-api/src/java/org/apache/ldap/server/nexus/BackendNexus.java (original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/PartitionNexus.java Thu Sep 30 23:20:15 2004
@@ -1,303 +1,82 @@
-/*
- * Apache License
- * Version 2.0, January 2004
- * http://www.apache.org/licenses/
- *
- * TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
- *
- * 1. Definitions.
- *
- * "License" shall mean the terms and conditions for use, reproduction,
- * and distribution as defined by Sections 1 through 9 of this document.
- *
- * "Licensor" shall mean the copyright owner or entity authorized by
- * the copyright owner that is granting the License.
- *
- * "Legal Entity" shall mean the union of the acting entity and all
- * other entities that control, are controlled by, or are under common
- * control with that entity. For the purposes of this definition,
- * "control" means (i) the power, direct or indirect, to cause the
- * direction or management of such entity, whether by contract or
- * otherwise, or (ii) ownership of fifty percent (50%) or more of the
- * outstanding shares, or (iii) beneficial ownership of such entity.
- *
- * "You" (or "Your") shall mean an individual or Legal Entity
- * exercising permissions granted by this License.
- *
- * "Source" form shall mean the preferred form for making modifications,
- * including but not limited to software source code, documentation
- * source, and configuration files.
- *
- * "Object" form shall mean any form resulting from mechanical
- * transformation or translation of a Source form, including but
- * not limited to compiled object code, generated documentation,
- * and conversions to other media types.
- *
- * "Work" shall mean the work of authorship, whether in Source or
- * Object form, made available under the License, as indicated by a
- * copyright notice that is included in or attached to the work
- * (an example is provided in the Appendix below).
- *
- * "Derivative Works" shall mean any work, whether in Source or Object
- * form, that is based on (or derived from) the Work and for which the
- * editorial revisions, annotations, elaborations, or other modifications
- * represent, as a whole, an original work of authorship. For the purposes
- * of this License, Derivative Works shall not include works that remain
- * separable from, or merely link (or bind by name) to the interfaces of,
- * the Work and Derivative Works thereof.
- *
- * "Contribution" shall mean any work of authorship, including
- * the original version of the Work and any modifications or additions
- * to that Work or Derivative Works thereof, that is intentionally
- * submitted to Licensor for inclusion in the Work by the copyright owner
- * or by an individual or Legal Entity authorized to submit on behalf of
- * the copyright owner. For the purposes of this definition, "submitted"
- * means any form of electronic, verbal, or written communication sent
- * to the Licensor or its representatives, including but not limited to
- * communication on electronic mailing lists, source code control systems,
- * and issue tracking systems that are managed by, or on behalf of, the
- * Licensor for the purpose of discussing and improving the Work, but
- * excluding communication that is conspicuously marked or otherwise
- * designated in writing by the copyright owner as "Not a Contribution."
- *
- * "Contributor" shall mean Licensor and any individual or Legal Entity
- * on behalf of whom a Contribution has been received by Licensor and
- * subsequently incorporated within the Work.
- *
- * 2. Grant of Copyright License. Subject to the terms and conditions of
- * this License, each Contributor hereby grants to You a perpetual,
- * worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- * copyright license to reproduce, prepare Derivative Works of,
- * publicly display, publicly perform, sublicense, and distribute the
- * Work and such Derivative Works in Source or Object form.
- *
- * 3. Grant of Patent License. Subject to the terms and conditions of
- * this License, each Contributor hereby grants to You a perpetual,
- * worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- * (except as stated in this section) patent license to make, have made,
- * use, offer to sell, sell, import, and otherwise transfer the Work,
- * where such license applies only to those patent claims licensable
- * by such Contributor that are necessarily infringed by their
- * Contribution(s) alone or by combination of their Contribution(s)
- * with the Work to which such Contribution(s) was submitted. If You
- * institute patent litigation against any entity (including a
- * cross-claim or counterclaim in a lawsuit) alleging that the Work
- * or a Contribution incorporated within the Work constitutes direct
- * or contributory patent infringement, then any patent licenses
- * granted to You under this License for that Work shall terminate
- * as of the date such litigation is filed.
- *
- * 4. Redistribution. You may reproduce and distribute copies of the
- * Work or Derivative Works thereof in any medium, with or without
- * modifications, and in Source or Object form, provided that You
- * meet the following conditions:
- *
- * (a) You must give any other recipients of the Work or
- * Derivative Works a copy of this License; and
- *
- * (b) You must cause any modified files to carry prominent notices
- * stating that You changed the files; and
- *
- * (c) You must retain, in the Source form of any Derivative Works
- * that You distribute, all copyright, patent, trademark, and
- * attribution notices from the Source form of the Work,
- * excluding those notices that do not pertain to any part of
- * the Derivative Works; and
- *
- * (d) If the Work includes a "NOTICE" text file as part of its
- * distribution, then any Derivative Works that You distribute must
- * include a readable copy of the attribution notices contained
- * within such NOTICE file, excluding those notices that do not
- * pertain to any part of the Derivative Works, in at least one
- * of the following places: within a NOTICE text file distributed
- * as part of the Derivative Works; within the Source form or
- * documentation, if provided along with the Derivative Works; or,
- * within a display generated by the Derivative Works, if and
- * wherever such third-party notices normally appear. The contents
- * of the NOTICE file are for informational purposes only and
- * do not modify the License. You may add Your own attribution
- * notices within Derivative Works that You distribute, alongside
- * or as an addendum to the NOTICE text from the Work, provided
- * that such additional attribution notices cannot be construed
- * as modifying the License.
- *
- * You may add Your own copyright statement to Your modifications and
- * may provide additional or different license terms and conditions
- * for use, reproduction, or distribution of Your modifications, or
- * for any such Derivative Works as a whole, provided Your use,
- * reproduction, and distribution of the Work otherwise complies with
- * the conditions stated in this License.
- *
- * 5. Submission of Contributions. Unless You explicitly state otherwise,
- * any Contribution intentionally submitted for inclusion in the Work
- * by You to the Licensor shall be under the terms and conditions of
- * this License, without any additional terms or conditions.
- * Notwithstanding the above, nothing herein shall supersede or modify
- * the terms of any separate license agreement you may have executed
- * with Licensor regarding such Contributions.
- *
- * 6. Trademarks. This License does not grant permission to use the trade
- * names, trademarks, service marks, or product names of the Licensor,
- * except as required for reasonable and customary use in describing the
- * origin of the Work and reproducing the content of the NOTICE file.
- *
- * 7. Disclaimer of Warranty. Unless required by applicable law or
- * agreed to in writing, Licensor provides the Work (and each
- * Contributor provides its Contributions) on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied, including, without limitation, any warranties or conditions
- * of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- * PARTICULAR PURPOSE. You are solely responsible for determining the
- * appropriateness of using or redistributing the Work and assume any
- * risks associated with Your exercise of permissions under this License.
- *
- * 8. Limitation of Liability. In no event and under no legal theory,
- * whether in tort (including negligence), contract, or otherwise,
- * unless required by applicable law (such as deliberate and grossly
- * negligent acts) or agreed to in writing, shall any Contributor be
- * liable to You for damages, including any direct, indirect, special,
- * incidental, or consequential damages of any character arising as a
- * result of this License or out of the use or inability to use the
- * Work (including but not limited to damages for loss of goodwill,
- * work stoppage, computer failure or malfunction, or any and all
- * other commercial damages or losses), even if such Contributor
- * has been advised of the possibility of such damages.
- *
- * 9. Accepting Warranty or Additional Liability. While redistributing
- * the Work or Derivative Works thereof, You may choose to offer,
- * and charge a fee for, acceptance of support, warranty, indemnity,
- * or other liability obligations and/or rights consistent with this
- * License. However, in accepting such obligations, You may act only
- * on Your own behalf and on Your sole responsibility, not on behalf
- * of any other Contributor, and only if You agree to indemnify,
- * defend, and hold each Contributor harmless for any liability
- * incurred by, or claims asserted against, such Contributor by reason
- * of your accepting any such warranty or additional liability.
- *
- * END OF TERMS AND CONDITIONS
- *
- * APPENDIX: How to apply the Apache License to your work.
- *
- * To apply the Apache License to your work, attach the following
- * boilerplate notice, with the fields enclosed by brackets "[]"
- * replaced with your own identifying information. (Don't include
- * the brackets!) The text should be enclosed in the appropriate
- * comment syntax for the file format. We also recommend that a
- * file or class name and description of purpose be included on the
- * same "printed page" as the copyright notice for easier
- * identification within third-party archives.
- *
- * Copyright [yyyy] [name of copyright owner]
- *
- * 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: BackendNexus.java,v 1.1 2003/09/01 19:21:41 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.ldap.server.nexus ;
+package org.apache.eve;
-import java.util.Iterator ;
+import java.util.Iterator;
-import javax.naming.Name ;
-import javax.naming.NamingException ;
-import javax.naming.ldap.LdapContext ;
-import javax.naming.directory.Attributes ;
-
-import org.apache.ldap.server.backend.Backend ;
-import org.apache.ldap.server.backend.AtomicBackend ;
+import javax.naming.Name;
+import javax.naming.NamingException;
+import javax.naming.ldap.LdapContext;
+import javax.naming.directory.Attributes;
/**
- * The BackendNexus is a special type of Backend designed to hold all
- * AtomicBackends (or naming contexts) under one unified composite Backend.
- * Only one instance of a BackendNexus interface implementation will ever be
- * instantiated within the backend apparatus and this instance is used to
- * unify all the separate naming contexts mastered by AtomicBackends within
- * the system. The BackendNexus routes or proxies calls to the appropriate
- * AtomicBackend implementation based on namespace. It also provides some
- * extended operations for the backend apparatus like listing the various
- * naming contexts or partition suffixes within the system.
+ * The PartitionNexus is a special type of BackingStore designed to route
+ * BackingStore operations to ContextPartitions based on namespace to respective
+ * ContextPartitions attached to the nexus at the appropriate naming contexts.
+ * These naming contexts are also the suffixes of ContextPartitions. All
+ * entries within a ContextPartition have the same suffix. The PartitionNexus
+ * is a singleton where as ContextPartitions can be many hanging off of
+ * different contexts on the nexus.
+ *
+ * The PartitionNexus routes or proxies BackingStore calls to the appropriate
+ * PartitionContext implementation. It also provides some extended operations
+ * for the entire backend apparatus like listing the various naming contexts or
+ * partition suffixes within the system. The nexus is also responsibe for
+ * returning the entry Attributes for the root DSE when the approapriate search
+ * is conducted: empty filter String and base scope search.
+ *
*
- * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
- * @author $Author: akarasulu $
- * @version $Revision: 1.1 $
*/
-public interface BackendNexus
- extends Backend
+public interface PartitionNexus extends BackingStore
{
/**
- * Role of this service interface as mandated by the avalon framework.
- */
- String ROLE = BackendNexus.class.getName() ;
-
- /**
* Gets the LdapContext associated with the calling thread.
*
* @return The LdapContext associated with the thread of execution or null
* if no context is associated with the calling thread.
*/
- LdapContext getLdapContext() ;
+ LdapContext getLdapContext();
/**
* Gets the most significant Dn that exists within the server for any Dn.
*
- * @param a_dn the normalized distinguished name to use for matching.
- * @param a_normalized boolean if true cause the return of a normalized Dn,
+ * @param dn the normalized distinguished name to use for matching.
+ * @param normalized boolean if true cause the return of a normalized Dn,
* if false it returns the original user provided distinguished name for
* the matched portion of the Dn as it was provided on entry creation.
- * @return a distinguished name representing the matching portion of a_dn,
+ * @return a distinguished name representing the matching portion of dn,
* as originally provided by the user on creation of the matched entry or
* the empty string distinguished name if no match was found.
* @throws NamingException if there are any problems
*/
- Name getMatchedDn( Name a_dn, boolean a_normalized )
- throws NamingException ;
+ Name getMatchedDn( Name dn, boolean normalized ) throws NamingException;
/**
* Gets the distinguished name of the suffix for the naming context that
* would hold a distinguished name or the empty string Dn if a naming
* context is not associated with the name.
*
- * @param a_dn to use for finding a suffix.
- * @param a_normalized if true causes the return of a normalized Dn, but
+ * @param dn to use for finding a suffix.
+ * @param normalized if true causes the return of a normalized Dn, but
* if false it returns the original user provided distinguished name for
* the suffix Dn as it was provided on suffix entry creation.
- * @return the suffix portion of a_dn, or the valid empty string Dn if no
- * naming context was found for a_dn.
+ * @return the suffix portion of dn, or the valid empty string Dn if no
+ * naming context was found for dn.
* @throws NamingException if there are any problems
*/
- Name getSuffix( Name a_dn, boolean a_normalized ) throws NamingException ;
+ Name getSuffix( Name dn, boolean normalized ) throws NamingException;
/**
* Gets an iteration over the Name suffixes of the Backends managed by this
* BackendNexus.
*
- * @param a_normalized if true the returned Iterator contains normalized Dn
+ * @param normalized if true the returned Iterator contains normalized Dn
* but, if false, it returns the original user provided distinguished names
* in the Iterator.
- * @return Iteration over AtomicBackend suffix names as Names.
+ * @return Iteration over ContextPartition suffix names as Names.
* @throws NamingException if there are any problems
*/
- Iterator listSuffixes( boolean a_normalized ) throws NamingException ;
+ Iterator listSuffixes( boolean normalized ) throws NamingException;
/**
* Looks up an entry by distinguished name. This is a simplified version
@@ -307,49 +86,49 @@
*
* NOTE: This method is here in the nexus and not within the Backend
* interface. This is due to the fact that attribute selection by name
- * using the second parameter a_attrIds will be implemented after the call
+ * using the second parameter attrIds will be implemented after the call
* to a backend. Hence selection of the correct set of attributes to return
* is not a responsibility of a Backend module.
*
- * @param a_dn the normalized distinguished name of the object to lookup
- * @param a_attrIds the set of attributes to return
+ * @param dn the normalized distinguished name of the object to lookup
+ * @param attrIds the set of attributes to return
* @return an Attributes object representing the entry
* @throws NamingException if there are any problems
*/
- Attributes lookup( Name a_dn, String [] a_attrIds ) throws NamingException ;
+ Attributes lookup( Name dn, String [] attrIds ) throws NamingException;
/**
* Gets the RootDSE associated with this BackendNexus.
*
* @return the Attributes contained within the Root DSA Entry.
*/
- Attributes getRootDSE() ;
+ Attributes getRootDSE();
/**
- * Registers an AtomicBackend with this BackendManager. Called by each
- * AtomicBackend implementation after it has started to register for
+ * Registers an ContextPartition with this BackendManager. Called by each
+ * ContextPartition implementation after it has started to register for
* backend operation calls. This method effectively puts the
- * AtomicBackend's naming context online.
+ * ContextPartition's naming context online.
*
* Operations against the naming context should result in an LDAP BUSY
* result code in the response if the naming context is not online.
*
- * @param a_backend AtomicBackend component to register with this
+ * @param partition ContextPartition component to register with this
* BackendNexus.
*/
- void register( AtomicBackend a_backend ) ;
+ void register( ContextPartition partition );
/**
- * Unregisters an AtomicBackend with this BackendManager. Called for each
+ * Unregisters an ContextPartition with this BackendManager. Called for each
* registered Backend right befor it is to be stopped. This prevents
* protocol server requests from reaching the Backend and effectively puts
- * the AtomicBackend's naming context offline.
+ * the ContextPartition's naming context offline.
*
* Operations against the naming context should result in an LDAP BUSY
* result code in the response if the naming context is not online.
*
- * @param a_backend AtomicBackend component to unregister with this
+ * @param partition ContextPartition component to unregister with this
* BackendNexus.
*/
- void unregister( AtomicBackend a_backend ) ;
+ void unregister( ContextPartition partition );
}
Copied: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/PartitionNexusImpl.java (from rev 47436, incubator/directory/eve/trunk/backend/sandbox/backend-nexus-impl/src/java/org/apache/ldap/server/nexus/impl/NexusModule.java)
==============================================================================
--- incubator/directory/eve/trunk/backend/sandbox/backend-nexus-impl/src/java/org/apache/ldap/server/nexus/impl/NexusModule.java (original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/PartitionNexusImpl.java Thu Sep 30 23:20:15 2004
@@ -1,207 +1,207 @@
-/*
- * Apache License
- * Version 2.0, January 2004
- * http://www.apache.org/licenses/
- *
- * TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
- *
- * 1. Definitions.
- *
- * "License" shall mean the terms and conditions for use, reproduction,
- * and distribution as defined by Sections 1 through 9 of this document.
- *
- * "Licensor" shall mean the copyright owner or entity authorized by
- * the copyright owner that is granting the License.
- *
- * "Legal Entity" shall mean the union of the acting entity and all
- * other entities that control, are controlled by, or are under common
- * control with that entity. For the purposes of this definition,
- * "control" means (i) the power, direct or indirect, to cause the
- * direction or management of such entity, whether by contract or
- * otherwise, or (ii) ownership of fifty percent (50%) or more of the
- * outstanding shares, or (iii) beneficial ownership of such entity.
- *
- * "You" (or "Your") shall mean an individual or Legal Entity
- * exercising permissions granted by this License.
- *
- * "Source" form shall mean the preferred form for making modifications,
- * including but not limited to software source code, documentation
- * source, and configuration files.
- *
- * "Object" form shall mean any form resulting from mechanical
- * transformation or translation of a Source form, including but
- * not limited to compiled object code, generated documentation,
- * and conversions to other media types.
- *
- * "Work" shall mean the work of authorship, whether in Source or
- * Object form, made available under the License, as indicated by a
- * copyright notice that is included in or attached to the work
- * (an example is provided in the Appendix below).
- *
- * "Derivative Works" shall mean any work, whether in Source or Object
- * form, that is based on (or derived from) the Work and for which the
- * editorial revisions, annotations, elaborations, or other modifications
- * represent, as a whole, an original work of authorship. For the purposes
- * of this License, Derivative Works shall not include works that remain
- * separable from, or merely link (or bind by name) to the interfaces of,
- * the Work and Derivative Works thereof.
- *
- * "Contribution" shall mean any work of authorship, including
- * the original version of the Work and any modifications or additions
- * to that Work or Derivative Works thereof, that is intentionally
- * submitted to Licensor for inclusion in the Work by the copyright owner
- * or by an individual or Legal Entity authorized to submit on behalf of
- * the copyright owner. For the purposes of this definition, "submitted"
- * means any form of electronic, verbal, or written communication sent
- * to the Licensor or its representatives, including but not limited to
- * communication on electronic mailing lists, source code control systems,
- * and issue tracking systems that are managed by, or on behalf of, the
- * Licensor for the purpose of discussing and improving the Work, but
- * excluding communication that is conspicuously marked or otherwise
- * designated in writing by the copyright owner as "Not a Contribution."
- *
- * "Contributor" shall mean Licensor and any individual or Legal Entity
- * on behalf of whom a Contribution has been received by Licensor and
- * subsequently incorporated within the Work.
- *
- * 2. Grant of Copyright License. Subject to the terms and conditions of
- * this License, each Contributor hereby grants to You a perpetual,
- * worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- * copyright license to reproduce, prepare Derivative Works of,
- * publicly display, publicly perform, sublicense, and distribute the
- * Work and such Derivative Works in Source or Object form.
- *
- * 3. Grant of Patent License. Subject to the terms and conditions of
- * this License, each Contributor hereby grants to You a perpetual,
- * worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- * (except as stated in this section) patent license to make, have made,
- * use, offer to sell, sell, import, and otherwise transfer the Work,
- * where such license applies only to those patent claims licensable
- * by such Contributor that are necessarily infringed by their
- * Contribution(s) alone or by combination of their Contribution(s)
- * with the Work to which such Contribution(s) was submitted. If You
- * institute patent litigation against any entity (including a
- * cross-claim or counterclaim in a lawsuit) alleging that the Work
- * or a Contribution incorporated within the Work constitutes direct
- * or contributory patent infringement, then any patent licenses
- * granted to You under this License for that Work shall terminate
- * as of the date such litigation is filed.
- *
- * 4. Redistribution. You may reproduce and distribute copies of the
- * Work or Derivative Works thereof in any medium, with or without
- * modifications, and in Source or Object form, provided that You
- * meet the following conditions:
- *
- * (a) You must give any other recipients of the Work or
- * Derivative Works a copy of this License; and
- *
- * (b) You must cause any modified files to carry prominent notices
- * stating that You changed the files; and
- *
- * (c) You must retain, in the Source form of any Derivative Works
- * that You distribute, all copyright, patent, trademark, and
- * attribution notices from the Source form of the Work,
- * excluding those notices that do not pertain to any part of
- * the Derivative Works; and
- *
- * (d) If the Work includes a "NOTICE" text file as part of its
- * distribution, then any Derivative Works that You distribute must
- * include a readable copy of the attribution notices contained
- * within such NOTICE file, excluding those notices that do not
- * pertain to any part of the Derivative Works, in at least one
- * of the following places: within a NOTICE text file distributed
- * as part of the Derivative Works; within the Source form or
- * documentation, if provided along with the Derivative Works; or,
- * within a display generated by the Derivative Works, if and
- * wherever such third-party notices normally appear. The contents
- * of the NOTICE file are for informational purposes only and
- * do not modify the License. You may add Your own attribution
- * notices within Derivative Works that You distribute, alongside
- * or as an addendum to the NOTICE text from the Work, provided
- * that such additional attribution notices cannot be construed
- * as modifying the License.
- *
- * You may add Your own copyright statement to Your modifications and
- * may provide additional or different license terms and conditions
- * for use, reproduction, or distribution of Your modifications, or
- * for any such Derivative Works as a whole, provided Your use,
- * reproduction, and distribution of the Work otherwise complies with
- * the conditions stated in this License.
- *
- * 5. Submission of Contributions. Unless You explicitly state otherwise,
- * any Contribution intentionally submitted for inclusion in the Work
- * by You to the Licensor shall be under the terms and conditions of
- * this License, without any additional terms or conditions.
- * Notwithstanding the above, nothing herein shall supersede or modify
- * the terms of any separate license agreement you may have executed
- * with Licensor regarding such Contributions.
- *
- * 6. Trademarks. This License does not grant permission to use the trade
- * names, trademarks, service marks, or product names of the Licensor,
- * except as required for reasonable and customary use in describing the
- * origin of the Work and reproducing the content of the NOTICE file.
- *
- * 7. Disclaimer of Warranty. Unless required by applicable law or
- * agreed to in writing, Licensor provides the Work (and each
- * Contributor provides its Contributions) on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied, including, without limitation, any warranties or conditions
- * of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- * PARTICULAR PURPOSE. You are solely responsible for determining the
- * appropriateness of using or redistributing the Work and assume any
- * risks associated with Your exercise of permissions under this License.
- *
- * 8. Limitation of Liability. In no event and under no legal theory,
- * whether in tort (including negligence), contract, or otherwise,
- * unless required by applicable law (such as deliberate and grossly
- * negligent acts) or agreed to in writing, shall any Contributor be
- * liable to You for damages, including any direct, indirect, special,
- * incidental, or consequential damages of any character arising as a
- * result of this License or out of the use or inability to use the
- * Work (including but not limited to damages for loss of goodwill,
- * work stoppage, computer failure or malfunction, or any and all
- * other commercial damages or losses), even if such Contributor
- * has been advised of the possibility of such damages.
- *
- * 9. Accepting Warranty or Additional Liability. While redistributing
- * the Work or Derivative Works thereof, You may choose to offer,
- * and charge a fee for, acceptance of support, warranty, indemnity,
- * or other liability obligations and/or rights consistent with this
- * License. However, in accepting such obligations, You may act only
- * on Your own behalf and on Your sole responsibility, not on behalf
- * of any other Contributor, and only if You agree to indemnify,
- * defend, and hold each Contributor harmless for any liability
- * incurred by, or claims asserted against, such Contributor by reason
- * of your accepting any such warranty or additional liability.
- *
- * END OF TERMS AND CONDITIONS
- *
- * APPENDIX: How to apply the Apache License to your work.
- *
- * To apply the Apache License to your work, attach the following
- * boilerplate notice, with the fields enclosed by brackets "[]"
- * replaced with your own identifying information. (Don't include
- * the brackets!) The text should be enclosed in the appropriate
- * comment syntax for the file format. We also recommend that a
- * file or class name and description of purpose be included on the
- * same "printed page" as the copyright notice for easier
- * identification within third-party archives.
- *
- * Copyright [yyyy] [name of copyright owner]
- *
- * 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.
- *
- */
+/*
+ * Apache License
+ * Version 2.0, January 2004
+ * http://www.apache.org/licenses/
+ *
+ * TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+ *
+ * 1. Definitions.
+ *
+ * "License" shall mean the terms and conditions for use, reproduction,
+ * and distribution as defined by Sections 1 through 9 of this document.
+ *
+ * "Licensor" shall mean the copyright owner or entity authorized by
+ * the copyright owner that is granting the License.
+ *
+ * "Legal Entity" shall mean the union of the acting entity and all
+ * other entities that control, are controlled by, or are under common
+ * control with that entity. For the purposes of this definition,
+ * "control" means (i) the power, direct or indirect, to cause the
+ * direction or management of such entity, whether by contract or
+ * otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ * outstanding shares, or (iii) beneficial ownership of such entity.
+ *
+ * "You" (or "Your") shall mean an individual or Legal Entity
+ * exercising permissions granted by this License.
+ *
+ * "Source" form shall mean the preferred form for making modifications,
+ * including but not limited to software source code, documentation
+ * source, and configuration files.
+ *
+ * "Object" form shall mean any form resulting from mechanical
+ * transformation or translation of a Source form, including but
+ * not limited to compiled object code, generated documentation,
+ * and conversions to other media types.
+ *
+ * "Work" shall mean the work of authorship, whether in Source or
+ * Object form, made available under the License, as indicated by a
+ * copyright notice that is included in or attached to the work
+ * (an example is provided in the Appendix below).
+ *
+ * "Derivative Works" shall mean any work, whether in Source or Object
+ * form, that is based on (or derived from) the Work and for which the
+ * editorial revisions, annotations, elaborations, or other modifications
+ * represent, as a whole, an original work of authorship. For the purposes
+ * of this License, Derivative Works shall not include works that remain
+ * separable from, or merely link (or bind by name) to the interfaces of,
+ * the Work and Derivative Works thereof.
+ *
+ * "Contribution" shall mean any work of authorship, including
+ * the original version of the Work and any modifications or additions
+ * to that Work or Derivative Works thereof, that is intentionally
+ * submitted to Licensor for inclusion in the Work by the copyright owner
+ * or by an individual or Legal Entity authorized to submit on behalf of
+ * the copyright owner. For the purposes of this definition, "submitted"
+ * means any form of electronic, verbal, or written communication sent
+ * to the Licensor or its representatives, including but not limited to
+ * communication on electronic mailing lists, source code control systems,
+ * and issue tracking systems that are managed by, or on behalf of, the
+ * Licensor for the purpose of discussing and improving the Work, but
+ * excluding communication that is conspicuously marked or otherwise
+ * designated in writing by the copyright owner as "Not a Contribution."
+ *
+ * "Contributor" shall mean Licensor and any individual or Legal Entity
+ * on behalf of whom a Contribution has been received by Licensor and
+ * subsequently incorporated within the Work.
+ *
+ * 2. Grant of Copyright License. Subject to the terms and conditions of
+ * this License, each Contributor hereby grants to You a perpetual,
+ * worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ * copyright license to reproduce, prepare Derivative Works of,
+ * publicly display, publicly perform, sublicense, and distribute the
+ * Work and such Derivative Works in Source or Object form.
+ *
+ * 3. Grant of Patent License. Subject to the terms and conditions of
+ * this License, each Contributor hereby grants to You a perpetual,
+ * worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ * (except as stated in this section) patent license to make, have made,
+ * use, offer to sell, sell, import, and otherwise transfer the Work,
+ * where such license applies only to those patent claims licensable
+ * by such Contributor that are necessarily infringed by their
+ * Contribution(s) alone or by combination of their Contribution(s)
+ * with the Work to which such Contribution(s) was submitted. If You
+ * institute patent litigation against any entity (including a
+ * cross-claim or counterclaim in a lawsuit) alleging that the Work
+ * or a Contribution incorporated within the Work constitutes direct
+ * or contributory patent infringement, then any patent licenses
+ * granted to You under this License for that Work shall terminate
+ * as of the date such litigation is filed.
+ *
+ * 4. Redistribution. You may reproduce and distribute copies of the
+ * Work or Derivative Works thereof in any medium, with or without
+ * modifications, and in Source or Object form, provided that You
+ * meet the following conditions:
+ *
+ * (a) You must give any other recipients of the Work or
+ * Derivative Works a copy of this License; and
+ *
+ * (b) You must cause any modified files to carry prominent notices
+ * stating that You changed the files; and
+ *
+ * (c) You must retain, in the Source form of any Derivative Works
+ * that You distribute, all copyright, patent, trademark, and
+ * attribution notices from the Source form of the Work,
+ * excluding those notices that do not pertain to any part of
+ * the Derivative Works; and
+ *
+ * (d) If the Work includes a "NOTICE" text file as part of its
+ * distribution, then any Derivative Works that You distribute must
+ * include a readable copy of the attribution notices contained
+ * within such NOTICE file, excluding those notices that do not
+ * pertain to any part of the Derivative Works, in at least one
+ * of the following places: within a NOTICE text file distributed
+ * as part of the Derivative Works; within the Source form or
+ * documentation, if provided along with the Derivative Works; or,
+ * within a display generated by the Derivative Works, if and
+ * wherever such third-party notices normally appear. The contents
+ * of the NOTICE file are for informational purposes only and
+ * do not modify the License. You may add Your own attribution
+ * notices within Derivative Works that You distribute, alongside
+ * or as an addendum to the NOTICE text from the Work, provided
+ * that such additional attribution notices cannot be construed
+ * as modifying the License.
+ *
+ * You may add Your own copyright statement to Your modifications and
+ * may provide additional or different license terms and conditions
+ * for use, reproduction, or distribution of Your modifications, or
+ * for any such Derivative Works as a whole, provided Your use,
+ * reproduction, and distribution of the Work otherwise complies with
+ * the conditions stated in this License.
+ *
+ * 5. Submission of Contributions. Unless You explicitly state otherwise,
+ * any Contribution intentionally submitted for inclusion in the Work
+ * by You to the Licensor shall be under the terms and conditions of
+ * this License, without any additional terms or conditions.
+ * Notwithstanding the above, nothing herein shall supersede or modify
+ * the terms of any separate license agreement you may have executed
+ * with Licensor regarding such Contributions.
+ *
+ * 6. Trademarks. This License does not grant permission to use the trade
+ * names, trademarks, service marks, or product names of the Licensor,
+ * except as required for reasonable and customary use in describing the
+ * origin of the Work and reproducing the content of the NOTICE file.
+ *
+ * 7. Disclaimer of Warranty. Unless required by applicable law or
+ * agreed to in writing, Licensor provides the Work (and each
+ * Contributor provides its Contributions) on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied, including, without limitation, any warranties or conditions
+ * of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ * PARTICULAR PURPOSE. You are solely responsible for determining the
+ * appropriateness of using or redistributing the Work and assume any
+ * risks associated with Your exercise of permissions under this License.
+ *
+ * 8. Limitation of Liability. In no event and under no legal theory,
+ * whether in tort (including negligence), contract, or otherwise,
+ * unless required by applicable law (such as deliberate and grossly
+ * negligent acts) or agreed to in writing, shall any Contributor be
+ * liable to You for damages, including any direct, indirect, special,
+ * incidental, or consequential damages of any character arising as a
+ * result of this License or out of the use or inability to use the
+ * Work (including but not limited to damages for loss of goodwill,
+ * work stoppage, computer failure or malfunction, or any and all
+ * other commercial damages or losses), even if such Contributor
+ * has been advised of the possibility of such damages.
+ *
+ * 9. Accepting Warranty or Additional Liability. While redistributing
+ * the Work or Derivative Works thereof, You may choose to offer,
+ * and charge a fee for, acceptance of support, warranty, indemnity,
+ * or other liability obligations and/or rights consistent with this
+ * License. However, in accepting such obligations, You may act only
+ * on Your own behalf and on Your sole responsibility, not on behalf
+ * of any other Contributor, and only if You agree to indemnify,
+ * defend, and hold each Contributor harmless for any liability
+ * incurred by, or claims asserted against, such Contributor by reason
+ * of your accepting any such warranty or additional liability.
+ *
+ * END OF TERMS AND CONDITIONS
+ *
+ * APPENDIX: How to apply the Apache License to your work.
+ *
+ * To apply the Apache License to your work, attach the following
+ * boilerplate notice, with the fields enclosed by brackets "[]"
+ * replaced with your own identifying information. (Don't include
+ * the brackets!) The text should be enclosed in the appropriate
+ * comment syntax for the file format. We also recommend that a
+ * file or class name and description of purpose be included on the
+ * same "printed page" as the copyright notice for easier
+ * identification within third-party archives.
+ *
+ * Copyright [yyyy] [name of copyright owner]
+ *
+ * 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: NexusModule.java,v 1.8 2003/11/26 06:14:41 akarasulu Exp $
@@ -211,70 +211,54 @@
* -- any LDAPd project for copyright and distribution information. --
*
*/
-package org.apache.ldap.server.nexus.impl ;
+package org.apache.eve;
-import java.util.HashMap ;
-import java.util.Iterator ;
-import java.util.Hashtable ;
-import java.util.Collections ;
-
-import javax.naming.Name ;
-import javax.naming.ldap.Control ;
-import javax.naming.NamingException ;
-import javax.naming.ldap.LdapContext ;
-import javax.naming.NamingEnumeration ;
-import javax.naming.directory.Attributes ;
-import javax.naming.NameNotFoundException ;
-import javax.naming.directory.SearchControls ;
-import javax.naming.directory.ModificationItem ;
-
-import org.apache.avalon.framework.service.Serviceable ;
-import org.apache.avalon.framework.service.ServiceManager ;
-import org.apache.avalon.framework.service.ServiceException ;
+import java.util.*;
-import org.apache.ldap.common.filter.ExprNode ;
-import org.apache.ldap.common.NotImplementedException ;
+import javax.naming.Name;
+import javax.naming.NamingException;
+import javax.naming.ldap.LdapContext;
+import javax.naming.NamingEnumeration;
+import javax.naming.directory.Attributes;
+import javax.naming.NameNotFoundException;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.ModificationItem;
-import org.apache.ldap.server.nexus.BackendNexus ;
-import org.apache.ldap.server.backend.AtomicBackend ;
+import org.apache.ldap.common.filter.ExprNode;
+import org.apache.ldap.common.NotImplementedException;
/**
- * BackendNexus implementing LDAPd Module.
+ * A nexus for partitions dedicated for storing entries specific to a naming
+ * context.
*
- * @avalon.component name="backend-nexus" lifestyle="singleton"
- * @avalon.service type="org.apache.ldap.server.nexus.BackendNexus"
- * version="1.0"
- *
- * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
- * @author $Author: akarasulu $
- * @version $Revision: 1.8 $
*/
-public class NexusModule
- implements BackendNexus, Serviceable
+public class PartitionNexusImpl implements PartitionNexus
{
/** Handle on the singleton instance of this class within the entire JVM. */
- private static NexusModule s_singleton = null ;
+ private static PartitionNexusImpl s_singleton = null;
/** the system backend */
- private AtomicBackend m_system ;
+ private ContextPartition system;
/** the backends keyed by normalized suffix strings */
- private HashMap m_backends = new HashMap() ;
+ private HashMap backends = new HashMap();
/**
* Default constructor that checks to make sure that there is only one
* instance of this class within the entire JVM.
*/
- public NexusModule()
+ public PartitionNexusImpl( ContextPartition system )
{
if ( null != s_singleton )
{
- throw new IllegalStateException() ;
+ throw new IllegalStateException();
}
- s_singleton = this ;
+ s_singleton = this;
+ this.system = system;
+ register( this.system );
}
@@ -284,73 +268,71 @@
/**
- * @see org.apache.ldap.server.backend.BackendNexus#getLdapContext()
+ * @see PartitionNexus#getLdapContext()
*/
public LdapContext getLdapContext()
{
- throw new NotImplementedException() ;
+ throw new NotImplementedException();
}
/**
- * @see org.apache.ldap.server.backend.BackendNexus#getMatchedDn(javax.naming.Name,
+ * @see PartitionNexus#getMatchedDn(javax.naming.Name,
* boolean)
*/
- public Name getMatchedDn( Name a_dn, boolean a_normalized )
- throws NamingException
+ public Name getMatchedDn( Name dn, boolean normalized ) throws NamingException
{
- throw new NotImplementedException() ;
+ throw new NotImplementedException();
}
/**
- * @see org.apache.ldap.server.backend.BackendNexus#getSuffix(javax.naming.Name,
+ * @see PartitionNexus#getSuffix(javax.naming.Name,
* boolean)
*/
- public Name getSuffix( Name a_dn, boolean a_normalized )
- throws NamingException
+ public Name getSuffix( Name dn, boolean normalized ) throws NamingException
{
- AtomicBackend l_backend = getBackend( a_dn ) ;
- return l_backend.getSuffix( a_normalized ) ;
+ ContextPartition backend = getBackend( dn );
+ return backend.getSuffix( normalized );
}
/**
- * @see org.apache.ldap.server.backend.BackendNexus#listSuffixes(boolean)
+ * @see PartitionNexus#listSuffixes(boolean)
*/
- public Iterator listSuffixes( boolean a_normalized )
+ public Iterator listSuffixes( boolean normalized )
throws NamingException
{
- return Collections.unmodifiableSet( m_backends.keySet() ).iterator() ;
+ return Collections.unmodifiableSet( backends.keySet() ).iterator();
}
/**
- * @see org.apache.ldap.server.backend.BackendNexus#getRootDSE()
+ * @see PartitionNexus#getRootDSE()
*/
public Attributes getRootDSE()
{
- throw new NotImplementedException() ;
+ throw new NotImplementedException();
}
/**
- * @see org.apache.ldap.server.backend.BackendNexus#register(
- * org.apache.ldap.server.backend.AtomicBackend)
+ * @see PartitionNexus#register(
+ * ContextPartition)
*/
- public void register( AtomicBackend a_backend )
+ public void register( ContextPartition backend )
{
- m_backends.put( a_backend.getSuffix( true ).toString(), a_backend ) ;
+ backends.put( backend.getSuffix( true ).toString(), backend );
}
/**
- * @see org.apache.ldap.server.backend.BackendNexus#unregister(
- * org.apache.ldap.server.backend.AtomicBackend)
+ * @see PartitionNexus#unregister(
+ * ContextPartition)
*/
- public void unregister( AtomicBackend a_backend )
+ public void unregister( ContextPartition backend )
{
- m_backends.remove( a_backend.getSuffix( true ).toString() ) ;
+ backends.remove( backend.getSuffix( true ).toString() );
}
@@ -360,149 +342,135 @@
/**
- * @see org.apache.ldap.server.backend.Backend#delete(javax.naming.Name)
+ * @see BackingStore#delete(javax.naming.Name)
*/
- public void delete( Name a_dn ) throws NamingException
+ public void delete( Name dn ) throws NamingException
{
- AtomicBackend l_backend = getBackend( a_dn ) ;
- l_backend.delete( a_dn ) ;
+ ContextPartition backend = getBackend( dn );
+ backend.delete( dn );
}
/**
- * @see org.apache.ldap.server.backend.Backend#add(javax.naming.Name,
- * javax.naming.directory.Attributes)
+ * @see BackingStore#add(String, Name, Attributes)
*/
- public void add( String a_updn, Name a_dn, Attributes an_entry )
- throws NamingException
+ public void add( String updn, Name dn, Attributes an_entry ) throws NamingException
{
- AtomicBackend l_backend = getBackend( a_dn ) ;
- l_backend.add( a_updn, a_dn, an_entry ) ;
+ ContextPartition backend = getBackend( dn );
+ backend.add( updn, dn, an_entry );
}
/**
- * @see org.apache.ldap.server.backend.Backend#modify(javax.naming.Name, int,
- * javax.naming.directory.Attributes)
+ * @see BackingStore#modify(Name, int,Attributes)
*/
- public void modify( Name a_dn, int a_modOp, Attributes a_mods )
- throws NamingException
+ public void modify( Name dn, int modOp, Attributes mods ) throws NamingException
{
- AtomicBackend l_backend = getBackend( a_dn ) ;
- l_backend.modify( a_dn, a_modOp, a_mods ) ;
+ ContextPartition backend = getBackend( dn );
+ backend.modify( dn, modOp, mods );
}
/**
- * @see org.apache.ldap.server.backend.Backend#modify(javax.naming.Name,
+ * @see BackingStore#modify(javax.naming.Name,
* javax.naming.directory.ModificationItem[])
*/
- public void modify( Name a_dn, ModificationItem[] a_mods )
- throws NamingException
+ public void modify( Name dn, ModificationItem[] mods ) throws NamingException
{
- AtomicBackend l_backend = getBackend( a_dn ) ;
- l_backend.modify( a_dn, a_mods ) ;
+ ContextPartition backend = getBackend( dn );
+ backend.modify( dn, mods );
}
/**
- * @see org.apache.ldap.server.backend.Backend#list(javax.naming.Name)
+ * @see BackingStore#list(javax.naming.Name)
*/
- public NamingEnumeration list( Name a_base ) throws NamingException
+ public NamingEnumeration list( Name base ) throws NamingException
{
- AtomicBackend l_backend = getBackend( a_base ) ;
- return l_backend.list( a_base ) ;
+ ContextPartition backend = getBackend( base );
+ return backend.list( base );
}
/**
- * @see org.apache.ldap.server.backend.Backend#search(javax.naming.Name,
- * java.util.Hashtable, org.apache.ldap.common.filter.ExprNode,
- * javax.naming.ldap.Control[], javax.naming.directory.SearchControls)
+ * @see BackingStore#search(Name, Map, ExprNode, SearchControls)
*/
- public NamingEnumeration search( Name a_base, Hashtable a_env,
- ExprNode a_filter, Control [] a_reqCtls, SearchControls a_searchCtls )
+ public NamingEnumeration search( Name base, Map env, ExprNode filter,
+ SearchControls searchCtls )
throws NamingException
{
- AtomicBackend l_backend = getBackend( a_base ) ;
- return l_backend.search( a_base, a_env, a_filter,
- a_reqCtls, a_searchCtls ) ;
+ ContextPartition backend = getBackend( base );
+ return backend.search( base, env, filter, searchCtls );
}
/**
- * @see org.apache.ldap.server.backend.Backend#lookup(javax.naming.Name,
- * java.lang.String)
+ * @see BackingStore#lookup(Name)
*/
- public Attributes lookup( Name a_dn, String [] a_attrIds )
- throws NamingException
+ public Attributes lookup( Name dn, String [] attrIds ) throws NamingException
{
- throw new NotImplementedException() ;
+ throw new NotImplementedException();
}
/**
- * @see org.apache.ldap.server.backend.Backend#lookup(javax.naming.Name)
+ * @see BackingStore#lookup(javax.naming.Name)
*/
- public Attributes lookup( Name a_dn ) throws NamingException
+ public Attributes lookup( Name dn ) throws NamingException
{
- AtomicBackend l_backend = getBackend( a_dn ) ;
- return l_backend.lookup( a_dn ) ;
+ ContextPartition backend = getBackend( dn );
+ return backend.lookup( dn );
}
/**
- * @see org.apache.ldap.server.backend.Backend#hasEntry(javax.naming.Name)
+ * @see BackingStore#hasEntry(javax.naming.Name)
*/
- public boolean hasEntry( Name a_dn ) throws NamingException
+ public boolean hasEntry( Name dn ) throws NamingException
{
- AtomicBackend l_backend = getBackend( a_dn ) ;
- return l_backend.hasEntry( a_dn ) ;
+ ContextPartition backend = getBackend( dn );
+ return backend.hasEntry( dn );
}
/**
- * @see org.apache.ldap.server.backend.Backend#isSuffix(javax.naming.Name)
+ * @see BackingStore#isSuffix(javax.naming.Name)
*/
- public boolean isSuffix( Name a_dn ) throws NamingException
+ public boolean isSuffix( Name dn ) throws NamingException
{
- return m_backends.containsKey( a_dn.toString() ) ;
+ return backends.containsKey( dn.toString() );
}
/**
- * @see org.apache.ldap.server.backend.Backend#modifyRdn(javax.naming.Name,
- * java.lang.String, boolean)
+ * @see BackingStore#modifyRn(Name, String, boolean)
*/
- public void modifyRdn( Name a_dn, String a_newRdn, boolean a_deleteOldRdn )
- throws NamingException
+ public void modifyRn( Name dn, String newRdn, boolean deleteOldRdn ) throws NamingException
{
- AtomicBackend l_backend = getBackend( a_dn ) ;
- l_backend.modifyRdn( a_dn, a_newRdn, a_deleteOldRdn ) ;
+ ContextPartition backend = getBackend( dn );
+ backend.modifyRn( dn, newRdn, deleteOldRdn );
}
/**
- * @see org.apache.ldap.server.backend.Backend#move(javax.naming.Name,
- * javax.naming.Name)
+ * @see BackingStore#move(Name, Name)
*/
- public void move( Name a_oldChildDn, Name a_newParentDn )
- throws NamingException
+ public void move( Name oriChildName, Name newParentName ) throws NamingException
{
- AtomicBackend l_backend = getBackend( a_oldChildDn ) ;
- l_backend.move( a_oldChildDn, a_newParentDn ) ;
+ ContextPartition backend = getBackend( oriChildName );
+ backend.move( oriChildName, newParentName );
}
/**
- * @see org.apache.ldap.server.backend.Backend#move(javax.naming.Name,
+ * @see BackingStore#move(javax.naming.Name,
* javax.naming.Name, java.lang.String, boolean)
*/
- public void move( Name a_oldChildDn, Name a_newParentDn, String a_newRdn,
- boolean a_deleteOldRdn ) throws NamingException
+ public void move( Name oldChildDn, Name newParentDn, String newRdn,
+ boolean deleteOldRdn ) throws NamingException
{
- AtomicBackend l_backend = getBackend( a_oldChildDn ) ;
- l_backend.move( a_oldChildDn, a_newParentDn, a_newRdn, a_deleteOldRdn );
+ ContextPartition backend = getBackend( oldChildDn );
+ backend.move( oldChildDn, newParentDn, newRdn, deleteOldRdn );
}
@@ -514,49 +482,24 @@
/**
* Gets the backend partition associated with a dn.
*
- * @param a_dn the name to resolve to a backend
+ * @param dn the name to resolve to a backend
* @return the backend partition associated with the dn
* @throws NamingException if the name cannot be resolved to a backend
*/
- private AtomicBackend getBackend( Name a_dn ) throws NamingException
+ private ContextPartition getBackend( Name dn ) throws NamingException
{
- Name l_dn = ( Name ) a_dn.clone() ;
- AtomicBackend l_backend = null ;
-
- while ( l_dn.size() > 0 )
+ Name clonedDn = ( Name ) dn.clone();
+
+ while ( clonedDn.size() > 0 )
{
- if ( m_backends.containsKey( l_dn.toString() ) )
+ if ( backends.containsKey( clonedDn.toString() ) )
{
- return ( AtomicBackend ) m_backends.get( l_dn.toString() ) ;
+ return ( ContextPartition ) backends.get( clonedDn.toString() );
}
- l_dn.remove( 0 ) ;
+ clonedDn.remove( 0 );
}
- throw new NameNotFoundException() ;
- }
-
-
- // ------------------------------------------------------------------------
- // Life-Cycle Stage Methods
- // ------------------------------------------------------------------------
-
-
- /**
- * The nexus is dependent on the SystemBackend and so must get a handle on
- * it during the Serviceable life-cycle stage.
- *
- * @avalon.dependency
- * type="org.apache.ldap.server.backend.AtomicBackend"
- * key="system-backend" version="1.0"
- *
- * @see org.apache.avalon.framework.service.Serviceable#service(
- * org.apache.avalon.framework.service.ServiceManager)
- */
- public void service( ServiceManager a_manager )
- throws ServiceException
- {
- m_system = ( AtomicBackend ) a_manager.lookup( "system-backend" ) ;
- register( m_system ) ;
+ throw new NameNotFoundException();
}
}