Return-Path: Delivered-To: apmail-incubator-directory-cvs-archive@www.apache.org Received: (qmail 78627 invoked from network); 28 Sep 2004 01:25:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 28 Sep 2004 01:25:51 -0000 Received: (qmail 3759 invoked by uid 500); 28 Sep 2004 01:25:50 -0000 Delivered-To: apmail-incubator-directory-cvs-archive@incubator.apache.org Received: (qmail 3708 invoked by uid 500); 28 Sep 2004 01:25:50 -0000 Mailing-List: contact directory-cvs-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: directory-dev@incubator.apache.org Delivered-To: mailing list directory-cvs@incubator.apache.org Received: (qmail 3694 invoked by uid 99); 28 Sep 2004 01:25:50 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,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.28) with SMTP; Mon, 27 Sep 2004 18:25:49 -0700 Received: (qmail 78537 invoked by uid 65534); 28 Sep 2004 01:25:41 -0000 Date: 28 Sep 2004 01:25:41 -0000 Message-ID: <20040928012541.78534.qmail@minotaur.apache.org> From: akarasulu@apache.org To: directory-cvs@incubator.apache.org Subject: svn commit: rev 47364 - in incubator/directory/eve/trunk/backend/impl: . src/java/org/apache/eve/schema X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: akarasulu Date: Mon Sep 27 18:25:40 2004 New Revision: 47364 Modified: incubator/directory/eve/trunk/backend/impl/project.properties incubator/directory/eve/trunk/backend/impl/src/java/org/apache/eve/schema/BootstrapMatchingRuleRegistry.java Log: Cleaned up code to make it compile. Modified: incubator/directory/eve/trunk/backend/impl/project.properties ============================================================================== --- incubator/directory/eve/trunk/backend/impl/project.properties (original) +++ incubator/directory/eve/trunk/backend/impl/project.properties Mon Sep 27 18:25:40 2004 @@ -13,4 +13,4 @@ tag2.scope=all merlin.debug=true -maven.license.licenseFile=../../../../../../../LICENSE.txt +maven.license.licenseFile=../../../../LICENSE.txt Modified: incubator/directory/eve/trunk/backend/impl/src/java/org/apache/eve/schema/BootstrapMatchingRuleRegistry.java ============================================================================== --- incubator/directory/eve/trunk/backend/impl/src/java/org/apache/eve/schema/BootstrapMatchingRuleRegistry.java (original) +++ incubator/directory/eve/trunk/backend/impl/src/java/org/apache/eve/schema/BootstrapMatchingRuleRegistry.java Mon Sep 27 18:25:40 2004 @@ -1,79 +1,43 @@ /* + * 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.eve.schema; - ============================================================================ - The Apache Software License, Version 1.1 - ============================================================================ - - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved. - - Redistribution and use in source and binary forms, with or without modifica- - tion, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - 3. The end-user documentation included with the redistribution, if any, must - include the following acknowledgment: "This product includes software - developed by the Apache Software Foundation (http://www.apache.org/)." - Alternately, this acknowledgment may appear in the software itself, if - and wherever such third-party acknowledgments normally appear. - - 4. The names "Eve Directory Server", "Apache Directory Project", "Apache Eve" - and "Apache Software Foundation" must not be used to endorse or promote - products derived from this software without prior written - permission. For written permission, please contact apache@apache.org. - - 5. Products derived from this software may not be called "Apache", nor may - "Apache" appear in their name, without prior written permission of the - Apache Software Foundation. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- - DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - This software consists of voluntary contributions made by many individuals - on behalf of the Apache Software Foundation. For more information on the - Apache Software Foundation, please see . - -*/ -package org.apache.eve.schema ; +import org.apache.ldap.common.schema.MatchingRule; -import java.util.Map ; -import java.util.HashMap ; +import java.util.Map; +import java.util.HashMap; -import javax.naming.NamingException ; -import javax.naming.OperationNotSupportedException ; +import javax.naming.NamingException; +import javax.naming.OperationNotSupportedException; /** - * A MatchingRuleRegistry service available during server startup when other - * resources like a system backend for a backing store is unavailable to - * solid state registries. + * A MatchingRuleRegistry service used to lookup matching rules by OID. * - * @author Alex Karasulu - * @author $Author: akarasulu $ - * @version $Rev: 6196 $ + * @author Apache Directory Project + * @version $Rev$ */ public class BootstrapMatchingRuleRegistry implements MatchingRuleRegistry { /** a map using an OID for the key and a MatchingRule for the value */ - private final Map m_matchingRules ; - /** the OID registry used to register new MatchingRule OIDs */ - private final OidRegistry m_registry ; + private final Map matchingRules; /** a monitor used to track noteable registry events */ - private MatchingRuleRegistryMonitor m_monitor = null ; + private MatchingRuleRegistryMonitor monitor = null; // ------------------------------------------------------------------------ @@ -85,14 +49,14 @@ * Creates a BootstrapMatchingRuleRegistry using existing MatchingRulees * for lookups. * - * @param a_matchingRules a map of OIDs to their respective MatchingRule + * @param matchingRules a map of OIDs to their respective MatchingRule * objects */ - public BootstrapMatchingRuleRegistry( MatchingRule[] a_matchingRules, - OidRegistry a_registry ) + public BootstrapMatchingRuleRegistry( MatchingRule[] matchingRules, + OidRegistry registry ) { - this ( a_matchingRules, a_registry, - new MatchingRuleRegistryMonitorAdapter() ) ; + this ( matchingRules, registry, + new MatchingRuleRegistryMonitorAdapter() ); } @@ -100,30 +64,30 @@ * Creates a BootstrapMatchingRuleRegistry using existing MatchingRulees * for lookups. * - * @param a_matchingRules a map of OIDs to their respective MatchingRule + * @param matchingRules a map of OIDs to their respective MatchingRule * objects */ - public BootstrapMatchingRuleRegistry( MatchingRule[] a_matchingRules, - OidRegistry a_registry, - MatchingRuleRegistryMonitor a_monitor ) - { - m_monitor = a_monitor ; - m_registry = a_registry ; - m_matchingRules = new HashMap() ; + public BootstrapMatchingRuleRegistry( MatchingRule[] matchingRules, + OidRegistry registry, + MatchingRuleRegistryMonitor monitor ) + { + this.monitor = monitor; + this.matchingRules = new HashMap(); - for ( int ii = 0; ii < a_matchingRules.length; ii++ ) + for ( int ii = 0; ii < matchingRules.length; ii++ ) { - m_matchingRules.put( a_matchingRules[ii].getOid(), - a_matchingRules[ii] ) ; - m_registry.register( a_matchingRules[ii].getOid(), - a_matchingRules[ii].getOid() ) ; - if ( a_matchingRules[ii].getName() != null ) + this.matchingRules.put( matchingRules[ii].getOid(), + matchingRules[ii] ); + registry.register( matchingRules[ii].getOid(), + matchingRules[ii].getOid() ); + + if ( matchingRules[ii].getName() != null ) { - m_registry.register( a_matchingRules[ii].getName(), - a_matchingRules[ii].getOid() ) ; + registry.register( matchingRules[ii].getName(), + matchingRules[ii].getOid() ); } - m_monitor.registered( a_matchingRules[ii] ) ; + monitor.registered( matchingRules[ii] ); } } @@ -136,34 +100,34 @@ /** * @see org.apache.eve.schema.MatchingRuleRegistry#lookup(java.lang.String) */ - public MatchingRule lookup( String a_oid ) throws NamingException + public MatchingRule lookup( String oid ) throws NamingException { - if ( m_matchingRules.containsKey( a_oid ) ) + if ( matchingRules.containsKey( oid ) ) { - MatchingRule l_MatchingRule = ( MatchingRule ) - m_matchingRules.get( a_oid ) ; - m_monitor.lookedUp( l_MatchingRule ) ; - return l_MatchingRule ; + MatchingRule MatchingRule = ( MatchingRule ) + matchingRules.get( oid ); + monitor.lookedUp( MatchingRule ); + return MatchingRule; } - NamingException l_fault = new NamingException( - "Unknown MatchingRule OID " + a_oid ) ; - m_monitor.lookupFailed( a_oid, l_fault ) ; - throw l_fault ; + NamingException fault = new NamingException( "Unknown MatchingRule OID " + + oid ); + monitor.lookupFailed( oid, fault ); + throw fault; } /** * @see org.apache.eve.schema.MatchingRuleRegistry#register( - * org.apache.eve.schema.MatchingRule) + * org.apache.ldap.common.schema.MatchingRule) */ - public void register( MatchingRule a_MatchingRule ) throws NamingException + public void register( MatchingRule MatchingRule ) throws NamingException { - NamingException l_fault = new OperationNotSupportedException( + NamingException fault = new OperationNotSupportedException( "MatchingRule registration on read-only bootstrap " + - "MatchingRuleRegistry not supported." ) ; - m_monitor.registerFailed( a_MatchingRule, l_fault ) ; - throw l_fault ; + "MatchingRuleRegistry not supported." ); + monitor.registerFailed( MatchingRule, fault ); + throw fault; } @@ -171,9 +135,9 @@ * @see org.apache.eve.schema.MatchingRuleRegistry#hasMatchingRule( * java.lang.String) */ - public boolean hasMatchingRule( String a_oid ) + public boolean hasMatchingRule( String oid ) { - return m_matchingRules.containsKey( a_oid ) ; + return matchingRules.containsKey( oid ); } @@ -189,17 +153,17 @@ */ MatchingRuleRegistryMonitor getMonitor() { - return m_monitor ; + return monitor; } /** * Sets the monitor for this registry. * - * @param a_monitor the monitor to set + * @param monitor the monitor to set */ - void setMonitor( MatchingRuleRegistryMonitor a_monitor ) + void setMonitor( MatchingRuleRegistryMonitor monitor ) { - m_monitor = a_monitor ; + this.monitor = monitor; } }