Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 87037 invoked from network); 22 Jun 2007 16:40:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Jun 2007 16:40:31 -0000 Received: (qmail 78138 invoked by uid 500); 22 Jun 2007 16:40:34 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 78008 invoked by uid 500); 22 Jun 2007 16:40:33 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 77905 invoked by uid 99); 22 Jun 2007 16:40:32 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jun 2007 09:40:32 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jun 2007 09:40:21 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id EAEF21A9822; Fri, 22 Jun 2007 09:40:00 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r549870 [3/9] - 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: Fri, 22 Jun 2007 16:39:54 -0000 To: commits@directory.apache.org From: oersoy@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070622164000.EAEF21A9822@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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=549870 ============================================================================== --- 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 Fri Jun 22 09:39:30 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=549870 ============================================================================== --- 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 Fri Jun 22 09:39:30 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=549870 ============================================================================== --- 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 Fri Jun 22 09:39:30 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=549870 ============================================================================== --- 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 Fri Jun 22 09:39:30 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 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=549870 ============================================================================== --- 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 Fri Jun 22 09:39:30 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 children, + LdapContext containerContext) + throws NamingException + { + LdapContext eContainmentFeatureContext = + null; + + Iterator 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=549870 ============================================================================== --- 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 Fri Jun 22 09:39:30 2007 @@ -0,0 +1,160 @@ +/* + * 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 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.sdo.EDataObject; + +/* + * TODO The EDataObjectCreator needs to know which EAttribute isID(). Wrap the EClass and preprocess this. + */ +public class EDataObjectCreator +implements DASConstants +{ + public static String create( + EDataObject eDataObject, + LdapContext containerContext) + throws NamingException + { + EAttribute idEAttribute = + null; + String rdn = + null; + Object dataObjectID = + null; + + EClass eClass = + eDataObject.eClass(); + + String namespaceURI = + eClass.getEPackage().getNsURI(); + + List eAttributes = + eClass.getEAllAttributes(); + + Iterator eAttributeIterator = + eAttributes.iterator(); + + String qualifiedEAttributeName = + null; + String normalizedEAttributeName = + null; + + Attributes attributes = + new BasicAttributes(); + + while (eAttributeIterator.hasNext()) + { + EAttribute eAttribute = + eAttributeIterator.next(); + + qualifiedEAttributeName = + SimpleTypeNamespaceQualifier. + qualify( + namespaceURI, + eClass.getName(), + eAttribute.getName() ); + + normalizedEAttributeName = + QualifiedNameNormalizer. + normalize(qualifiedEAttributeName); + + if (eAttribute.isID()) + { + idEAttribute = + eAttribute;//TODO - Make more efficient + + Object eAttributeValue = + eDataObject.eGet( eAttribute ); + + dataObjectID = eAttributeValue; + + attributes.put( + normalizedEAttributeName, + eAttributeValue ); + } + else + { + Object eAttributeValue = + eDataObject.eGet( eAttribute ); + + attributes.put( + normalizedEAttributeName, + eAttributeValue ); + } + } + + 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/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=549870 ============================================================================== --- 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 Fri Jun 22 09:39:30 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=549870 ============================================================================== --- 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 Fri Jun 22 09:39:30 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 dataTypeMap = null; + /* + private static void createDummySyntaxChecker( + String oid, + String schema ) + throws NamingException + { + List descriptions = new ArrayList(); + 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 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=549870 ============================================================================== --- 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 Fri Jun 22 09:39:30 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=549870 ============================================================================== --- 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 Fri Jun 22 09:39:30 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=549870 ============================================================================== --- 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 Fri Jun 22 09:39:30 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=549870 ============================================================================== --- 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 Fri Jun 22 09:39:30 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=549870 ============================================================================== --- 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 Fri Jun 22 09:39:30 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=549870 ============================================================================== --- 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 Fri Jun 22 09:39:30 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=549870 ============================================================================== --- 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 Fri Jun 22 09:39:30 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=549870 ============================================================================== --- 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 Fri Jun 22 09:39:30 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=549870 ============================================================================== --- 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 Fri Jun 22 09:39:30 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=549870 ============================================================================== --- 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 Fri Jun 22 09:39:30 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=549870 ============================================================================== --- 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 Fri Jun 22 09:39:30 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 Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/SyntaxCheckerEntryCreator.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/SyntaxCheckerEntryCreator.java?view=auto&rev=549870 ============================================================================== --- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/SyntaxCheckerEntryCreator.java (added) +++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/SyntaxCheckerEntryCreator.java Fri Jun 22 09:39:30 2007 @@ -0,0 +1,94 @@ +/* + * 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 javax.naming.ldap.LdapContext; + +import org.apache.tuscany.das.ldap.schema.constants.AttributeTypeConstants; +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; + +/** + * The Class SyntaxEntryCreator. + */ +public class SyntaxCheckerEntryCreator +implements +AttributeTypeConstants, +SchemaAttributeTypeConstants, +ObjectClassConstants, +SchemaObjectClassConstants +{ + /** + * Create. + * + * @param oidPrefix the oid prefix + * @param namespaceURI the namespace URI + * @param dataTypeName the name of the DataType + * @param syntaxesContext the directory context + * + * @throws Exception the exception + */ + public static void create( + String rdn, + LdapContext syntaxCheckerContext) + throws Exception + { + + Attributes attributes = + prepareSyntaxCheckerAttributes(); + + syntaxCheckerContext.createSubcontext( + rdn, + attributes); + } + + /** + * TODO - Move to helper + * Prepare SyntaxChecker attributes. + * + * @return the attributes + */ + public static Attributes prepareSyntaxCheckerAttributes() + { + Attribute objectClassAttribute = + new BasicAttribute( + OBJECT_CLASS, + TOP); + objectClassAttribute.add( META_TOP ); + objectClassAttribute.add( META_SYNTAX_CHECKER ); + + Attribute fqcnAttribute = + new BasicAttribute( + M_FQCN, + M_FQCN_DEFAULT_VALUE); + + Attributes attributes = new BasicAttributes(); + + attributes.put( objectClassAttribute ); + attributes.put( fqcnAttribute ); + + return attributes; + } +} \ 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/SyntaxEntryCreator.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/SyntaxEntryCreator.java?view=auto&rev=549870 ============================================================================== --- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/SyntaxEntryCreator.java (added) +++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/SyntaxEntryCreator.java Fri Jun 22 09:39:30 2007 @@ -0,0 +1,155 @@ +/* + * 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 javax.naming.directory.DirContext; +import javax.naming.ldap.LdapContext; + +import org.apache.tuscany.das.ldap.schema.constants.AttributeTypeConstants; +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; +import org.apache.tuscany.das.ldap.util.ComplexTypeNamespaceQualifier; + +/** + * The Class SyntaxEntryCreator. + */ +public class SyntaxEntryCreator +implements +AttributeTypeConstants, +SchemaAttributeTypeConstants, +ObjectClassConstants, +SchemaObjectClassConstants +{ + /** + * Create. + * + * @param oidPrefix the oid prefix + * @param namespaceURI the namespace URI + * @param dataTypeName the name of the DataType + * @param syntaxesContext the directory context + * + * @throws Exception the exception + */ + public static void create( + String oidPrefix, + String namespaceURI, + String dataTypeName, + LdapContext syntaxesContext, + LdapContext syntaxCheckersContext) + throws Exception + { + String syntaxDescription = + ComplexTypeNamespaceQualifier. + qualify( + namespaceURI, + dataTypeName); + + String rdn = + ComplexTypeRDNCreator. + create( + oidPrefix, + namespaceURI, + dataTypeName); + + Attributes syntaxAttributes = + prepareSyntaxAttributes( + syntaxDescription ); + + Attributes syntaxCheckerAttributes = + prepareSyntaxCheckerAttributes(); + + //TODO Put back in when bug gets resolved. + //TODO Remember to apply the namespace qualifier or we could just leave because it's in the description effectively + //attributes.put(M_NAME, name ); + //attributes.put("x-humandReadible", "false"); + //attributes.put("m-obsolete, "false"); + syntaxesContext.createSubcontext( + rdn, + syntaxAttributes); + + syntaxCheckersContext.createSubcontext( + rdn, + syntaxCheckerAttributes); + } + + /** + * TODO - Move to helper + * TODO - Optimize - we are prepping these each time when they could be cached + * Prepare syntax attributes. + * + * @param syntaxDescription the syntax description + * + * @return the attributes + */ + public static Attributes prepareSyntaxAttributes( + String syntaxDescription) + { + Attribute objectClassAttribute = new BasicAttribute( + OBJECT_CLASS, TOP); + objectClassAttribute.add( META_TOP ); + objectClassAttribute.add( META_SYNTAX ); + + Attribute descriptionAttribute = new BasicAttribute( + M_DESCRIPTION, + syntaxDescription); + + Attributes attributes = new BasicAttributes(); + + attributes.put( objectClassAttribute ); + attributes.put( descriptionAttribute ); + + return attributes; + } + + /** + * TODO - Move to helper + * TODO - Optimize - we are prepping these each time when they could be cached + * Prepare SyntaxChecker attributes. + * + * @return the attributes + */ + public static Attributes prepareSyntaxCheckerAttributes() + { + Attribute objectClassAttribute = + new BasicAttribute( + OBJECT_CLASS, + TOP); + objectClassAttribute.add( META_TOP ); + objectClassAttribute.add( META_SYNTAX_CHECKER ); + + Attribute fqcnAttribute = + new BasicAttribute( + M_FQCN, + M_FQCN_DEFAULT_VALUE); + + Attributes attributes = new BasicAttributes(); + + attributes.put( objectClassAttribute ); + attributes.put( fqcnAttribute ); + + return attributes; + } + +} \ No newline at end of file Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MComplexMayAttributeTypeDestroyer.java URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MComplexMayAttributeTypeDestroyer.java?view=auto&rev=549870 ============================================================================== --- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MComplexMayAttributeTypeDestroyer.java (added) +++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MComplexMayAttributeTypeDestroyer.java Fri Jun 22 09:39:30 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.schema.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.create.SimpleTypeRDNCreator; + +public class MComplexMayAttributeTypeDestroyer +implements DASConstants +{ + public static void destroy( + DirContext attributeTypesContext, + String oidPrefix) + throws NamingException, Exception + { + String rdn = + SimpleTypeRDNCreator.create( + oidPrefix, + DAS_XSD_NAMESPACE, + M_META_TOP_SDO_OBJECT_CLASS, + M_COMPLEX_MAY); + + attributeTypesContext.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/schema/destroy/MComplexMustAttributeTypeDestroyer.java URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MComplexMustAttributeTypeDestroyer.java?view=auto&rev=549870 ============================================================================== --- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MComplexMustAttributeTypeDestroyer.java (added) +++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MComplexMustAttributeTypeDestroyer.java Fri Jun 22 09:39:30 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.schema.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.create.SimpleTypeRDNCreator; + +public class MComplexMustAttributeTypeDestroyer +implements DASConstants +{ + public static void destroy( + DirContext attributeTypesContext, + String oidPrefix) + throws NamingException, Exception + { + String rdn = + SimpleTypeRDNCreator.create( + oidPrefix, + DAS_XSD_NAMESPACE, + M_META_TOP_SDO_OBJECT_CLASS, + M_COMPLEX_MUST); + + attributeTypesContext.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/schema/destroy/MIDAttributeTypeDestroyer.java URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MIDAttributeTypeDestroyer.java?view=auto&rev=549870 ============================================================================== --- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MIDAttributeTypeDestroyer.java (added) +++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MIDAttributeTypeDestroyer.java Fri Jun 22 09:39:30 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.schema.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.create.SimpleTypeRDNCreator; + +public class MIDAttributeTypeDestroyer +implements DASConstants +{ + public static void destroy( + DirContext attributeTypesContext, + String oidPrefix) + throws NamingException, Exception + { + String rdn = + SimpleTypeRDNCreator.create( + oidPrefix, + DAS_XSD_NAMESPACE, + M_META_TOP_SDO_OBJECT_CLASS, + ID); + + attributeTypesContext.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/schema/destroy/MetaTopSDOObjectClassDestroyer.java URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MetaTopSDOObjectClassDestroyer.java?view=auto&rev=549870 ============================================================================== --- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MetaTopSDOObjectClassDestroyer.java (added) +++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MetaTopSDOObjectClassDestroyer.java Fri Jun 22 09:39:30 2007 @@ -0,0 +1,67 @@ +/* + * 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.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; +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; +import org.apache.tuscany.das.ldap.schema.create.ComplexTypeRDNCreator; + +public class MetaTopSDOObjectClassDestroyer +implements +AttributeTypeConstants, +SchemaAttributeTypeConstants, +ObjectClassConstants, +SchemaObjectClassConstants, +DASConstants +{ + public static void destroy( + DirContext attributeTypesContext, + DirContext objectClassesContext, + String oidPrefix) + throws NamingException, Exception + { + String rdn = + ComplexTypeRDNCreator.create( + oidPrefix, + DAS_XSD_NAMESPACE, + M_META_TOP_SDO_OBJECT_CLASS); + + objectClassesContext.destroySubcontext( + rdn); + + MComplexMayAttributeTypeDestroyer.destroy( + attributeTypesContext, + oidPrefix ); + + MComplexMustAttributeTypeDestroyer.destroy( + attributeTypesContext, + oidPrefix ); + + MIDAttributeTypeDestroyer.destroy( + attributeTypesContext, + oidPrefix ); + } +} \ No newline at end of file Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/SyntaxCheckerEntryDestroyer.java URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/SyntaxCheckerEntryDestroyer.java?view=auto&rev=549870 ============================================================================== --- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/SyntaxCheckerEntryDestroyer.java (added) +++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/SyntaxCheckerEntryDestroyer.java Fri Jun 22 09:39:30 2007 @@ -0,0 +1,56 @@ +/* + * 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.destroy; + +import javax.naming.ldap.LdapContext; + +import org.apache.tuscany.das.ldap.schema.create.ComplexTypeRDNCreator; + +/** + * The Class SyntaxEntryCreator. + */ +public class SyntaxCheckerEntryDestroyer +{ + /** + * Destroy. + * + * @param oidPrefix the oid prefix + * @param namespaceURI the namespace URI + * @param simpleTypeName the name + * @param containerContext the directory context + * + * @throws Exception the exception + */ + public static void destroy( + String oidPrefix, + String namespaceURI, + String simpleTypeName, + LdapContext containerContext) + throws Exception + { + String rdn = null; + rdn = ComplexTypeRDNCreator.create( + oidPrefix, + namespaceURI, + simpleTypeName ); + + containerContext.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/schema/destroy/SyntaxEntryDestroyer.java URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/SyntaxEntryDestroyer.java?view=auto&rev=549870 ============================================================================== --- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/SyntaxEntryDestroyer.java (added) +++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/SyntaxEntryDestroyer.java Fri Jun 22 09:39:30 2007 @@ -0,0 +1,56 @@ +/* + * 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.destroy; + +import javax.naming.ldap.LdapContext; + +import org.apache.tuscany.das.ldap.schema.create.ComplexTypeRDNCreator; + +/** + * The Class SyntaxEntryCreator. + */ +public class SyntaxEntryDestroyer +{ + /** + * Destroy. + * + * @param oidPrefix the oid prefix + * @param namespaceURI the namespace URI + * @param simpleTypeName the name + * @param containerContext the directory context + * + * @throws Exception the exception + */ + public static void destroy( + String oidPrefix, + String namespaceURI, + String simpleTypeName, + LdapContext containerContext) + throws Exception + { + String rdn = null; + rdn = ComplexTypeRDNCreator.create( + oidPrefix, + namespaceURI, + simpleTypeName ); + + containerContext.destroySubcontext(rdn); + } +} \ No newline at end of file