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/09/29 06:48:23 UTC

svn commit: rev 47457 - incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema

Author: akarasulu
Date: Tue Sep 28 21:48:23 2004
New Revision: 47457

Added:
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITContentRuleRegistry.java   (contents, props changed)
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITContentRuleRegistryMonitor.java   (contents, props changed)
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITContentRuleRegistryMonitorAdapter.java   (contents, props changed)
Modified:
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/AttributeTypeRegistryMonitor.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/AttributeTypeRegistryMonitorAdapter.java
Log:
adding DITContentRule registry services

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/AttributeTypeRegistryMonitor.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/AttributeTypeRegistryMonitor.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/AttributeTypeRegistryMonitor.java	Tue Sep 28 21:48:23 2004
@@ -16,9 +16,8 @@
  */
 package org.apache.eve.schema;
 
-import org.apache.ldap.common.schema.AttributeType;
 
-import javax.naming.NamingException;
+import org.apache.ldap.common.schema.AttributeType;
 
 
 /**

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/AttributeTypeRegistryMonitorAdapter.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/AttributeTypeRegistryMonitorAdapter.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/AttributeTypeRegistryMonitorAdapter.java	Tue Sep 28 21:48:23 2004
@@ -19,8 +19,6 @@
 
 import org.apache.ldap.common.schema.AttributeType;
 
-import javax.naming.NamingException;
-
 
 /**
  * A simple do nothing monitor adapter for AttributeTypeRegistries.  Note for

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

Added: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITContentRuleRegistryMonitor.java
==============================================================================
--- (empty file)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITContentRuleRegistryMonitor.java	Tue Sep 28 21:48:23 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.DITContentRule;
+
+
+/**
+ * Interface for DITContentRuleRegitery callback event monitors.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public interface DITContentRuleRegistryMonitor
+{
+    /**
+     * Monitors when a DITContentRule is registered successfully.
+     *
+     * @param dITContentRule the DITContentRule successfully registered
+     */
+    void registered( DITContentRule dITContentRule );
+
+    /**
+     * Monitors when a Comparator is successfully looked up.
+     *
+     * @param dITContentRule the DITContentRule successfully lookedup
+     */
+    void lookedUp( DITContentRule dITContentRule );
+
+    /**
+     * Monitors when a lookup attempt fails.
+     *
+     * @param oid the OID for the DITContentRule 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 dITContentRule the DITContentRule which failed registration
+     * @param fault the exception to be thrown for the fault
+     */
+    void registerFailed( DITContentRule dITContentRule, Throwable fault );
+}

Added: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITContentRuleRegistryMonitorAdapter.java
==============================================================================
--- (empty file)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITContentRuleRegistryMonitorAdapter.java	Tue Sep 28 21:48:23 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.DITContentRule;
+
+
+/**
+ * A simple do nothing monitor adapter for DITContentRuleRegistries.  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 DITContentRuleRegistryMonitorAdapter
+    implements DITContentRuleRegistryMonitor
+{
+    public void registered( DITContentRule dITContentRule )
+    {
+    }
+
+
+    public void lookedUp( DITContentRule dITContentRule )
+    {
+    }
+
+
+    public void lookupFailed( String oid, Throwable fault )
+    {
+        if ( fault != null )
+        {
+            fault.printStackTrace();
+        }
+    }
+
+
+    public void registerFailed( DITContentRule dITContentRule, Throwable fault )
+    {
+        if ( fault != null )
+        {
+            fault.printStackTrace();
+        }
+    }
+}