directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 47458 - incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema
Date Wed, 29 Sep 2004 05:06:54 GMT
Author: akarasulu
Date: Tue Sep 28 22:06:53 2004
New Revision: 47458

Added:
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITStructureRuleRegistry.java
  (contents, props changed)
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITStructureRuleRegistryMonitor.java
  (contents, props changed)
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITStructureRuleRegistryMonitorAdapter.java
  (contents, props changed)
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/MatchineRuleUseRegistry.java
  (contents, props changed)
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/MatchingRuleUseRegistryMonitor.java
  (contents, props changed)
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/MatchingRuleUseRegistryMonitorAdapter.java
  (contents, props changed)
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/NameFormRegistry.java
  (contents, props changed)
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/NameFormRegistryMonitor.java
  (contents, props changed)
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/NameFormRegistryMonitorAdapter.java
  (contents, props changed)
Log:
Commit changes ...

 o add registry service interfaces for DITContentRules, NameForms, and 
   MatchingRuleUse objects
 o add registry service monitor interfaces for DITContentRules, NameForms, and 
   MatchingRuleUse objects
 o add registry service monitor adapters for DITContentRules, NameForms, and 
   MatchingRuleUse objects
 
Notes ...
 
 o still need to add the default/POJO registry implementations 



Added: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITStructureRuleRegistry.java
==============================================================================
--- (empty file)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITStructureRuleRegistry.java
Tue Sep 28 22:06:53 2004
@@ -0,0 +1,59 @@
+/*
+ *   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;
+
+
+import javax.naming.NamingException;
+
+import org.apache.ldap.common.schema.DITStructureRule;
+
+
+/**
+ * An DITStructureRule registry's service interface.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public interface DITStructureRuleRegistry
+{
+    /**
+     * Registers a Comparator with this registry.
+     * 
+     * @param dITStructureRule the dITStructureRule to register
+     * @throws NamingException if the DITStructureRule is already
+     * registered or the registration operation is not supported
+     */
+    void register( DITStructureRule dITStructureRule ) throws NamingException;
+    
+    /**
+     * Looks up an dITStructureRule by its unique Object Identifier.
+     * 
+     * @param oid the object identifier
+     * @return the DITStructureRule instance for the oid
+     * @throws NamingException if the DITStructureRule does not exist
+     */
+    DITStructureRule lookup( String oid ) throws NamingException;
+
+    /**
+     * Checks to see if an dITStructureRule exists.
+     * 
+     * @param oid the object identifier
+     * @return true if an dITStructureRule definition exists for the oid, false
+     * otherwise
+     */
+    boolean hasDITStructureRule( String oid );
+}

Added: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITStructureRuleRegistryMonitor.java
==============================================================================
--- (empty file)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITStructureRuleRegistryMonitor.java
Tue Sep 28 22:06:53 2004
@@ -0,0 +1,60 @@
+/*
+ *   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;
+
+
+import org.apache.ldap.common.schema.DITStructureRule;
+
+
+/**
+ * Interface for DITStructureRuleRegitery callback event monitors.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public interface DITStructureRuleRegistryMonitor
+{
+    /**
+     * Monitors when a DITStructureRule is registered successfully.
+     *
+     * @param dITStructureRule the DITStructureRule successfully registered
+     */
+    void registered( DITStructureRule dITStructureRule );
+
+    /**
+     * Monitors when a Comparator is successfully looked up.
+     *
+     * @param dITStructureRule the DITStructureRule successfully lookedup
+     */
+    void lookedUp( DITStructureRule dITStructureRule );
+
+    /**
+     * Monitors when a lookup attempt fails.
+     *
+     * @param oid the OID for the DITStructureRule to lookup
+     * @param fault the exception to be thrown for the fault
+     */
+    void lookupFailed( String oid, Throwable fault );
+
+    /**
+     * Monitors when a registration attempt fails.
+     *
+     * @param dITStructureRule the DITStructureRule which failed registration
+     * @param fault the exception to be thrown for the fault
+     */
+    void registerFailed( DITStructureRule dITStructureRule, Throwable fault );
+}

Added: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITStructureRuleRegistryMonitorAdapter.java
==============================================================================
--- (empty file)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITStructureRuleRegistryMonitorAdapter.java
Tue Sep 28 22:06:53 2004
@@ -0,0 +1,59 @@
+/*
+ *   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;
+
+
+import org.apache.ldap.common.schema.DITStructureRule;
+
+
+/**
+ * A simple do nothing monitor adapter for DITStructureRuleRegistries.  Note for
+ * safty exception based callback print the stack tract to stderr.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class DITStructureRuleRegistryMonitorAdapter
+    implements DITStructureRuleRegistryMonitor
+{
+    public void registered( DITStructureRule dITStructureRule )
+    {
+    }
+
+
+    public void lookedUp( DITStructureRule dITStructureRule )
+    {
+    }
+
+
+    public void lookupFailed( String oid, Throwable fault )
+    {
+        if ( fault != null )
+        {
+            fault.printStackTrace();
+        }
+    }
+
+
+    public void registerFailed( DITStructureRule dITStructureRule, Throwable fault )
+    {
+        if ( fault != null )
+        {
+            fault.printStackTrace();
+        }
+    }
+}

Added: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/MatchineRuleUseRegistry.java
==============================================================================
--- (empty file)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/MatchineRuleUseRegistry.java
Tue Sep 28 22:06:53 2004
@@ -0,0 +1,60 @@
+/*
+ *   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;
+
+
+import javax.naming.NamingException;
+
+import org.apache.ldap.common.schema.MatchingRuleUse;
+
+
+/**
+ * An MatchingRuleUse registry's service interface.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public interface MatchineRuleUseRegistry
+{
+    /**
+     * Registers a Comparator with this registry.
+     *
+     * @param name the name of the matchingRuleUse
+     * @param matchingRuleUse the matchingRuleUse to register
+     * @throws NamingException if the MatchingRuleUse is already
+     * registered or the registration operation is not supported
+     */
+    void register( String name, MatchingRuleUse matchingRuleUse ) throws NamingException;
+    
+    /**
+     * Looks up an matchingRuleUse by its unique Object Identifier.
+     * 
+     * @param name the name of the matchingRuleUse
+     * @return the MatchingRuleUse instance for the oid
+     * @throws NamingException if the MatchingRuleUse does not exist
+     */
+    MatchingRuleUse lookup( String name ) throws NamingException;
+
+    /**
+     * Checks to see if an matchingRuleUse exists.
+     * 
+     * @param name the name of the matchingRuleUse
+     * @return true if an matchingRuleUse definition exists for the oid, false
+     * otherwise
+     */
+    boolean hasMatchingRuleUse( String name );
+}

Added: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/MatchingRuleUseRegistryMonitor.java
==============================================================================
--- (empty file)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/MatchingRuleUseRegistryMonitor.java
Tue Sep 28 22:06:53 2004
@@ -0,0 +1,60 @@
+/*
+ *   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;
+
+
+import org.apache.ldap.common.schema.MatchingRuleUse;
+
+
+/**
+ * Interface for MatchingRuleUseRegitery callback event monitors.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public interface MatchingRuleUseRegistryMonitor
+{
+    /**
+     * Monitors when a MatchingRuleUse is registered successfully.
+     *
+     * @param matchingRuleUse the MatchingRuleUse successfully registered
+     */
+    void registered( MatchingRuleUse matchingRuleUse );
+
+    /**
+     * Monitors when a Comparator is successfully looked up.
+     *
+     * @param matchingRuleUse the MatchingRuleUse successfully lookedup
+     */
+    void lookedUp( MatchingRuleUse matchingRuleUse );
+
+    /**
+     * Monitors when a lookup attempt fails.
+     *
+     * @param name the name of the matchingRuleUse
+     * @param fault the exception to be thrown for the fault
+     */
+    void lookupFailed( String name, Throwable fault );
+
+    /**
+     * Monitors when a registration attempt fails.
+     *
+     * @param matchingRuleUse the MatchingRuleUse which failed registration
+     * @param fault the exception to be thrown for the fault
+     */
+    void registerFailed( MatchingRuleUse matchingRuleUse, Throwable fault );
+}

Added: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/MatchingRuleUseRegistryMonitorAdapter.java
==============================================================================
--- (empty file)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/MatchingRuleUseRegistryMonitorAdapter.java
Tue Sep 28 22:06:53 2004
@@ -0,0 +1,59 @@
+/*
+ *   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;
+
+
+import org.apache.ldap.common.schema.MatchingRuleUse;
+
+
+/**
+ * A simple do nothing monitor adapter for MatchingRuleUseRegistries.  Note for
+ * safty exception based callback print the stack tract to stderr.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class MatchingRuleUseRegistryMonitorAdapter
+    implements MatchingRuleUseRegistryMonitor
+{
+    public void registered( MatchingRuleUse matchingRuleUse )
+    {
+    }
+
+
+    public void lookedUp( MatchingRuleUse matchingRuleUse )
+    {
+    }
+
+
+    public void lookupFailed( String oid, Throwable fault )
+    {
+        if ( fault != null )
+        {
+            fault.printStackTrace();
+        }
+    }
+
+
+    public void registerFailed( MatchingRuleUse matchingRuleUse, Throwable fault )
+    {
+        if ( fault != null )
+        {
+            fault.printStackTrace();
+        }
+    }
+}

Added: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/NameFormRegistry.java
==============================================================================
--- (empty file)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/NameFormRegistry.java
Tue Sep 28 22:06:53 2004
@@ -0,0 +1,59 @@
+/*
+ *   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;
+
+
+import javax.naming.NamingException;
+
+import org.apache.ldap.common.schema.NameForm;
+
+
+/**
+ * An NameForm registry's service interface.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public interface NameFormRegistry
+{
+    /**
+     * Registers a Comparator with this registry.
+     * 
+     * @param nameForm the nameForm to register
+     * @throws javax.naming.NamingException if the NameForm is already
+     * registered or the registration operation is not supported
+     */
+    void register( NameForm nameForm ) throws NamingException;
+    
+    /**
+     * Looks up an nameForm by its unique Object Identifier.
+     * 
+     * @param oid the object identifier
+     * @return the NameForm instance for the oid
+     * @throws javax.naming.NamingException if the NameForm does not exist
+     */
+    NameForm lookup( String oid ) throws NamingException;
+
+    /**
+     * Checks to see if an nameForm exists.
+     * 
+     * @param oid the object identifier
+     * @return true if an nameForm definition exists for the oid, false
+     * otherwise
+     */
+    boolean hasNameForm( String oid );
+}

Added: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/NameFormRegistryMonitor.java
==============================================================================
--- (empty file)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/NameFormRegistryMonitor.java
Tue Sep 28 22:06:53 2004
@@ -0,0 +1,60 @@
+/*
+ *   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;
+
+
+import org.apache.ldap.common.schema.NameForm;
+
+
+/**
+ * Interface for NameFormRegitery callback event monitors.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public interface NameFormRegistryMonitor
+{
+    /**
+     * Monitors when a NameForm is registered successfully.
+     *
+     * @param nameForm the NameForm successfully registered
+     */
+    void registered( NameForm nameForm );
+
+    /**
+     * Monitors when a Comparator is successfully looked up.
+     *
+     * @param nameForm the NameForm successfully lookedup
+     */
+    void lookedUp( NameForm nameForm );
+
+    /**
+     * Monitors when a lookup attempt fails.
+     *
+     * @param oid the OID for the NameForm to lookup
+     * @param fault the exception to be thrown for the fault
+     */
+    void lookupFailed( String oid, Throwable fault );
+
+    /**
+     * Monitors when a registration attempt fails.
+     *
+     * @param nameForm the NameForm which failed registration
+     * @param fault the exception to be thrown for the fault
+     */
+    void registerFailed( NameForm nameForm, Throwable fault );
+}

Added: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/NameFormRegistryMonitorAdapter.java
==============================================================================
--- (empty file)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/NameFormRegistryMonitorAdapter.java
Tue Sep 28 22:06:53 2004
@@ -0,0 +1,58 @@
+/*
+ *   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;
+
+
+import org.apache.ldap.common.schema.NameForm;
+
+
+/**
+ * A simple do nothing monitor adapter for NameFormRegistries.  Note for
+ * safty exception based callback print the stack tract to stderr.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class NameFormRegistryMonitorAdapter implements NameFormRegistryMonitor
+{
+    public void registered( NameForm nameForm )
+    {
+    }
+
+
+    public void lookedUp( NameForm nameForm )
+    {
+    }
+
+
+    public void lookupFailed( String oid, Throwable fault )
+    {
+        if ( fault != null )
+        {
+            fault.printStackTrace();
+        }
+    }
+
+
+    public void registerFailed( NameForm nameForm, Throwable fault )
+    {
+        if ( fault != null )
+        {
+            fault.printStackTrace();
+        }
+    }
+}

Mime
View raw message