directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oer...@apache.org
Subject svn commit: r550803 [3/10] - in /directory/sandbox/oersoy/das.ldap.parent: ./ das.ldap.constants/ das.ldap.constants/.settings/ das.ldap.constants/src/ das.ldap.constants/src/main/ das.ldap.constants/src/main/java/ das.ldap.constants/src/main/java/org/...
Date Tue, 26 Jun 2007 13:29:26 GMT
Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/create/MetaContextCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/create/MetaContextCreator.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/create/MetaContextCreator.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/create/MetaContextCreator.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,46 @@
+/*
+ *  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.tuscany.das.ldap.create;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+import org.apache.tuscany.das.ldap.schema.constants.AttributeTypeConstants;
+
+public class MetaContextCreator
+implements 
+DASConstants,
+AttributeTypeConstants
+{
+    public static DirContext create(
+        DirContext modelContext) throws NamingException
+    {
+        String rdn   = 
+            CN + "=" + META_CONTEXT_NAME;
+        
+        DirContext metaContext  = 
+            ( DirContext ) 
+            modelContext.
+            createSubcontext( rdn );
+        
+        return metaContext;
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/destroy/InitialContextDestroyer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/destroy/InitialContextDestroyer.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/destroy/InitialContextDestroyer.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/destroy/InitialContextDestroyer.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,74 @@
+/*
+ *  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.tuscany.das.ldap.destroy;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+import org.apache.tuscany.das.ldap.util.JNDIUtil;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class InitialContextDestroyer.
+ */
+public class InitialContextDestroyer
+{
+    
+    /**
+     * Destroys the initial naming context
+     * when the parent entries do not contain
+     * other child entries.  If the initial
+     * naming context also supports other
+     * entries, then a NamingException will
+     * be thrown.
+     * 
+     * @param partitionContext the partition context
+     * @param initialContext the initial context
+     * 
+     * @throws NamingException the naming exception
+     */
+    public static void destroy(
+        DirContext initialContext, 
+        DirContext partitionContext) 
+    throws NamingException
+    {
+        String[] initialContextComponents = 
+            JNDIUtil.
+            calculateDNComponents( initialContext );
+        
+        String[] partitionContextComponents = 
+            JNDIUtil.calculateDNComponents( partitionContext );
+        
+        int numberOfPossibleSubcontexts = 
+            initialContextComponents.length
+            - partitionContextComponents.length;
+        
+        for (int i = 0; i < numberOfPossibleSubcontexts; i++)
+        {
+            String rdn = initialContextComponents[i];
+            
+            initialContext = JNDIUtil.getParentContext( 
+                initialContext, 
+                partitionContext );
+
+            initialContext.destroySubcontext( rdn );
+        }
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/destroy/MetaContextDestroyer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/destroy/MetaContextDestroyer.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/destroy/MetaContextDestroyer.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/destroy/MetaContextDestroyer.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,53 @@
+/*
+ *  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.tuscany.das.ldap.destroy;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+import org.apache.tuscany.das.ldap.schema.constants.AttributeTypeConstants;
+
+/**
+ * The Class MetaContextDestroyer.
+ */
+public class MetaContextDestroyer
+implements 
+DASConstants,
+AttributeTypeConstants
+{
+    /**
+     * Destroys an empty meta context
+     * 
+     * @param initialContext the initial context
+     * 
+     * @throws NamingException the naming exception thrown when the meta context has child entries
+     */
+    public static void destroy(
+        DirContext initialContext) 
+    throws NamingException
+    {
+        String rdn =
+            CN + "=" + META_CONTEXT_NAME;
+
+            initialContext.
+            destroySubcontext( rdn );
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/create/EDataGraphCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/create/EDataGraphCreator.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/create/EDataGraphCreator.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/create/EDataGraphCreator.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,66 @@
+/*
+ *  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.tuscany.das.ldap.emf.create;
+
+import javax.naming.NamingException;
+import javax.naming.ldap.LdapContext;
+
+import org.apache.tuscany.das.ldap.schema.constants.AttributeTypeConstants;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.sdo.EDataGraph;
+import org.eclipse.emf.ecore.sdo.EDataObject;
+
+public class EDataGraphCreator
+implements AttributeTypeConstants
+{
+
+	public static void create(
+    		EDataGraph eDataGraph, 
+    		LdapContext containerContext) 
+    throws NamingException
+    {
+		LdapContext namedContainerContext = 
+			null;
+		
+        EDataObject rootDataObject                =
+        	(EDataObject) 
+        	eDataGraph.getRootObject();
+        
+        String dataObjectRDN = 
+        	EDataObjectCreator.create(
+        		rootDataObject, 
+        		containerContext);
+        
+        namedContainerContext                      =
+        	(LdapContext) 
+        	containerContext.lookup(dataObjectRDN);
+        
+        EList<EObject> children                     =
+        	rootDataObject.eContents();
+        
+        if (children.size() > 0)
+        {
+            EDataGraphCreatorHelper.createChildren(
+            		children,
+            		namedContainerContext);
+        }
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/create/EDataGraphCreatorHelper.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/create/EDataGraphCreatorHelper.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/create/EDataGraphCreatorHelper.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/create/EDataGraphCreatorHelper.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,91 @@
+/*
+ *  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.tuscany.das.ldap.emf.create;
+
+import java.util.Iterator;
+
+import javax.naming.NamingException;
+import javax.naming.ldap.LdapContext;
+
+import org.apache.tuscany.das.ldap.schema.constants.AttributeTypeConstants;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.sdo.EDataObject;
+
+public class EDataGraphCreatorHelper
+implements AttributeTypeConstants
+{
+	/*
+	 * TODO Make mutlithreaded
+	 */
+	public static void createChildren(
+			EList<EObject> children,
+			LdapContext containerContext) 
+	throws NamingException
+	{
+		LdapContext eContainmentFeatureContext = 
+			null;
+		
+		Iterator<EObject> iterator                             = 
+			children.iterator();
+		
+		while(iterator.hasNext())
+		{
+			EObject eObject                                           =             
+				iterator.next();
+			
+			EStructuralFeature eContainmentFeature  =
+				eObject.eContainingFeature();
+				
+			String eContainingFeatureContextName    =
+				CN + "="+ eContainmentFeature.getName();
+			
+			if (eContainmentFeatureContext == null)
+			{
+				eContainmentFeatureContext                     = 
+					(LdapContext) 
+					containerContext.
+					createSubcontext(
+							eContainingFeatureContextName);
+			}
+			
+			String eDataObjectRDN                                = 
+				EDataObjectCreator.create((
+					EDataObject) eObject, 
+					eContainmentFeatureContext);
+			
+			LdapContext childContext                            = 
+				(LdapContext) 
+				eContainmentFeatureContext.
+				lookup(eDataObjectRDN);
+			
+			children                                                          = 
+				eObject.eContents();
+			
+			if ( children.size()> 0)
+			{
+				createChildren(
+						children,
+						childContext);
+			}
+		}
+	}
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/create/EDataObjectCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/create/EDataObjectCreator.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/create/EDataObjectCreator.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/create/EDataObjectCreator.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,231 @@
+/*
+ *  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.tuscany.das.ldap.emf.create;
+
+import java.util.List;
+
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.ldap.LdapContext;
+
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+import org.apache.tuscany.das.ldap.util.ComplexTypeNamespaceQualifier;
+import org.apache.tuscany.das.ldap.util.QualifiedNameNormalizer;
+import org.apache.tuscany.das.ldap.util.SimpleTypeNamespaceQualifier;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.sdo.EDataObject;
+
+public class EDataObjectCreator
+implements DASConstants
+{
+    public static String create(
+    		EDataObject eDataObject, 
+    		LdapContext containerContext) 
+    throws NamingException
+    {
+    	String rdn                                                      =
+            null;
+        Object dataObjectID                                    =
+            null;
+        
+        EcorePackage ecorePackage                       =
+        	EcorePackage.eINSTANCE;
+        
+        EClass eClass                                              = 
+            eDataObject.eClass();
+        
+    	EAttribute idEAttribute                               =
+        	eClass.getEIDAttribute();
+        
+        String namespaceURI                                  =
+            eClass.getEPackage().getNsURI();
+        
+        List<EAttribute> eAttributes                    = 
+            eClass.getEAllAttributes();
+        
+        String qualifiedEAttributeName                 =
+            null;
+        String normalizedEAttributeName             =
+            null;
+
+        Attributes attributes                                   =
+            new BasicAttributes();
+
+        for (EAttribute eAttribute : eAttributes)
+        {
+            qualifiedEAttributeName                         =
+                SimpleTypeNamespaceQualifier.
+                qualify( 
+                    namespaceURI, 
+                    eClass.getName(), 
+                    eAttribute.getName() );
+            
+            normalizedEAttributeName                    =
+            	QualifiedNameNormalizer.
+            	normalize(qualifiedEAttributeName);
+            
+            	if (eAttribute.getEType() == ecorePackage.getEString())
+            	{
+                    Object eAttributeValue                        = 
+                        eDataObject.eGet( eAttribute );
+                    
+                    attributes.put( 
+                       		normalizedEAttributeName, 
+                            eAttributeValue.toString() );
+            	}
+            	else if ( !(eAttribute.getEType() == ecorePackage.getEBoolean() || 
+            			     eAttribute.getEType() == ecorePackage.getEBooleanObject() ) )
+            	{
+                    Object eAttributeValue                        = 
+                        eDataObject.eGet( eAttribute );
+                    
+                    attributes.put( 
+                       		normalizedEAttributeName, 
+                            eAttributeValue.toString() );
+            	}
+            	else
+            	{
+                    Boolean eAttributeValue                      = 
+                        (Boolean) eDataObject.eGet( eAttribute );
+                    
+                    if (eAttributeValue == false)
+                    {
+                        attributes.put( 
+                           		normalizedEAttributeName, 
+                                Boolean.FALSE.toString().toUpperCase() );
+                    }
+                    else
+                    {
+                        attributes.put( 
+                           		normalizedEAttributeName, 
+                                Boolean.TRUE.toString().toUpperCase() );
+                    }
+            }
+        }
+        
+        List<EReference> eReferences                   =
+        	eClass.getEAllContainments();
+        
+        for (EReference eReference : eReferences)
+        {
+        	String qualifiedEReferenceName             =
+                SimpleTypeNamespaceQualifier.
+                qualify( 
+                    namespaceURI, 
+                    eClass.getName(), 
+                    eReference.getName() );
+            
+            String normalizedEReferenceName         =
+            	QualifiedNameNormalizer.
+            	normalize(qualifiedEReferenceName);
+        	
+            if (eReference.isMany())
+            {
+            	List<EDataObject> containedEDataObjects =
+            		(List<EDataObject>) eDataObject.eGet(eReference);
+            	
+            	Attribute idAttribute                                        =
+            		new BasicAttribute(normalizedEReferenceName);
+
+            	for (EDataObject containedEDataObject : containedEDataObjects)
+            	{
+            		EClass containedEDataObjectEClass          =
+                		containedEDataObject.eClass();
+                	
+                	String containedEDataObjectID                   =
+                		(String) containedEDataObject.eGet(
+        					containedEDataObjectEClass.
+        					getEIDAttribute());
+                	
+                	idAttribute.add(containedEDataObjectID);
+            	}
+            	attributes.put(idAttribute);
+            }
+            else
+            {
+            	EDataObject containedEDataObject          =
+            		(EDataObject) 
+            		eDataObject.eGet(eReference);
+
+            	if (containedEDataObject != null)
+            	{
+                	EClass containedEDataObjectEClass      =
+                		containedEDataObject.eClass();
+                	
+                	String containedEDataObjectID               =
+                		(String) containedEDataObject.eGet(
+        					containedEDataObjectEClass.
+        					getEIDAttribute());
+                	
+                	attributes.put(
+                			normalizedEReferenceName, 
+                			containedEDataObjectID);
+            	}
+            }
+        }
+        
+        String qualifiedEClassName                        =
+            ComplexTypeNamespaceQualifier.
+            qualify( 
+                namespaceURI, 
+                eClass.getName() );
+        
+        String normalizedEClassName                   =
+        	QualifiedNameNormalizer.
+        	normalize(qualifiedEClassName);
+
+        Attribute objectClassAttribute                  =
+        	new BasicAttribute("objectClass");
+        
+        objectClassAttribute.
+        add(normalizedEClassName);
+        
+        attributes.put(objectClassAttribute);
+        
+        dataObjectID                                               =
+            eDataObject.eGet(idEAttribute );
+        
+        qualifiedEAttributeName                            =
+            SimpleTypeNamespaceQualifier.
+            qualify( 
+                namespaceURI, 
+                eClass.getName(), 
+                idEAttribute.getName() );
+        
+        normalizedEAttributeName                        =
+        	QualifiedNameNormalizer.
+        	normalize(qualifiedEAttributeName);
+        
+        rdn                                                                 = 
+        	normalizedEAttributeName + "=" + dataObjectID;  
+        
+        containerContext.createSubcontext( 
+            rdn, 
+            attributes );
+        
+        return rdn;
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/read/EDataGraphReader.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/read/EDataGraphReader.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/read/EDataGraphReader.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/read/EDataGraphReader.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,110 @@
+/*
+ *  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.tuscany.das.ldap.emf.read;
+
+import java.util.List;
+
+import javax.naming.NamingException;
+import javax.naming.directory.Attributes;
+import javax.naming.ldap.LdapContext;
+
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+import org.apache.tuscany.das.ldap.util.QualifiedNameNormalizer;
+import org.apache.tuscany.das.ldap.util.SimpleTypeNamespaceQualifier;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.sdo.EDataGraph;
+import org.eclipse.emf.ecore.sdo.EDataObject;
+import org.eclipse.emf.ecore.sdo.SDOFactory;
+
+public class EDataGraphReader
+implements DASConstants
+{
+    public static EDataGraph read(
+    		EClass eClass,
+    		String id,
+    		LdapContext containerContext) 
+    throws NamingException
+    {
+    	EDataGraph eDataGraph                                 =
+        		SDOFactory.eINSTANCE.createEDataGraph();
+
+    	String namespaceURI                                  =
+            eClass.getEPackage().
+            getNsURI();
+
+        EAttribute idEAttribute                               =
+    		eClass.getEIDAttribute();
+
+        String qualifiedIDEAttributeName              =
+            SimpleTypeNamespaceQualifier.
+            qualify( 
+                namespaceURI, 
+                eClass.getName(), 
+                idEAttribute.getName() );
+        
+    	String normalizedIDEAttributeName         =
+        	QualifiedNameNormalizer.
+        	normalize(qualifiedIDEAttributeName);
+        
+    	String eDataObjectRDN                              = 
+        	normalizedIDEAttributeName + "=" + id;
+        
+        LdapContext eDataObjectContext            =
+        	(LdapContext) 
+        	containerContext.
+        	lookup(eDataObjectRDN);
+        
+        Attributes attributes                                 = 
+        	containerContext.
+        	getAttributes(eDataObjectRDN);
+        
+    	EDataObject containerDataObject          =
+    		EDataGraphReaderHelper.
+    		restoreEDataObject(
+    				eClass, 
+    				namespaceURI, 
+    				attributes);
+    	
+    	EDataGraphReaderHelper.
+    	addContainmentDataObjects(
+    			containerDataObject, 
+    			attributes, 
+    			namespaceURI, 
+    			eDataObjectContext);
+    	
+    	List<EReference> eReferences               =
+    		eClass.getEAllContainments();
+    	
+    	if (eClass.getEAllContainments().size() > 0)
+    	{
+    		EDataGraphReaderHelper.
+        	addContainmentDataObjects(
+        			containerDataObject, 
+        			attributes, 
+        			namespaceURI, 
+        			eDataObjectContext);
+    	}
+    	eDataGraph.setERootObject(containerDataObject);
+    	
+      return eDataGraph;
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/read/EDataGraphReaderHelper.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/read/EDataGraphReaderHelper.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/read/EDataGraphReaderHelper.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/read/EDataGraphReaderHelper.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,219 @@
+/*
+ *  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.tuscany.das.ldap.emf.read;
+
+import java.util.List;
+
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.ldap.LdapContext;
+
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+import org.apache.tuscany.das.ldap.util.QualifiedNameNormalizer;
+import org.apache.tuscany.das.ldap.util.SimpleTypeNamespaceQualifier;
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.sdo.EDataObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+public class EDataGraphReaderHelper
+implements DASConstants
+{
+
+    public static EDataObject restoreEDataObject(
+    		EClass eClass,
+    		String namespaceURI,
+    		Attributes attributes) 
+    throws NamingException
+    {
+        EDataObject eDataObject =
+        	(EDataObject)
+        	eClass.getEPackage().
+        	getEFactoryInstance().
+        	create(eClass);
+
+    	List<EAttribute> eAttributes                    = 
+            eClass.getEAllAttributes();
+
+    	for (EAttribute eAttribute : eAttributes)
+    	{
+            String qualifiedEAttributeName             =
+                SimpleTypeNamespaceQualifier.
+                qualify( 
+                    namespaceURI, 
+                    eClass.getName(), 
+                    eAttribute.getName() );
+            
+        	String normalizedEAttributeName         =
+            	QualifiedNameNormalizer.
+            	normalize(qualifiedEAttributeName);
+        	
+        	String value                                              = 
+        		(String) 
+        		attributes.
+        		get(normalizedEAttributeName).
+        		get();
+        	
+        	eDataObject.eSet(
+        			eAttribute, 
+        			EcoreUtil.createFromString(
+        					eAttribute.getEAttributeType(), 
+        					value));
+    	}
+        return eDataObject;
+    }
+    
+    public static void addContainmentDataObjects(
+    		EDataObject containerDataObject,
+    		Attributes attributes,
+    		String namespaceURI,
+    		LdapContext eDataObjectContext) throws NamingException
+    {
+    	EClass eClass                                            =
+    		containerDataObject.eClass();
+    	
+    	List<EReference> eReferences               =
+    		eClass.getEAllContainments();
+    	
+    	for (EReference eReference : eReferences)
+    	{
+            String qualifiedEReferenceName          =
+                SimpleTypeNamespaceQualifier.
+                qualify( 
+                    namespaceURI, 
+                    eClass.getName(), 
+                    eReference.getName() );
+            
+        	String normalizedReferenceName         =
+            	QualifiedNameNormalizer.
+            	normalize(qualifiedEReferenceName);
+        	
+        	Attribute attribute                                  =
+        		attributes.
+        		get(normalizedReferenceName);
+        	
+        	if (attribute.size() > 0)
+        	{
+        		LdapContext eReferenceContainmentContext = 
+        			(LdapContext) 
+        			eDataObjectContext.
+        			lookup("cn=" + eReference.getName());
+        		
+        		EClass eReferenceType                                 =
+        			(EClass) eReference.getEType();
+        		
+        		EAttribute eReferenceTypeEIDAttribute     =
+        			eReferenceType.getEIDAttribute();
+        
+        		String qualifiedEReferenceTypeIDEAttributeName  =
+                    SimpleTypeNamespaceQualifier.
+                    qualify( 
+                        namespaceURI, 
+                        eReferenceType.getName(), 
+                        eReferenceTypeEIDAttribute.getName() );
+                
+            	String normalizedReferenceTypeEIDAttributeName         =
+                	QualifiedNameNormalizer.
+                	normalize(qualifiedEReferenceTypeIDEAttributeName);
+            	
+        		if (eReference.isMany())
+        		{
+        	    	EList<EDataObject> containmentList =
+        	    		new BasicEList<EDataObject>();
+        	    	
+                	NamingEnumeration idNamingEnumeration =
+                		attribute.getAll();
+                	
+                	while(idNamingEnumeration.hasMore())
+                	{
+                		String containedDataObjectID                    = 
+                			(String) idNamingEnumeration.next();
+                		
+                		String containedDataObjectEntryRDN       =
+                			normalizedReferenceTypeEIDAttributeName
+                			+ "=" + containedDataObjectID;
+                		
+                		Attributes eReferenceAttributes                =
+                			eReferenceContainmentContext.
+                			getAttributes(containedDataObjectEntryRDN);
+                		
+                		EDataObject eReferenceDataObject             = 
+                			EDataGraphReaderHelper.
+                			restoreEDataObject(
+                					eReferenceType,
+                					namespaceURI,
+                					eReferenceAttributes);
+                		
+                		containmentList.add(eReferenceDataObject);
+                		
+                		if (eReferenceDataObject.eClass().getEAllContainments().size() > 0)
+                		{
+                			addContainmentDataObjects(
+                		    		eReferenceDataObject,
+                		    		eReferenceAttributes,
+                		    		namespaceURI,
+                		    		(LdapContext) eReferenceContainmentContext.
+                		    		lookup(containedDataObjectEntryRDN));
+                			
+                		}
+                	}
+                	containerDataObject.eSet(eReference, containmentList);
+        		}
+        		else
+        		{
+        			String containedDataObjectID                    = 
+            			(String) attribute.get();
+
+            		String containedDataObjectEntryRDN       =
+            			normalizedReferenceTypeEIDAttributeName
+            			+ "=" + containedDataObjectID;
+            		
+            		Attributes eReferenceAttributes                =
+            			eReferenceContainmentContext.
+            			getAttributes(containedDataObjectEntryRDN);
+            		
+            		EDataObject eReferenceDataObject          = 
+            			EDataGraphReaderHelper.
+            			restoreEDataObject(
+            					eReferenceType,
+            					namespaceURI,
+            					eReferenceAttributes);
+            		
+                	containerDataObject.eSet(eReference, eReferenceDataObject);
+
+                	if (eReferenceDataObject.eClass().getEAllContainments().size() > 0)
+            		{
+            			addContainmentDataObjects(
+            		    		eReferenceDataObject,
+            		    		eReferenceAttributes,
+            		    		namespaceURI,
+            		    		(LdapContext) eReferenceContainmentContext.
+            		    		lookup(containedDataObjectEntryRDN));
+            		}
+            	}
+       		}
+       	}
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/read/EDataObjectReader.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/read/EDataObjectReader.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/read/EDataObjectReader.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/emf/read/EDataObjectReader.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,171 @@
+/*
+ *  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.tuscany.das.ldap.emf.read;
+
+import java.util.List;
+
+import javax.naming.NamingException;
+import javax.naming.directory.Attributes;
+import javax.naming.ldap.LdapContext;
+
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+import org.apache.tuscany.das.ldap.util.QualifiedNameNormalizer;
+import org.apache.tuscany.das.ldap.util.SimpleTypeNamespaceQualifier;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.sdo.EDataObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+public class EDataObjectReader
+implements DASConstants
+{
+
+    public static EDataObject read(
+    		EClass eClass,
+    		String id,
+    		LdapContext containerContext) 
+    throws NamingException
+    {
+        String namespaceURI                                  =
+            eClass.getEPackage().
+            getNsURI();
+
+        EAttribute idEAttribute                               =
+    		eClass.getEIDAttribute();
+
+        String qualifiedIDEAttributeName              =
+            SimpleTypeNamespaceQualifier.
+            qualify( 
+                namespaceURI, 
+                eClass.getName(), 
+                idEAttribute.getName() );
+        
+    	String normalizedIDEAttributeName         =
+        	QualifiedNameNormalizer.
+        	normalize(qualifiedIDEAttributeName);
+        
+    	String eDataObjectRDN                              = 
+        	normalizedIDEAttributeName + "=" + id;
+        
+        LdapContext eDataObjectContext            =
+        	(LdapContext) 
+        	containerContext.
+        	lookup(eDataObjectRDN);
+        
+        Attributes attributes                                  = 
+        	eDataObjectContext.getAttributes("");
+        
+        EDataObject eDataObject =
+        	(EDataObject)
+        	eClass.getEPackage().
+        	getEFactoryInstance().
+        	create(eClass);
+
+    	List<EAttribute> eAttributes                    = 
+            eClass.getEAllAttributes();
+
+    	for (EAttribute eAttribute : eAttributes)
+    	{
+            String qualifiedEAttributeName             =
+                SimpleTypeNamespaceQualifier.
+                qualify( 
+                    namespaceURI, 
+                    eClass.getName(), 
+                    eAttribute.getName() );
+            
+        	String normalizedEAttributeName         =
+            	QualifiedNameNormalizer.
+            	normalize(qualifiedEAttributeName);
+        	
+        	String value                                              = 
+        		(String) 
+        		attributes.
+        		get(normalizedEAttributeName).
+        		get();
+        	
+        	eDataObject.eSet(
+        			eAttribute, 
+        			EcoreUtil.createFromString(
+        					eAttribute.getEAttributeType(), 
+        					value));
+    	}
+        return eDataObject;
+    }
+
+    
+    //TODO Test all of these verifying that we get out what we put in
+    //TODO Move to helper
+    //TODO Note that we are using         	eDataObject.eSet(eAttribute, EcoreUtil.createFromString(eAttribute.getEAttributeType(), value)); instead
+    /*
+    public static void setEDataObjectFeature(
+    		EDataObject eDataObject,
+    		String value,
+    		EAttribute eAttribute)
+    {
+    	if (eAttribute.getEType() == EcorePackage.eINSTANCE.getEString())
+    	{
+    		eDataObject.eSet(eAttribute, value);
+    	}
+    	else if (
+    			eAttribute.getEType() == EcorePackage.eINSTANCE.getEInt() ||
+    			eAttribute.getEType() == EcorePackage.eINSTANCE.getEIntegerObject())
+    	{
+    		eDataObject.eSet(eAttribute, new Integer(value));
+    	}
+    	else if (eAttribute.getEType() == EcorePackage.eINSTANCE.getEBoolean() ||
+    			eAttribute.getEType() == EcorePackage.eINSTANCE.getEBooleanObject())
+    	{
+    		eDataObject.eSet(eAttribute, new Boolean(value));
+    	}
+    	else if (eAttribute.getEType() == EcorePackage.eINSTANCE.getEFloat() ||
+    			eAttribute.getEType() == EcorePackage.eINSTANCE.getEFloatObject())
+    	{
+    		eDataObject.eSet(eAttribute, new Float(value));
+    	}
+    	else if (eAttribute.getEType() == EcorePackage.eINSTANCE.getEDouble() ||
+    			eAttribute.getEType() == EcorePackage.eINSTANCE.getEDoubleObject())
+    	{
+    		eDataObject.eSet(eAttribute, new Double(value));
+    	}
+    	else if (eAttribute.getEType() == EcorePackage.eINSTANCE.getEBigDecimal()) 
+    	{
+    		eDataObject.eSet(eAttribute, new BigDecimal(value));
+    	}
+    	else if (eAttribute.getEType() == EcorePackage.eINSTANCE.getEBigInteger() )
+    	{
+    		eDataObject.eSet(eAttribute, new BigInteger(value));
+    	}
+    	else if (eAttribute.getEType() == EcorePackage.eINSTANCE.getEByte() ||
+    			eAttribute.getEType() == EcorePackage.eINSTANCE.getEByteObject())
+    	{
+    		eDataObject.eSet(eAttribute, new Byte(value));
+    	}
+    	else if (eAttribute.getEType() == EcorePackage.eINSTANCE.getEByte() ||
+    			eAttribute.getEType() == EcorePackage.eINSTANCE.getEByteObject())
+    	{
+    		eDataObject.eSet(eAttribute, new Byte(value));
+    	}
+      	else if (eAttribute.getEType() == EcorePackage.eINSTANCE.getEByteArray())
+    	{
+      		throw new RuntimeException("Sorry - ByteArrays are not supported.");
+    	}
+    }
+    */
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/encryption/constants/EncryptionConstants.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/encryption/constants/EncryptionConstants.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/encryption/constants/EncryptionConstants.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/encryption/constants/EncryptionConstants.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,26 @@
+/*
+ *  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.tuscany.das.ldap.encryption.constants;
+
+public interface EncryptionConstants
+{
+    String MD5 = "MD5";
+    String SHA1 = "SHA-1";//Produces longer hashes than MD5
+}

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/encryption/util/ChecksumUtils.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/encryption/util/ChecksumUtils.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/encryption/util/ChecksumUtils.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/encryption/util/ChecksumUtils.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,38 @@
+
+package org.apache.tuscany.das.ldap.encryption.util;
+
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+import org.apache.tuscany.das.ldap.encryption.constants.EncryptionConstants;
+
+public class ChecksumUtils
+implements EncryptionConstants
+{
+    public static String computeMD5Hash(String string) 
+    throws NoSuchAlgorithmException
+    {
+        MessageDigest messageDigest = MessageDigest.getInstance(MD5);
+        
+        byte[] digest               = 
+            messageDigest.digest(string.getBytes());
+    
+        StringBuffer hexString = new StringBuffer();
+        for (int i=0;i<digest.length;i++) {
+          hexString.append (
+            Integer.toHexString(0xFF & digest[i]));
+        }
+    
+        char[] hexStringCharacters = hexString.toString().toCharArray();
+        String checksum = "";
+        
+        for( char i : hexStringCharacters)
+        {
+            int ascii = (int) i;
+            checksum = checksum + Integer.toString(ascii);
+        }
+ 
+        return checksum;
+    }
+
+}

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/impl/DASImpl.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/impl/DASImpl.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/impl/DASImpl.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/impl/DASImpl.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,77 @@
+/*
+ *  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.tuscany.das.ldap.impl;
+
+
+import java.util.Iterator;
+import java.util.List;
+
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.DirContext;
+
+import org.apache.tuscany.das.ldap.DAS;
+import org.apache.tuscany.das.ldap.configuration.model.v100.DASConfiguration;
+import org.apache.tuscany.das.ldap.schema.constants.AttributeTypeConstants;
+import org.apache.tuscany.das.ldap.util.LDAPNormalizer;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.sdo.EDataGraph;
+
+/**
+ * The Class DASImpl.
+ */
+public class DASImpl 
+implements DAS, AttributeTypeConstants
+{
+    public void write( EDataGraph EDataGraph, Object connection )
+    {
+        
+        
+    }
+
+    public void delete( EDataGraph EDataGraph, Object connection )
+    {
+        
+    }
+
+    @Override
+    public EDataGraph read( String[] queryParameters, Object connection )
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public void update( EDataGraph EDataGraph, Object connection )
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+
+}

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/impl/DASImplHelper.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/impl/DASImplHelper.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/impl/DASImplHelper.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/impl/DASImplHelper.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,135 @@
+package org.apache.tuscany.das.ldap.impl;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.InitialDirContext;
+
+import org.apache.directory.server.core.configuration.Configuration;
+import org.apache.directory.server.core.configuration.MutablePartitionConfiguration;
+import org.apache.directory.server.core.configuration.MutableStartupConfiguration;
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.tuscany.das.ldap.create.InitialContextCreator;
+import org.apache.tuscany.das.ldap.schema.constants.AttributeTypeConstants;
+import org.apache.tuscany.das.ldap.schema.constants.SchemaObjectClassConstants;
+import org.apache.tuscany.das.ldap.util.LDAPNormalizer;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EcorePackage;
+
+/**
+ * The Class DASHelper.
+ */
+public class DASImplHelper 
+implements AttributeTypeConstants, SchemaObjectClassConstants
+{
+    
+    private static Map<String, EDataType> dataTypeMap = null;
+    /*
+    private static void createDummySyntaxChecker( 
+        String oid, 
+        String schema ) 
+    throws NamingException
+    {
+        List<String> descriptions = new ArrayList<String>();
+        descriptions.add( 
+            "( " 
+            + oid 
+            + " DESC 'bogus desc' FQCN " + AcceptAllSyntaxChecker.class.getName() 
+            + " X-SCHEMA '" 
+            + schema 
+            + "' )" );
+        modify( 
+            DirContext.ADD_ATTRIBUTE, 
+            descriptions, 
+            "syntaxCheckers" );
+    }
+
+    
+    private void modify( 
+        int op, 
+        List<String> descriptions, 
+        String opAttr ) 
+    throws NamingException
+    {
+        LdapDN dn = new LdapDN( getSubschemaSubentryDN() );
+        Attribute attr = new AttributeImpl( opAttr );
+        for ( String description : descriptions )
+        {
+            attr.add( description );
+        }
+        
+        Attributes mods = new AttributesImpl();
+        mods.put( attr );
+        
+        rootDSE.modifyAttributes( dn, op, mods );
+    }
+    
+*/
+
+    public static void writeSyntax(EDataType eDataType)
+    {
+    }
+    
+    public static void createModelTypeSystem(EPackage ePackage)
+    {
+    }
+
+    public static void createWriteSequence(EPackage ePackage)
+    {
+    }
+    
+    public static void writeXSDSyntaxEntries()
+    {
+    }
+    
+    public static void writeXSDAttributeTypes()
+    {
+        
+    }
+    
+    public static void writeSDOObjectClass()
+    {
+        
+    }
+    
+    public static void writeEPackageEntry(
+        EPackage ePackage, 
+        DirContext namespacedSchemaContext) 
+    throws NamingException
+    {
+        Attribute ePackageObjectClassAttribute  = 
+            new BasicAttribute(OBJECT_CLASS, "ePackageObjectClass");
+        Attribute nsPrefixAttribute             = 
+            new BasicAttribute("nsPrefix", ePackage.getNsPrefix());
+        Attribute nsNamespaceAttribute          = 
+            new BasicAttribute("nsNamespace", ePackage.getNsPrefix());
+        
+        Attributes attributes = new BasicAttributes();
+        attributes.put(ePackageObjectClassAttribute);
+        attributes.put(nsPrefixAttribute);
+        attributes.put(nsNamespaceAttribute);
+        
+        namespacedSchemaContext.createSubcontext( 
+            "cn=ePackage", attributes);
+    }
+
+}

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/oid/create/ComplexTypeOIDCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/oid/create/ComplexTypeOIDCreator.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/oid/create/ComplexTypeOIDCreator.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/oid/create/ComplexTypeOIDCreator.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,69 @@
+/*
+ *  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.tuscany.das.ldap.oid.create;
+
+import org.apache.tuscany.das.ldap.encryption.constants.EncryptionConstants;
+import org.apache.tuscany.das.ldap.encryption.util.ChecksumUtils;
+import org.apache.tuscany.das.ldap.util.ComplexTypeNamespaceQualifier;
+
+/**
+ * The Class UniqueOIDCreator.
+ * Creates unique OIDs for namespaced
+ * metadata such as the XSD DataType
+ * with (Class specific term) qualifiedNameURI 
+ * http://www.w3.org/2001/XMLSchema/string
+ * 
+ */
+public class ComplexTypeOIDCreator implements EncryptionConstants
+{
+    /**
+     * Creates a unique OID.
+     * 
+     * @param instanceClassName the instance class name
+     * @param oidPrefix the OID Branch
+     * @param simpleTypeName the name
+     * @param namespaceURI the metadata namespace URI
+     * 
+     * @return the string
+     * 
+     * @throws Exception the exception
+     */
+    public static String create(
+        String oidPrefix,
+        String namespaceURI,
+        String complexTypeName) 
+    throws Exception
+    {
+        String qualifiedNameURI = 
+            ComplexTypeNamespaceQualifier.qualify(
+                namespaceURI, 
+                complexTypeName);
+
+        String postfixOID = 
+            ChecksumUtils.computeMD5Hash(
+                qualifiedNameURI);
+        
+        postfixOID = 
+            OIDCreatorHelper.
+            calculateSegmentedOID(postfixOID);
+
+        return oidPrefix + "." + postfixOID;
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/oid/create/OIDCreatorHelper.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/oid/create/OIDCreatorHelper.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/oid/create/OIDCreatorHelper.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/oid/create/OIDCreatorHelper.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,73 @@
+/*
+ *  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.tuscany.das.ldap.oid.create;
+
+public class OIDCreatorHelper
+{
+    private static int MAX_OID_SEGMENT_LENGTH = 8;
+    /**
+     * Calculate segmented OID.
+     * 
+     * @param oid the oid
+     * 
+     * @return the string
+     * 
+     * @throws Exception the exception
+     * 
+     * Note that the OID must be divided
+     * into segments less than 9 characters
+     * long.  This is an ApacheDS restriction
+     * on OID segment length.
+     */
+    public static String calculateSegmentedOID(String oid) throws Exception
+    {
+        if (oid.length() < 10)
+        {
+            throw new Exception("The length of the oid must be greater than 9 in order to ensure uniqueness.");
+        }
+        int oidLength = oid.length();
+        int numberOfPeriods  = oidLength / MAX_OID_SEGMENT_LENGTH;
+        
+        int beginIndex = 0;
+        int endIndex = MAX_OID_SEGMENT_LENGTH;
+        
+        String segmentedOID = 
+            oid.substring(beginIndex, endIndex ) + ".";
+
+        for (int i = 2; i < numberOfPeriods; i++)
+        {
+            beginIndex = (i-1) * MAX_OID_SEGMENT_LENGTH + 1;
+            endIndex = i * MAX_OID_SEGMENT_LENGTH;
+            segmentedOID +=  oid.substring( beginIndex, endIndex ) + ".";
+        }
+        int finalSegmentLength = oid.length() - (endIndex + 2);
+        
+        if ( finalSegmentLength > MAX_OID_SEGMENT_LENGTH )
+        {
+            segmentedOID += oid.substring( endIndex + 1,endIndex + 9  ) + ".";
+            segmentedOID += oid.substring( endIndex + 10, oid.length()  );
+        }
+        else
+        {
+            segmentedOID += oid.substring( endIndex + 1, oid.length()  );            
+        }
+        return segmentedOID;
+    }
+}

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/oid/create/SimpleTypeOIDCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/oid/create/SimpleTypeOIDCreator.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/oid/create/SimpleTypeOIDCreator.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/oid/create/SimpleTypeOIDCreator.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,66 @@
+/*
+ *  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.tuscany.das.ldap.oid.create;
+
+import org.apache.tuscany.das.ldap.encryption.constants.EncryptionConstants;
+import org.apache.tuscany.das.ldap.encryption.util.ChecksumUtils;
+import org.apache.tuscany.das.ldap.util.SimpleTypeNamespaceQualifier;
+
+/**
+ * The Class SimpleTypeOIDCreator.
+ * Creates unique OIDs for namespaced
+ * metadata such as the XSD DataType
+ * with (Class specific term) qualifiedNameURI 
+ * http://www.w3.org/2001/XMLSchema/string
+ * 
+ */
+public class SimpleTypeOIDCreator implements EncryptionConstants
+{
+    /**
+     * Creates a unique OID.
+     * 
+     * @param instanceClassName the instance class name
+     * @param oidPrefix the OID Branch
+     * @param complexTypeName the name
+     * @param namespaceURI the metadata namespace URI 
+     * 
+     * @return the string
+     * 
+     * @throws Exception the exception
+     */
+    public static String create(
+        String oidPrefix,
+        String namespaceURI,
+        String complexTypeName,
+        String simpleTypeName) 
+    throws Exception
+    {
+        String qualifiedNameURI = 
+            SimpleTypeNamespaceQualifier.qualify(
+                namespaceURI, 
+                complexTypeName, 
+                simpleTypeName);
+
+        String postfixOID = ChecksumUtils.computeMD5Hash(qualifiedNameURI);
+        
+        postfixOID = OIDCreatorHelper.calculateSegmentedOID(postfixOID);
+        return oidPrefix + "." + postfixOID;
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/AbstractAttributeTypeCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/AbstractAttributeTypeCreator.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/AbstractAttributeTypeCreator.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/AbstractAttributeTypeCreator.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,40 @@
+/*
+ *  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.tuscany.das.ldap.schema.create;
+
+/**
+ * The Class AbstractAttributeTypeCreator.
+ */
+public abstract class AbstractAttributeTypeCreator
+extends AbstractTypeCreator
+{
+    
+    public AbstractAttributeTypeCreator() 
+    {
+        super();
+
+        objectClassAttribute.add( META_ATTRIBUTE_TYPE );
+        basicAttributes.put( M_COLLECTIVE,           LDAP_FALSE );
+        basicAttributes.put( M_EQUALITY,             M_EQUALITY__NAME_OR_NUMERIC_ID_MATCH );
+        basicAttributes.put( M_NO_USER_MODIFICATION, LDAP_FALSE);
+        basicAttributes.put( M_SINGLE_VALUE,         LDAP_FALSE );
+        basicAttributes.put( M_USAGE,                LDAP_USER_APPLICATIONS);
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/AbstractTypeCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/AbstractTypeCreator.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/AbstractTypeCreator.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/AbstractTypeCreator.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,59 @@
+/*
+ *  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.tuscany.das.ldap.schema.create;
+
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+import org.apache.tuscany.das.ldap.schema.constants.AttributeTypeConstants;
+import org.apache.tuscany.das.ldap.schema.constants.EnumeratedSchemaAttributeTypeValues;
+import org.apache.tuscany.das.ldap.schema.constants.ObjectClassConstants;
+import org.apache.tuscany.das.ldap.schema.constants.SchemaAttributeTypeConstants;
+import org.apache.tuscany.das.ldap.schema.constants.SchemaObjectClassConstants;
+
+public abstract class AbstractTypeCreator 
+implements 
+EnumeratedSchemaAttributeTypeValues,
+SchemaAttributeTypeConstants,
+AttributeTypeConstants,
+SchemaObjectClassConstants,
+ObjectClassConstants,
+DASConstants
+{
+    protected Attribute objectClassAttribute; 
+    protected Attributes basicAttributes;
+    
+    public AbstractTypeCreator() 
+    {
+        objectClassAttribute    = 
+            new BasicAttribute( 
+                OBJECT_CLASS, TOP );
+        
+        objectClassAttribute.add( 
+            META_TOP );
+        
+        basicAttributes = new BasicAttributes();
+        basicAttributes.put(objectClassAttribute);
+        basicAttributes.put( M_OBSOLETE, LDAP_FALSE );
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/ComplexTypeRDNCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/ComplexTypeRDNCreator.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/ComplexTypeRDNCreator.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/ComplexTypeRDNCreator.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,60 @@
+/*
+ *  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.tuscany.das.ldap.schema.create;
+
+import org.apache.tuscany.das.ldap.oid.create.ComplexTypeOIDCreator;
+import org.apache.tuscany.das.ldap.schema.constants.SchemaAttributeTypeConstants;
+
+/**
+ * The Class DataTypeRDNCreator.
+ */
+public class ComplexTypeRDNCreator
+implements SchemaAttributeTypeConstants
+{
+    /**
+     * Create.
+     * 
+     * @param oidPrefix the oid prefix
+     * @param namespaceURI the namespace URI
+     * @param complexTypeName the complex type name
+     * 
+     * @return the string that is the rdn
+     * 
+     * @throws Exception the exception
+     */
+    public static String create(
+        String oidPrefix,
+        String namespaceURI,
+        String complexTypeName
+        )
+    throws Exception
+    {
+        String oid = 
+            ComplexTypeOIDCreator.create( 
+                oidPrefix,
+                namespaceURI,
+                complexTypeName );
+        
+        String rdn = 
+            M_OID + "="  + oid;
+        
+        return rdn;
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MComplexMayAttributeTypeCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MComplexMayAttributeTypeCreator.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MComplexMayAttributeTypeCreator.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MComplexMayAttributeTypeCreator.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,52 @@
+/*
+ *  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.tuscany.das.ldap.schema.create;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+public class MComplexMayAttributeTypeCreator
+extends AbstractAttributeTypeCreator
+{
+    public MComplexMayAttributeTypeCreator()
+    {
+        super();
+    }
+    
+    public void create(
+        DirContext attributeTypesContext,
+        String  oidPrefix) 
+    throws NamingException, Exception
+    {
+        basicAttributes.put( M_DESCRIPTION, M_COMPLEX_MAY_DESCRIPTION);
+        basicAttributes.put( M_SYNTAX,      OID_SYNTAX_OID_VALUE );
+        basicAttributes.put( M_NAME,        M_COMPLEX_MAY );
+        
+        String rdn = 
+            SimpleTypeRDNCreator.create( 
+                oidPrefix, 
+                DAS_XSD_NAMESPACE,
+                M_META_TOP_SDO_OBJECT_CLASS,
+                M_COMPLEX_MAY);
+        
+        attributeTypesContext.createSubcontext(
+            rdn, basicAttributes );
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MComplexMustAttributeTypeCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MComplexMustAttributeTypeCreator.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MComplexMustAttributeTypeCreator.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MComplexMustAttributeTypeCreator.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,52 @@
+/*
+ *  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.tuscany.das.ldap.schema.create;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+public class MComplexMustAttributeTypeCreator 
+extends AbstractAttributeTypeCreator 
+{
+    public MComplexMustAttributeTypeCreator()
+    {
+        super();
+    }
+    
+    public void create(
+        DirContext attributeTypesContext,
+        String oidPrefix) 
+    throws NamingException, Exception
+    {
+        basicAttributes.put(M_DESCRIPTION, M_COMPLEX_MUST_DESCRIPTION);
+        basicAttributes.put(M_SYNTAX,      OID_SYNTAX_OID_VALUE );
+        basicAttributes.put(M_NAME,        M_COMPLEX_MUST);
+
+        String rdn = 
+            SimpleTypeRDNCreator.create( 
+                oidPrefix,
+                DAS_XSD_NAMESPACE,
+                M_META_TOP_SDO_OBJECT_CLASS,
+                M_COMPLEX_MUST);
+        
+        attributeTypesContext.createSubcontext(
+            rdn, basicAttributes );
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MIDAttributeTypeCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MIDAttributeTypeCreator.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MIDAttributeTypeCreator.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MIDAttributeTypeCreator.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,52 @@
+/*
+ *  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.tuscany.das.ldap.schema.create;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+public class MIDAttributeTypeCreator
+extends AbstractAttributeTypeCreator
+{
+    public MIDAttributeTypeCreator()
+    {
+        super();
+    }
+    
+    public void create(
+        DirContext attributeTypesContext,
+        String  oidPrefix) 
+    throws NamingException, Exception
+    {
+        basicAttributes.put( M_DESCRIPTION, ID_DESCRIPTION);
+        basicAttributes.put( M_SYNTAX,      INTEGER_SYNTAX_OID_VALUE );
+        basicAttributes.put( M_NAME,        ID );
+        
+        String rdn = 
+            SimpleTypeRDNCreator.create( 
+                oidPrefix, 
+                DAS_XSD_NAMESPACE,
+                M_META_TOP_SDO_OBJECT_CLASS,
+                ID);
+        
+        attributeTypesContext.createSubcontext(
+            rdn, basicAttributes );
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MetaTopSDOObjectClassCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MetaTopSDOObjectClassCreator.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MetaTopSDOObjectClassCreator.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MetaTopSDOObjectClassCreator.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,101 @@
+/*
+ *  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.tuscany.das.ldap.schema.create;
+
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.DirContext;
+
+public class MetaTopSDOObjectClassCreator
+extends AbstractTypeCreator
+{
+    /**
+     * Create.
+     * 
+     * @param oidPrefix the oid prefix
+     * @param objectClassesContext the object classes context
+     * 
+     * @throws Exception the exception
+     * @throws NamingException the naming exception
+     * 
+     */
+    public MetaTopSDOObjectClassCreator()
+    {
+        super();
+    }
+    
+    public void create(
+        DirContext attributeTypesContext,
+        DirContext objectClassesContext,
+        String oidPrefix) 
+    throws NamingException, Exception
+    {
+        MComplexMayAttributeTypeCreator 
+        mComplexMayAttributeTypeCreator = 
+            new MComplexMayAttributeTypeCreator();
+        
+        mComplexMayAttributeTypeCreator.create( 
+            attributeTypesContext, 
+            oidPrefix );
+
+        MComplexMustAttributeTypeCreator 
+        mComplexMustAttributeTypeCreator = 
+            new MComplexMustAttributeTypeCreator();
+        
+        mComplexMustAttributeTypeCreator.create( 
+            attributeTypesContext, 
+            oidPrefix );
+        
+        MIDAttributeTypeCreator 
+        mIDAttributeTypeCreator = 
+            new MIDAttributeTypeCreator();
+        
+        mIDAttributeTypeCreator.create( 
+            attributeTypesContext, 
+            oidPrefix );
+
+        objectClassAttribute.add( 
+            META_OBJECT_CLASS );
+        
+        Attribute mMayAttribute  =
+            new BasicAttribute(M_MAY);
+        
+        mMayAttribute.add( M_COMPLEX_MAY );
+        mMayAttribute.add( M_COMPLEX_MUST );
+        
+        basicAttributes.put( mMayAttribute);
+//        basicAttributes.put( M_MUST,              ID);
+        basicAttributes.put( M_SUP_OBJECT_CLASS,  META_OBJECT_CLASS );
+        basicAttributes.put( M_TYPE_OBJECT_CLASS, STRUCTURAL);
+        basicAttributes.put( M_NAME,              M_META_TOP_SDO_OBJECT_CLASS);
+        basicAttributes.put( M_DESCRIPTION,
+            "Meta ObjectClass for all SDO DataObjects" );
+        
+        String rdn = 
+            ComplexTypeRDNCreator.create( 
+                oidPrefix,
+                DAS_XSD_NAMESPACE,
+                M_META_TOP_SDO_OBJECT_CLASS);
+
+        objectClassesContext.createSubcontext(
+            rdn, basicAttributes );
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/SimpleTypeRDNCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/SimpleTypeRDNCreator.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/SimpleTypeRDNCreator.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/SimpleTypeRDNCreator.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,63 @@
+/*
+ *  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.tuscany.das.ldap.schema.create;
+
+import org.apache.tuscany.das.ldap.oid.create.SimpleTypeOIDCreator;
+import org.apache.tuscany.das.ldap.schema.constants.SchemaAttributeTypeConstants;
+
+/**
+ * The Class DataTypeRDNCreator.
+ */
+public class SimpleTypeRDNCreator
+implements SchemaAttributeTypeConstants
+{
+    
+    /**
+     * Create.
+     * 
+     * @param oidPrefix the oid prefix
+     * @param namespaceURI the namespace URI
+     * @param complexTypeName the name
+     * @param simpleTypeName the simple type name
+     * 
+     * @return the string
+     * 
+     * @throws Exception the exception
+     */
+    public static String create(
+        String oidPrefix,
+        String namespaceURI,
+        String complexTypeName,
+        String simpleTypeName)
+    throws Exception
+    {
+        String oid = 
+            SimpleTypeOIDCreator.create( 
+                oidPrefix,
+                namespaceURI,
+                complexTypeName,
+                simpleTypeName);
+        
+        String rdn = 
+            M_OID + "="  + oid;
+        
+        return rdn;
+    }
+}
\ No newline at end of file



Mime
View raw message