directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r808179 [2/2] - in /directory: apacheds/branches/apacheds-schema/ apacheds/branches/apacheds-schema/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/ apacheds/branches/apacheds-schema/core-entry/src/test/java...
Date Wed, 26 Aug 2009 20:40:22 GMT
Added: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Schema.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Schema.java?rev=808179&view=auto
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Schema.java
(added)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Schema.java
Wed Aug 26 20:40:18 2009
@@ -0,0 +1,84 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.directory.shared.ldap.schema.registries;
+
+
+/**
+ * Base schema interface.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public interface Schema
+{
+    /**
+     * Checks whether or not this schema is enabled or disabled.
+     * 
+     * @return true if this schema is disabled, false otherwise
+     */
+    boolean isDisabled();
+    
+    
+    /**
+     * Disable the schema
+     */
+    void disable();
+    
+    
+    /**
+     * Checks whether or not this schema is enabled or disabled.
+     * 
+     * @return true if this schema is enabled, false otherwise
+     */
+    boolean isEnabled();
+    
+
+    /**
+     * Enable the schema
+     */
+    void enable();
+    
+    
+    /**
+     * Gets the name of the owner of the schema objects within this
+     * Schema.
+     *
+     * @return the identifier for the owner of this set's objects
+     */
+    String getOwner();
+
+
+    /**
+     * Gets the name of the logical schema the objects of this Schema
+     * belong to: e.g. krb5-kdc may be the logical LDAP schema name.
+     *
+     * @return the name of the logical schema
+     */
+    String getSchemaName();
+
+
+    /**
+     * Gets the names of other schemas that the objects within this
+     * Schema depends upon.
+     *
+     * @return the String names of schema dependencies
+     */
+    String[] getDependencies();
+}

Added: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoader.java?rev=808179&view=auto
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoader.java
(added)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoader.java
Wed Aug 26 20:40:18 2009
@@ -0,0 +1,89 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.directory.shared.ldap.schema.registries;
+
+
+import java.util.Collection;
+import java.util.Properties;
+
+
+/**
+ * Loads schemas into registres.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public interface SchemaLoader
+{
+    /**
+     * Sets listener used to notify of newly loaded schemas.
+     * 
+     * @param listener the listener to notify (only one is enough for us)
+     */
+    public void setListener( SchemaLoaderListener listener );
+    
+    /**
+     * Gets a schema object based on it's name.
+     * 
+     * @param schemaName the name of the schema to load
+     * @return the Schema object associated with the name
+     * @throws Exception if any problems while trying to find the associated Schema
+     */
+    Schema getSchema( String schemaName ) throws Exception;
+    
+    /**
+     * Gets a schema object based on it's name and some properties.
+     * 
+     * @param schemaName the name of the schema to load
+     * @param schemaProperties the properties associated with that schema to facilitate locating/loading
it
+     * @return the Schema object associated with the name
+     * @throws Exception if any problems while trying to find the associated Schema
+     */
+    Schema getSchema( String schemaName, Properties schemaProperties ) throws Exception;
+    
+    /**
+     * Loads a collection of schemas.  A best effort should be made to load the dependended

+     * schemas that these schemas may rely on even if they are not included in the collection.
+     * 
+     * @param schemas the collection of schemas to load
+     * @param registries the registries to populate with these schemas
+     * @throws Exception if any kind of problems are encountered during the load
+     */
+    void loadWithDependencies( Collection<Schema> schemas, Registries registries )
throws Exception;
+    
+    /**
+     * Loads a single schema at least and possibly it's dependencies.  
+     * 
+     * @param schemas the schema to load
+     * @param registries the registries to populate with these schemas
+     * @throws Exception if any kind of problems are encountered during the load
+     */
+    void loadWithDependencies( Schema schemas, Registries registries ) throws Exception;
+    
+    /**
+     * Loads a single schema.  Do not try to resolve dependencies while implementing this
method.
+     * 
+     * @param schema the schema to load
+     * @param registries the registries to populate with these schemas
+     * @param isDepLoad tells the loader if this load request is to satisfy a dependency
+     * @throws Exception if any kind of problems are encountered during the load
+     */
+    void load( Schema schema, Registries registries, boolean isDepLoad ) throws Exception;
+}

Added: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoaderListener.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoaderListener.java?rev=808179&view=auto
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoaderListener.java
(added)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoaderListener.java
Wed Aug 26 20:40:18 2009
@@ -0,0 +1,32 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.directory.shared.ldap.schema.registries;
+
+
+/**
+ * A listener to the schema loader for events like a new schema being loaded.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public interface SchemaLoaderListener
+{
+    void schemaLoaded( Schema schema );
+}



Mime
View raw message