directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gokt...@apache.org
Subject svn commit: r1210227 - in /directory/apacheds/branches/apacheds-osgi/component-hub: ./ src/main/java/org/apache/directory/server/component/hub/ src/main/java/org/apache/directory/server/component/instance/ src/main/java/org/apache/directory/server/comp...
Date Sun, 04 Dec 2011 21:29:42 GMT
Author: gokturk
Date: Sun Dec  4 21:29:41 2011
New Revision: 1210227

URL: http://svn.apache.org/viewvc?rev=1210227&view=rev
Log:
Minor refactorings and bugfixes.


Added:
    directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/ADSConstants.java
    directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/AvlPartitionOperationsHelper.java
  (with props)
    directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/IPojoFactoryHelper.java
      - copied, changed from r1209113, directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/ADSComponentHelper.java
Removed:
    directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/ADSComponentHelper.java
Modified:
    directory/apacheds/branches/apacheds-osgi/component-hub/pom.xml
    directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentHub.java
    directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentManager.java
    directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ConfigurationManager.java
    directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/instance/CachedComponentInstance.java
    directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/schema/DefaultComponentSchemaGenerator.java
    directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/LdifConfigHelper.java

Modified: directory/apacheds/branches/apacheds-osgi/component-hub/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/pom.xml?rev=1210227&r1=1210226&r2=1210227&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/component-hub/pom.xml (original)
+++ directory/apacheds/branches/apacheds-osgi/component-hub/pom.xml Sun Dec  4 21:29:41 2011
@@ -49,6 +49,11 @@
     </dependency>
     
     <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-ldif-partition</artifactId>
+    </dependency>
+    
+    <dependency>
       <groupId>org.apache.felix</groupId>
       <artifactId>org.apache.felix.ipojo.annotations</artifactId>
       <version>1.8.0</version>

Modified: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentHub.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentHub.java?rev=1210227&r1=1210226&r2=1210227&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentHub.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentHub.java
Sun Dec  4 21:29:41 2011
@@ -22,28 +22,22 @@ package org.apache.directory.server.comp
 
 import java.util.ArrayList;
 import java.util.Dictionary;
-import java.util.Enumeration;
+
 import java.util.Hashtable;
 import java.util.List;
 
 import org.apache.directory.server.component.ADSComponent;
 import org.apache.directory.server.component.hub.listener.HubListener;
-import org.apache.directory.server.component.instance.ComponentInstanceGenerator;
-import org.apache.directory.server.component.instance.DefaultComponentInstanceGenerator;
-import org.apache.directory.server.component.schema.ADSComponentSchema;
-import org.apache.directory.server.component.schema.ComponentSchemaGenerator;
 import org.apache.directory.server.component.schema.DefaultComponentSchemaGenerator;
-import org.apache.directory.server.component.utilities.ADSComponentHelper;
-import org.apache.directory.server.component.utilities.ADSConstants;
+import org.apache.directory.server.component.utilities.IPojoFactoryHelper;
 import org.apache.directory.server.core.api.interceptor.Interceptor;
+import org.apache.directory.server.core.api.schema.SchemaPartition;
+import org.apache.directory.server.core.partition.ldif.SingleFileLdifPartition;
 import org.apache.felix.ipojo.Factory;
 import org.apache.felix.ipojo.annotations.Component;
 import org.apache.felix.ipojo.annotations.Invalidate;
 import org.apache.felix.ipojo.annotations.Requires;
 import org.apache.felix.ipojo.annotations.Validate;
-import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.parser.ManifestMetadataParser;
-import org.apache.felix.ipojo.parser.ParseException;
 import org.apache.felix.ipojo.whiteboard.Wbp;
 import org.apache.felix.ipojo.whiteboard.Whiteboards;
 import org.osgi.framework.ServiceReference;
@@ -70,14 +64,14 @@ import org.osgi.service.log.LogService;
 public class ComponentHub
 {
     /*
-     * boolean value to check for deferred writes to schema partition
+     * Schema Partition reference.
      */
-    private boolean schemaReady = false;
+    private SchemaPartition schemaPartition;
 
     /*
-     * boolean value to check for deferred writes to config partition
+     * Config Partition reference
      */
-    private boolean configReady = false;
+    private SingleFileLdifPartition configPartition;
 
     /*
      * Map to keep "component type" -> "components" mapping.
@@ -95,14 +89,24 @@ public class ComponentHub
     private ComponentEventManager eventManager = new ComponentEventManager();
 
     /*
+     * Used to manage component's schemas.
+     */
+    private ComponentSchemaManager compSchemaManager = new ComponentSchemaManager( schemaPartition
);
+
+    /*
+     * Used to manage config partition interactions.
+     */
+    private ConfigurationManager configManager = new ConfigurationManager( configPartition
);
+
+    /*
      * Used to manage instances' DIT hooks.
      */
-    private InstanceManager configManager = new InstanceManager();
+    private InstanceManager instanceManager = new InstanceManager();
 
     /*
-     * Used to manage components
+     * Used to manage components.
      */
-    private ComponentManager componentManager = new ComponentManager( configManager );
+    private ComponentManager componentManager = new ComponentManager( configManager, instanceManager
);
 
     /*
      * Allowed interfaces for components.
@@ -117,10 +121,26 @@ public class ComponentHub
     private LogService logger;
 
 
+    /**
+     * Creates an IPojo component for the ComponentHub class.
+     *
+     * @param schemaPartition schema partition reference
+     * @param configPartition config partition reference
+     * @return reference to a wrapped ComponentHub IPojo component
+     */
+    public static ComponentHub createComponentHub( SchemaPartition schemaPartition,
+        SingleFileLdifPartition configPartition )
+    {
+        return null;
+    }
+
+
     public ComponentHub()
     {
         componentMap = new Hashtable<String, List<ADSComponent>>();
         components = new ArrayList<ADSComponent>();
+
+        compSchemaManager.addSchemaGenerator( Interceptor.class.getName(), new DefaultComponentSchemaGenerator()
);
     }
 
 
@@ -315,8 +335,8 @@ public class ComponentHub
 
         component.setFactory( factory );
         component.setComponentType( componentType );
-        component.setComponentName( ADSComponentHelper.getComponentName( component.getFactory()
) );
-        component.setComponentVersion( ADSComponentHelper.getComponentVersion( component.getFactory()
) );
+        component.setComponentName( IPojoFactoryHelper.getComponentName( component.getFactory()
) );
+        component.setComponentVersion( IPojoFactoryHelper.getComponentVersion( component.getFactory()
) );
 
         return component;
     }

Modified: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentManager.java?rev=1210227&r1=1210226&r2=1210227&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentManager.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentManager.java
Sun Dec  4 21:29:41 2011
@@ -55,11 +55,6 @@ public class ComponentManager
     private final Logger LOG = LoggerFactory.getLogger( ComponentManager.class );
 
     /*
-     * Schema generators
-     */
-    private Dictionary<String, ComponentSchemaGenerator> schemaGenerators;
-
-    /*
      * Instance Generators
      */
     private Dictionary<String, ComponentInstanceGenerator> instanceGenerators;
@@ -67,59 +62,24 @@ public class ComponentManager
     /*
      * Configuration Manager
      */
-    private InstanceManager instanceManager;
-
-    /*
-     * Ldif deferred writing queue.
-     */
-    private Queue<LdifEntry> ldifQueue = new LinkedBlockingQueue<LdifEntry>();
+    private ConfigurationManager configManager;
 
     /*
-     * Connection reference to access ApacheDS
+     * Instance Manager reference to pair with created instances.
      */
-    private LdapCoreSessionConnection ldapConn;
+    private InstanceManager instanceManager;
 
 
-    public ComponentManager( InstanceManager instanceManager )
+    public ComponentManager( ConfigurationManager configManager, InstanceManager instanceManager
)
     {
-        schemaGenerators = new Hashtable<String, ComponentSchemaGenerator>();
         instanceGenerators = new Hashtable<String, ComponentInstanceGenerator>();
 
+        this.configManager = configManager;
         this.instanceManager = instanceManager;
     }
 
 
     /**
-     * Used to set internal connection. All write operations to the schema will be deferred
-     * until reference is set.
-     *
-     * @param conn LdapCoreSessionConnection reference to set.
-     */
-    public synchronized void setConnection( LdapCoreSessionConnection conn )
-    {
-        ldapConn = conn;
-
-        flushCache();
-    }
-
-
-    /**
-     * Adds new schema generator for specified component type.
-     * Keeps the first added generator as default.
-     *
-     * @param componentType component type to register schema generator
-     * @param generator schema generator instance
-     */
-    public void addSchemaGenerator( String componentType, ComponentSchemaGenerator generator
)
-    {
-        if ( schemaGenerators.get( componentType ) == null )
-        {
-            schemaGenerators.put( componentType, generator );
-        }
-    }
-
-
-    /**
      * Adds new instance generator for specified component type.
      * Keeps the first added generator as default.
      *
@@ -167,170 +127,6 @@ public class ComponentManager
 
 
     /**
-     * Loads the schema of the component into ApacheDS for
-     * further instance entry mappings and configuration hooks.
-     *
-     * @param component ADSComponent reference for schema loading
-     */
-    public void loadComponentSchema( ADSComponent component )
-    {
-        try
-        {
-            checkAndGenerateBaseSchema( component );
-            if ( component.getSchema().getSchemaElements() != null )
-            {
-                loadLdifs( component.getSchema().getSchemaElements() );
-            }
-        }
-        catch ( LdapException exc )
-        {
-            LOG.info( "An error occured while loading schema for component: " + component
);
-        }
-    }
-
-
-    /**
-     * Load LdifEntry list into ApacheDS.
-     * Loads them into the cache if the connection is not set yet.
-     *
-     * @param ldifs LdifEntry list to load.
-     * @throws LdapException
-     */
-    private synchronized void loadLdifs( List<LdifEntry> ldifs ) throws LdapException
-    {
-        if ( ldapConn == null )
-        {
-            for ( LdifEntry ldif : ldifs )
-            {
-                ldifQueue.add( ldif );
-            }
-        }
-        else
-        {
-            for ( LdifEntry ldif : ldifs )
-            {
-                AddRequest addReq = new AddRequestImpl();
-                addReq.setEntry( ldif.getEntry() );
-
-                ldapConn.add( addReq );
-            }
-        }
-    }
-
-
-    /**
-     * Loads all the cached entries into ApacheDS
-     *
-     */
-    private void flushCache()
-    {
-        List<LdifEntry> cache = new ArrayList<LdifEntry>();
-
-        for ( LdifEntry ldif : ldifQueue )
-        {
-            cache.add( ldif );
-        }
-
-        try
-        {
-            loadLdifs( cache );
-        }
-        catch ( LdapException exc )
-        {
-            LOG.info( "Error while flushing the Ldif cache." );
-        }
-    }
-
-
-    /**
-     * Checks for the base schema which will hold the schema elements for the
-     * given component. 
-     * 
-     * Generates an empty one, if none is exist.
-     *
-     * @param component ADSComponent reference to check base schema against.
-     * @throws LdapException
-     */
-    private void checkAndGenerateBaseSchema( ADSComponent component ) throws LdapException
-    {
-        String parentSchemaDn = "cn=" + component.getSchema().getParentSchemaName() + ",ou=schema";
-        String attribsDn = "ou=attributeTypes," + parentSchemaDn;
-        String ocsDn = "ou=objectClasses," + parentSchemaDn;
-
-        boolean schemaExists = ldapConn.exists( parentSchemaDn );
-        boolean attribsExists = ldapConn.exists( attribsDn );
-        boolean ocsExists = ldapConn.exists( ocsDn );
-
-        if ( schemaExists && attribsExists && ocsExists )
-        {
-            return;
-        }
-
-        List<LdifEntry> ldifs = new ArrayList<LdifEntry>();
-
-        if ( !schemaExists )
-        {
-            ldifs.add( new LdifEntry( parentSchemaDn,
-                "objectClass:metaSchema",
-                "objectClass:top",
-                "cn:" + component.getSchema().getParentSchemaName(),
-                "m-dependencies: system",
-                "m-dependencies: core" ) );
-        }
-
-        if ( !attribsExists )
-        {
-            ldifs.add( new LdifEntry( attribsDn,
-                "objectclass:organizationalUnit",
-                "objectClass:top",
-                "ou:attributetypes" ) );
-        }
-
-        if ( ocsExists )
-        {
-            ldifs.add( new LdifEntry( ocsDn,
-                "objectclass:organizationalUnit",
-                "objectClass:top",
-                "ou:objectClasses" ) );
-        }
-
-        loadLdifs( ldifs );
-    }
-
-
-    /**
-     * Deletes the schema elements for the component.
-     *
-     * @param component ADSComponent reference to delete its schema elements from ApacheDS
-     */
-    public void deleteSchemaElements( ADSComponent component )
-    {
-        List<LdifEntry> schemaElements = component.getSchema().getSchemaElements();
-
-        //We reverse the order here for deletion.
-        //List was originally in add order.
-        Collections.reverse( schemaElements );
-
-        if ( ldapConn == null )
-        {
-            return;
-        }
-        try
-        {
-            for ( LdifEntry ldif : schemaElements )
-            {
-                ldapConn.delete( ldif.getDn() );
-            }
-        }
-        catch ( LdapException exc )
-        {
-            LOG.info( "Error occured while deleting component's schema elements" );
-        }
-    }
-
-
-
-    /**
      * Loads the cached instance configurations for component, and use
      * them to create cached instances.
      *

Modified: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ConfigurationManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ConfigurationManager.java?rev=1210227&r1=1210226&r2=1210227&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ConfigurationManager.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ConfigurationManager.java
Sun Dec  4 21:29:41 2011
@@ -1,7 +1,39 @@
-
+/*
+ *  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.server.component.hub;
 
+
+import org.apache.directory.server.core.partition.ldif.SingleFileLdifPartition;
+
+
 public class ConfigurationManager
 {
+    /*
+     * configuration Partition reference.
+     */
+    private SingleFileLdifPartition configPartition;
+
+
+    public ConfigurationManager( SingleFileLdifPartition configPartition )
+    {
+        this.configPartition = configPartition;
+    }
 
 }

Modified: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/instance/CachedComponentInstance.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/instance/CachedComponentInstance.java?rev=1210227&r1=1210226&r2=1210227&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/instance/CachedComponentInstance.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/instance/CachedComponentInstance.java
Sun Dec  4 21:29:41 2011
@@ -1,3 +1,22 @@
+/*
+ *  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.server.component.instance;
 
 

Modified: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/schema/DefaultComponentSchemaGenerator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/schema/DefaultComponentSchemaGenerator.java?rev=1210227&r1=1210226&r2=1210227&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/schema/DefaultComponentSchemaGenerator.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/schema/DefaultComponentSchemaGenerator.java
Sun Dec  4 21:29:41 2011
@@ -23,7 +23,7 @@ package org.apache.directory.server.comp
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.directory.server.component.utilities.ADSComponentHelper;
+import org.apache.directory.server.component.utilities.IPojoFactoryHelper;
 import org.apache.directory.server.component.utilities.ADSConstants;
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
@@ -48,7 +48,7 @@ public class DefaultComponentSchemaGener
     {
         List<LdifEntry> schemaElements = new ArrayList<LdifEntry>();
 
-        String componentName = ADSComponentHelper.getComponentName( componentFactory );
+        String componentName = IPojoFactoryHelper.getComponentName( componentFactory );
 
         String attribsDn = "ou=attributeTypes," + ADS_USER_COMPONENTS_SCHEMA_DN;
         String ocsDn = "ou=objectClasses," + ADS_USER_COMPONENTS_SCHEMA_DN;

Added: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/ADSConstants.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/ADSConstants.java?rev=1210227&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/ADSConstants.java
(added)
+++ directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/ADSConstants.java
Sun Dec  4 21:29:41 2011
@@ -0,0 +1,131 @@
+/*
+ *  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.server.component.utilities;
+
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+
+/**
+ * Class to hold constants for ApacheDS component management.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class ADSConstants
+{
+
+    /*
+     * base directory path for component cache
+     */
+    public static final String ADS_CACHE_BASE_DIR = "adscache";
+
+    /*
+     * default file name for caching schemas inside for components
+     */
+    public static final String ADS_CACHE_SCHEMA_FILE = "schema-elements.ldif";
+
+    /*
+     * default file name for caching instance entries inside for components
+     */
+    public static final String ADS_CACHE_INSTANCES_DIR = "instance-configs";
+
+    /*
+     * default file name for caching version information for components
+     */
+    public static final String ADS_CACHE_VERSION_FILE = "version";
+
+    /*
+     * IPojo Handler name for ADSComponent annotation.
+     */
+    public static final String ADS_COMPONENT_HANDLER_NS = "org.apache.directory.server.component.handler";
+
+    /*
+     * IPojo Handler name for ADSComponent annotation.
+     */
+    public static final String ADS_COMPONENT_HANDLER_NAME = "ADSComponentHandler";
+
+    /*
+     * IPojo Handler name for ADSComponent annotation.
+     */
+    public static final String ADS_COMPONENT_HANDLER_FULLNAME = "org.apache.directory.server.component.handler:ADSComponentHandler";
+
+    /*
+     * iPOJO Component Type and Instance declaration header.
+     */
+    public static final String IPOJO_HEADER = "iPOJO-Components";
+
+    /*
+     * Base OID value for ApacheDS component schemas.
+     */
+    public static final String ADS_COMPONENT_BASE_OID = "1.3.6.1.4.1.18060.0.4.4";
+
+    /*
+     * Component type name of user defined components.
+     */
+    public static final String ADS_COMPONENT_TYPE_USER = "user";
+
+    /*
+     * Hash table for mapping property type name to its syntax in ApacheDS
+     */
+    public static Dictionary<String, String> syntaxMappings;
+
+    /*
+     * Hash table for mapping property type name to its equality matching rule in ApacheDS
+     */
+    public static Dictionary<String, String> equalityMappings;
+
+    /*
+     * Hash table for mapping property type name to its ordering rule in ApacheDS
+     */
+    public static Dictionary<String, String> orderingMappings;
+
+    /*
+     * Hash table for mapping property type name to its substring matching in ApacheDS
+     */
+    public static Dictionary<String, String> substringMappings;
+
+    /**
+     * Static constructor that initializes the values of the type mapping Hash tables.
+     */
+    static
+    {
+        syntaxMappings = new Hashtable<String, String>();
+        syntaxMappings.put( "int", "1.3.6.1.4.1.1466.115.121.1.27" );
+        syntaxMappings.put( "java.lang.String", "1.3.6.1.4.1.1466.115.121.1.15" );
+        syntaxMappings.put( "boolean", "1.3.6.1.4.1.1466.115.121.1.7" );
+
+        equalityMappings = new Hashtable<String, String>();
+        equalityMappings.put( "int", "integerMatch" );
+        equalityMappings.put( "java.lang.String", "caseExactMatch" );
+        equalityMappings.put( "boolean", "booleanMatch" );
+
+        orderingMappings = new Hashtable<String, String>();
+        orderingMappings.put( "int", "integerOrderingMatch" );
+        orderingMappings.put( "java.lang.String", "caseExactOrderingMatch" );
+        orderingMappings.put( "boolean", "caseIgnoreOrderingMatch" );
+
+        substringMappings = new Hashtable<String, String>();
+        substringMappings.put( "int", "numericStringSubstringsMatch" );
+        substringMappings.put( "java.lang.String", "caseExactSubstringsMatch" );
+        substringMappings.put( "boolean", "caseIgnoreSubstringsMatch" );
+    }
+
+}

Added: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/AvlPartitionOperationsHelper.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/AvlPartitionOperationsHelper.java?rev=1210227&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/AvlPartitionOperationsHelper.java
(added)
+++ directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/AvlPartitionOperationsHelper.java
Sun Dec  4 21:29:41 2011
@@ -0,0 +1,25 @@
+/*
+ *  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.server.component.utilities;
+
+public class AvlPartitionOperationsHelper
+{
+
+}

Propchange: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/AvlPartitionOperationsHelper.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/IPojoFactoryHelper.java
(from r1209113, directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/ADSComponentHelper.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/IPojoFactoryHelper.java?p2=directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/IPojoFactoryHelper.java&p1=directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/ADSComponentHelper.java&r1=1209113&r2=1210227&rev=1210227&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/ADSComponentHelper.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/IPojoFactoryHelper.java
Sun Dec  4 21:29:41 2011
@@ -13,7 +13,7 @@ import org.apache.felix.ipojo.Factory;
  *
  * @author gokturk
  */
-public class ADSComponentHelper
+public class IPojoFactoryHelper
 {
     /**
      * Gets the component name of an IPojo Component. If IPojo Component does not define
its factory name

Modified: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/LdifConfigHelper.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/LdifConfigHelper.java?rev=1210227&r1=1210226&r2=1210227&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/LdifConfigHelper.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/LdifConfigHelper.java
Sun Dec  4 21:29:41 2011
@@ -1,7 +1,44 @@
-
+/*
+ *  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.server.component.utilities;
 
+import java.util.Properties;
+
+import org.apache.directory.server.component.ADSComponent;
+import org.apache.directory.server.component.instance.ComponentInstance;
+import org.apache.directory.shared.ldap.model.ldif.LdifEntry;
+
 public class LdifConfigHelper
 {
-
+    public LdifEntry componentToLdifEntry(ADSComponent component)
+    {
+        return null;
+    }
+    
+    public LdifEntry instanceToLdif(ComponentInstance instance)
+    {
+        return null;
+    }
+    
+    public Properties instanceEntryToConfiguration(LdifEntry entry)
+    {
+        return null;
+    }
 }



Mime
View raw message