directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 1453 - in incubator/directory/ldap/trunk/eve/backend/schema/oid/impl: . conf src/java/org/apache/eve/schema
Date Wed, 17 Dec 2003 02:11:33 GMT
Author: akarasulu
Date: Tue Dec 16 18:11:32 2003
New Revision: 1453

Added:
   incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/conf/
   incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/conf/block.xml
   incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/conf/config.xml
   incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/conf/debug.xml
   incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/maven.xml
   incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/src/java/org/apache/eve/schema/AvalonOidRegistryMonitor.java
  (contents, props changed)
   incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/src/java/org/apache/eve/schema/MerlinOidRegistry.java
  (contents, props changed)
Modified:
   incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/src/java/org/apache/eve/schema/DefaultOidRegistry.java
Log:
Merlin services added

Added: incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/conf/block.xml
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/conf/block.xml	Tue Dec 16 18:11:32
2003
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<container name="server">
+
+  <classloader>
+    <classpath>
+      <repository>
+        <resource id="avalon-framework:avalon-framework-api" version="4.1.5"/>
+        <resource id="directory:eve-backend-schema-oid-api" version="SNAPSHOT"/>
+      </repository>
+    </classpath>
+  </classloader>
+
+  <component
+    name="oid-registry" 
+    class="org.apache.eve.schema.MerlinOidRegistry"/>
+</container>

Added: incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/conf/config.xml
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/conf/config.xml	Tue Dec 16
18:11:32 2003
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<targets>
+  <target path="/server/oid-registry">
+    <categories priority="DEBUG"/>
+  </target>
+</targets>

Added: incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/conf/debug.xml
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/conf/debug.xml	Tue Dec 16 18:11:32
2003
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<kernel>
+
+  <!-- logging system parameters -->
+  <logging target="default" priority="DEBUG" name="kernel">
+  </logging>
+
+</kernel>
+

Added: incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/maven.xml
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/maven.xml	Tue Dec 16 18:11:32
2003
@@ -0,0 +1,38 @@
+<project default="java:compile"
+    xmlns:j="jelly:core"
+    xmlns:u="jelly:util"
+    xmlns:ant="jelly:ant"
+    xmlns:maven="jelly:maven"
+    xmlns:m="maven"
+    xmlns:deploy="deploy">
+    
+    <preGoal name="site">
+        <attainGoal name="docbook:transform"/>
+    </preGoal>
+
+    <postGoal name="site">
+        <attainGoal name="server:copy-images"/>
+    </postGoal>
+
+    <goal name="server:copy-images">
+        <copy toDir="target/docs/images">
+            <fileSet dir="${basedir}/src/images">
+                <include name="*.gif"/>
+            </fileSet>
+        </copy>
+    </goal>
+    
+    <goal name="cleanall">
+        <attainGoal name="clean"/>
+        <delete dir="home"/>
+    </goal>
+    
+    <postGoal name="java:compile">
+        <attainGoal name="avalon:meta"/>
+    </postGoal>
+    
+    <postGoal name="aspectj:compile">
+        <attainGoal name="avalon:meta"/>
+    </postGoal>
+    
+</project>

Added: incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/src/java/org/apache/eve/schema/AvalonOidRegistryMonitor.java
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/src/java/org/apache/eve/schema/AvalonOidRegistryMonitor.java
Tue Dec 16 18:11:32 2003
@@ -0,0 +1,140 @@
+/*
+
+ ============================================================================
+                   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 <http://www.apache.org/>.
+
+*/
+package org.apache.eve.schema ;
+
+
+import java.util.List ;
+
+import javax.naming.NamingException ;
+
+import org.apache.avalon.framework.logger.AbstractLogEnabled ;
+
+
+/**
+ * A OidRegistry monitor using Avalon logging for notification.
+ *
+ * @author <a href="mailto:akarasulu@apache.org">Alex Karasulu</a>
+ * @author $Author$
+ * @version $Rev$
+ */
+public class AvalonOidRegistryMonitor extends AbstractLogEnabled
+    implements OidRegistryMonitor
+{
+    /* (non-Javadoc)
+     * @see org.apache.eve.schema.OidRegistryMonitor#getOidWithOid(
+     * java.lang.String)
+     */
+    public void getOidWithOid( String a_oid )
+    {
+    }
+
+    
+    /* (non-Javadoc)
+     * @see org.apache.eve.schema.OidRegistryMonitor#oidResolved(
+     * java.lang.String, java.lang.String)
+     */
+    public void oidResolved( String a_name, String a_oid )
+    {
+    }
+
+    
+    /* (non-Javadoc)
+     * @see org.apache.eve.schema.OidRegistryMonitor#oidResolved(
+     * java.lang.String, java.lang.String, java.lang.String)
+     */
+    public void oidResolved( String a_name, String a_normalized, String a_oid )
+    {
+    }
+
+    
+    /* (non-Javadoc)
+     * @see org.apache.eve.schema.OidRegistryMonitor#oidResolutionFailed(
+     * java.lang.String, javax.naming.NamingException)
+     */
+    public void oidResolutionFailed( String a_name, NamingException a_fault )
+    {
+    }
+
+    
+    /* (non-Javadoc)
+     * @see org.apache.eve.schema.OidRegistryMonitor#oidDoesNotExist(
+     * java.lang.String, javax.naming.NamingException)
+     */
+    public void oidDoesNotExist( String a_oid, NamingException a_fault )
+    {
+    }
+
+    
+    /* (non-Javadoc)
+     * @see org.apache.eve.schema.OidRegistryMonitor#nameResolved(
+     * java.lang.String, java.lang.String)
+     */
+    public void nameResolved( String a_oid, String a_name )
+    {
+    }
+
+    
+    /* (non-Javadoc)
+     * @see org.apache.eve.schema.OidRegistryMonitor#namesResolved(
+     * java.lang.String, java.util.List)
+     */
+    public void namesResolved( String a_oid, List a_names )
+    {
+    }
+
+    
+    /* (non-Javadoc)
+     * @see org.apache.eve.schema.OidRegistryMonitor#registered(
+     * java.lang.String, java.lang.String)
+     */
+    public void registered( String a_name, String a_oid )
+    {
+    }
+}

Modified: incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/src/java/org/apache/eve/schema/DefaultOidRegistry.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/src/java/org/apache/eve/schema/DefaultOidRegistry.java
(original)
+++ incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/src/java/org/apache/eve/schema/DefaultOidRegistry.java
Tue Dec 16 18:11:32 2003
@@ -66,7 +66,7 @@
  * @author $Author$
  * @version $Rev$
  */
-public class DefaultOidRegistry
+public class DefaultOidRegistry implements OidRegistry
 { 
     /** Maps OID to a name or a list of names if more than one name exists */
     private Hashtable m_byOid = new Hashtable() ;
@@ -181,9 +181,9 @@
 
 
     /**
-     * @see org.apache.ldap.server.schema.OidRegistry#listOids()
+     * @see org.apache.ldap.server.schema.OidRegistry#list()
      */
-    public Iterator listOids()
+    public Iterator list()
     {
         return Collections.unmodifiableSet( m_byOid.keySet() ).iterator() ;
     }
@@ -263,6 +263,28 @@
 
         m_byOid.put( a_oid, l_value ) ;
         m_monitor.registered( a_name, a_oid ) ;
+    }
+    
+    
+    /**
+     * Gets the monitor.
+     * 
+     * @return the monitor
+     */
+    OidRegistryMonitor getMonitor()
+    {
+        return m_monitor ;
+    }
+
+    
+    /**
+     * Sets the monitor.
+     * 
+     * @param a_monitor monitor to set.
+     */
+    void setMonitor( OidRegistryMonitor a_monitor )
+    {
+        m_monitor = a_monitor ;
     }
 }
 

Added: incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/src/java/org/apache/eve/schema/MerlinOidRegistry.java
==============================================================================
--- (empty file)
+++ incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/src/java/org/apache/eve/schema/MerlinOidRegistry.java
Tue Dec 16 18:11:32 2003
@@ -0,0 +1,146 @@
+/*
+
+ ============================================================================
+                   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 <http://www.apache.org/>.
+
+*/
+package org.apache.eve.schema ; 
+
+
+import java.util.Iterator ;
+import java.util.List ;
+
+import javax.naming.NamingException ;
+
+import org.apache.avalon.framework.activity.Initializable;
+import org.apache.avalon.framework.logger.AbstractLogEnabled;
+
+
+/**
+ * Merlin OidRegistry service.
+ *
+ * @avalon.component name="oid-registry" lifestyle="singleton"
+ * @avalon.service type="org.apache.eve.schema.OidRegistry" version="1.0"
+ * 
+ * @author <a href="mailto:akarasulu@apache.org">Alex Karasulu</a>
+ * @author $Author$
+ * @version $Rev$
+ */
+public class MerlinOidRegistry extends AbstractLogEnabled 
+    implements OidRegistry, Initializable
+{
+    /** the delegate OidRegistry implementation this service uses */
+    private OidRegistry m_delegate = null ;
+
+    
+    // ------------------------------------------------------------------------
+    // OidRegistry Interface Methods
+    // ------------------------------------------------------------------------ 
+    
+    
+    /* (non-Javadoc)
+     * @see org.apache.eve.schema.OidRegistry#getOid(java.lang.String)
+     */
+    public String getOid( String a_name ) throws NamingException
+    {
+        return m_delegate.getOid( a_name ) ;
+    }
+    
+
+    /* (non-Javadoc)
+     * @see org.apache.eve.schema.OidRegistry#getPrimaryName(java.lang.String)
+     */
+    public String getPrimaryName( String a_oid ) throws NamingException
+    {
+        return m_delegate.getPrimaryName( a_oid ) ;
+    }
+    
+
+    /* (non-Javadoc)
+     * @see org.apache.eve.schema.OidRegistry#getNameSet(java.lang.String)
+     */
+    public List getNameSet( String a_oid ) throws NamingException
+    {
+        return m_delegate.getNameSet( a_oid ) ;
+    }
+    
+
+    /* (non-Javadoc)
+     * @see org.apache.eve.schema.OidRegistry#list()
+     */
+    public Iterator list()
+    {
+        return m_delegate.list() ;
+    }
+
+    
+    /* (non-Javadoc)
+     * @see org.apache.eve.schema.OidRegistry#register(java.lang.String, 
+     * java.lang.String)
+     */
+    public void register( String a_name, String a_oid )
+    {
+        m_delegate.register( a_name, a_oid ) ;
+    }
+
+
+    // ------------------------------------------------------------------------
+    // Avalon LifeCycle Methods
+    // ------------------------------------------------------------------------ 
+    
+
+    /*
+     *  (non-Javadoc)
+     * @see org.apache.avalon.framework.activity.Initializable#initialize()
+     */
+    public void initialize() 
+    {
+        DefaultOidRegistry l_delegate = new DefaultOidRegistry() ;
+        AvalonOidRegistryMonitor l_monitor = new AvalonOidRegistryMonitor() ;
+        l_monitor.enableLogging( getLogger() ) ;
+        l_delegate.setMonitor( l_monitor ) ;
+    }
+}

Mime
View raw message