You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by oe...@apache.org on 2007/05/31 21:58:38 UTC
svn commit: r543239 [6/37] - in
/directory/sandbox/oersoy/das.testing/das.ldap.parent: ./
das.ldap.configuration.model.ecore.v100/
das.ldap.configuration.model.ecore.v100/.settings/
das.ldap.configuration.model.ecore.v100/model/ das.ldap.configuration....
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/surefire-reports/TEST-org.apache.tuscany.das.ldap.prototype.ModelTest.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/surefire-reports/TEST-org.apache.tuscany.das.ldap.prototype.ModelTest.xml?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/surefire-reports/TEST-org.apache.tuscany.das.ldap.prototype.ModelTest.xml (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/surefire-reports/TEST-org.apache.tuscany.das.ldap.prototype.ModelTest.xml Thu May 31 12:58:13 2007
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite failures="0" time="0.151" errors="0" skipped="0" tests="2" name="org.apache.tuscany.das.ldap.prototype.ModelTest">
+ <properties>
+ <property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/>
+ <property name="sun.boot.library.path" value="/usr/java/jdk1.6.0/jre/lib/i386"/>
+ <property name="java.vm.version" value="1.6.0-b105"/>
+ <property name="java.vm.vendor" value="Sun Microsystems Inc."/>
+ <property name="java.vendor.url" value="http://java.sun.com/"/>
+ <property name="path.separator" value=":"/>
+ <property name="java.vm.name" value="Java HotSpot(TM) Client VM"/>
+ <property name="file.encoding.pkg" value="sun.io"/>
+ <property name="user.country" value="US"/>
+ <property name="sun.java.launcher" value="SUN_STANDARD"/>
+ <property name="sun.os.patch.level" value="unknown"/>
+ <property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
+ <property name="user.dir" value="/home/ole/workspace/das.ldap.parent/das.ldap.prototype"/>
+ <property name="java.runtime.version" value="1.6.0-b105"/>
+ <property name="java.awt.graphicsenv" value="sun.awt.X11GraphicsEnvironment"/>
+ <property name="basedir" value="/home/ole/workspace/das.ldap.parent/das.ldap.prototype"/>
+ <property name="java.endorsed.dirs" value="/usr/java/jdk1.6.0/jre/lib/endorsed"/>
+ <property name="os.arch" value="i386"/>
+ <property name="java.io.tmpdir" value="/tmp"/>
+ <property name="line.separator" value="
+"/>
+ <property name="java.vm.specification.vendor" value="Sun Microsystems Inc."/>
+ <property name="os.name" value="Linux"/>
+ <property name="sun.jnu.encoding" value="UTF-8"/>
+ <property name="java.library.path" value="/usr/java/jdk1.6.0/jre/lib/i386/client:/usr/java/jdk1.6.0/jre/lib/i386:/usr/java/jdk1.6.0/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib"/>
+ <property name="java.specification.name" value="Java Platform API Specification"/>
+ <property name="java.class.version" value="50.0"/>
+ <property name="sun.management.compiler" value="HotSpot Client Compiler"/>
+ <property name="os.version" value="2.6.20-1.2948.fc6"/>
+ <property name="user.home" value="/home/ole"/>
+ <property name="user.timezone" value="America/Chicago"/>
+ <property name="java.awt.printerjob" value="sun.print.PSPrinterJob"/>
+ <property name="file.encoding" value="UTF-8"/>
+ <property name="java.specification.version" value="1.6"/>
+ <property name="user.name" value="ole"/>
+ <property name="java.class.path" value="/home/ole/.m2/repository/org/apache/maven/surefire/surefire-api/2.0/surefire-api-2.0.jar:/home/ole/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar:/home/ole/.m2/repository/org/apache/maven/surefire/surefire-booter/2.0/surefire-booter-2.0.jar"/>
+ <property name="java.vm.specification.version" value="1.0"/>
+ <property name="sun.arch.data.model" value="32"/>
+ <property name="java.home" value="/usr/java/jdk1.6.0/jre"/>
+ <property name="java.specification.vendor" value="Sun Microsystems Inc."/>
+ <property name="user.language" value="en"/>
+ <property name="java.vm.info" value="mixed mode, sharing"/>
+ <property name="java.version" value="1.6.0"/>
+ <property name="java.ext.dirs" value="/usr/java/jdk1.6.0/jre/lib/ext:/usr/java/packages/lib/ext"/>
+ <property name="sun.boot.class.path" value="/usr/java/jdk1.6.0/jre/lib/resources.jar:/usr/java/jdk1.6.0/jre/lib/rt.jar:/usr/java/jdk1.6.0/jre/lib/sunrsasign.jar:/usr/java/jdk1.6.0/jre/lib/jsse.jar:/usr/java/jdk1.6.0/jre/lib/jce.jar:/usr/java/jdk1.6.0/jre/lib/charsets.jar:/usr/java/jdk1.6.0/jre/classes"/>
+ <property name="java.vendor" value="Sun Microsystems Inc."/>
+ <property name="localRepository" value="/home/ole/.m2/repository"/>
+ <property name="file.separator" value="/"/>
+ <property name="java.vendor.url.bug" value="http://java.sun.com/cgi-bin/bugreport.cgi"/>
+ <property name="sun.cpu.endian" value="little"/>
+ <property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
+ <property name="sun.cpu.isalist" value=""/>
+ </properties>
+ <testcase time="0.62" name="testCalculateXPath"/>
+ <testcase time="2.092" name="testDynamicPartitioning"/>
+ <testcase time="0.001" name="testHotPartitionConnectWithApacheContextFactory"/>
+ <testcase time="0.161" name="testHotPartitionConnectWithSunContextFactory"/>
+ <testcase time="0.012" name="testHotPartitionEntryCreation"/>
+ <testcase time="0.15" name="testExecute"/>
+ <testcase time="0" name="testModelLoad"/>
+</testsuite>
\ No newline at end of file
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/surefire-reports/TEST-org.apache.tuscany.das.ldap.prototype.learning.LearningTest.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/surefire-reports/TEST-org.apache.tuscany.das.ldap.prototype.learning.LearningTest.xml?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/surefire-reports/TEST-org.apache.tuscany.das.ldap.prototype.learning.LearningTest.xml (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/surefire-reports/TEST-org.apache.tuscany.das.ldap.prototype.learning.LearningTest.xml Thu May 31 12:58:13 2007
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite failures="0" time="2.408" errors="0" skipped="0" tests="4" name="org.apache.tuscany.das.ldap.prototype.learning.LearningTest">
+ <properties>
+ <property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/>
+ <property name="sun.boot.library.path" value="/usr/java/jdk1.6.0/jre/lib/i386"/>
+ <property name="java.vm.version" value="1.6.0-b105"/>
+ <property name="java.vm.vendor" value="Sun Microsystems Inc."/>
+ <property name="java.vendor.url" value="http://java.sun.com/"/>
+ <property name="path.separator" value=":"/>
+ <property name="java.vm.name" value="Java HotSpot(TM) Client VM"/>
+ <property name="file.encoding.pkg" value="sun.io"/>
+ <property name="user.country" value="US"/>
+ <property name="sun.java.launcher" value="SUN_STANDARD"/>
+ <property name="sun.os.patch.level" value="unknown"/>
+ <property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
+ <property name="user.dir" value="/home/ole/workspace/das.ldap.parent/das.ldap.prototype"/>
+ <property name="java.runtime.version" value="1.6.0-b105"/>
+ <property name="java.awt.graphicsenv" value="sun.awt.X11GraphicsEnvironment"/>
+ <property name="basedir" value="/home/ole/workspace/das.ldap.parent/das.ldap.prototype"/>
+ <property name="java.endorsed.dirs" value="/usr/java/jdk1.6.0/jre/lib/endorsed"/>
+ <property name="os.arch" value="i386"/>
+ <property name="java.io.tmpdir" value="/tmp"/>
+ <property name="line.separator" value="
+"/>
+ <property name="java.vm.specification.vendor" value="Sun Microsystems Inc."/>
+ <property name="os.name" value="Linux"/>
+ <property name="sun.jnu.encoding" value="UTF-8"/>
+ <property name="java.library.path" value="/usr/java/jdk1.6.0/jre/lib/i386/client:/usr/java/jdk1.6.0/jre/lib/i386:/usr/java/jdk1.6.0/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib"/>
+ <property name="java.specification.name" value="Java Platform API Specification"/>
+ <property name="java.class.version" value="50.0"/>
+ <property name="sun.management.compiler" value="HotSpot Client Compiler"/>
+ <property name="os.version" value="2.6.20-1.2948.fc6"/>
+ <property name="user.home" value="/home/ole"/>
+ <property name="user.timezone" value="America/Chicago"/>
+ <property name="java.awt.printerjob" value="sun.print.PSPrinterJob"/>
+ <property name="file.encoding" value="UTF-8"/>
+ <property name="java.specification.version" value="1.6"/>
+ <property name="user.name" value="ole"/>
+ <property name="java.class.path" value="/home/ole/.m2/repository/org/apache/maven/surefire/surefire-api/2.0/surefire-api-2.0.jar:/home/ole/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar:/home/ole/.m2/repository/org/apache/maven/surefire/surefire-booter/2.0/surefire-booter-2.0.jar"/>
+ <property name="java.vm.specification.version" value="1.0"/>
+ <property name="sun.arch.data.model" value="32"/>
+ <property name="java.home" value="/usr/java/jdk1.6.0/jre"/>
+ <property name="java.specification.vendor" value="Sun Microsystems Inc."/>
+ <property name="user.language" value="en"/>
+ <property name="java.vm.info" value="mixed mode, sharing"/>
+ <property name="java.version" value="1.6.0"/>
+ <property name="java.ext.dirs" value="/usr/java/jdk1.6.0/jre/lib/ext:/usr/java/packages/lib/ext"/>
+ <property name="sun.boot.class.path" value="/usr/java/jdk1.6.0/jre/lib/resources.jar:/usr/java/jdk1.6.0/jre/lib/rt.jar:/usr/java/jdk1.6.0/jre/lib/sunrsasign.jar:/usr/java/jdk1.6.0/jre/lib/jsse.jar:/usr/java/jdk1.6.0/jre/lib/jce.jar:/usr/java/jdk1.6.0/jre/lib/charsets.jar:/usr/java/jdk1.6.0/jre/classes"/>
+ <property name="java.vendor" value="Sun Microsystems Inc."/>
+ <property name="localRepository" value="/home/ole/.m2/repository"/>
+ <property name="file.separator" value="/"/>
+ <property name="java.vendor.url.bug" value="http://java.sun.com/cgi-bin/bugreport.cgi"/>
+ <property name="sun.cpu.endian" value="little"/>
+ <property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
+ <property name="sun.cpu.isalist" value=""/>
+ </properties>
+ <testcase time="0.62" name="testCalculateXPath"/>
+ <testcase time="2.092" name="testDynamicPartitioning"/>
+ <testcase time="0.001" name="testHotPartitionConnectWithApacheContextFactory"/>
+ <testcase time="0.161" name="testHotPartitionConnectWithSunContextFactory"/>
+ <testcase time="0.012" name="testHotPartitionEntryCreation"/>
+</testsuite>
\ No newline at end of file
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/surefire-reports/org.apache.tuscany.das.ldap.prototype.DASClientHelperTest.txt
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/surefire-reports/org.apache.tuscany.das.ldap.prototype.DASClientHelperTest.txt?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/surefire-reports/org.apache.tuscany.das.ldap.prototype.DASClientHelperTest.txt (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/surefire-reports/org.apache.tuscany.das.ldap.prototype.DASClientHelperTest.txt Thu May 31 12:58:13 2007
@@ -0,0 +1,4 @@
+-------------------------------------------------------------------------------
+Test set: org.apache.tuscany.das.ldap.prototype.DASClientHelperTest
+-------------------------------------------------------------------------------
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.925 sec
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/surefire-reports/org.apache.tuscany.das.ldap.prototype.ModelTest.txt
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/surefire-reports/org.apache.tuscany.das.ldap.prototype.ModelTest.txt?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/surefire-reports/org.apache.tuscany.das.ldap.prototype.ModelTest.txt (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/surefire-reports/org.apache.tuscany.das.ldap.prototype.ModelTest.txt Thu May 31 12:58:13 2007
@@ -0,0 +1,4 @@
+-------------------------------------------------------------------------------
+Test set: org.apache.tuscany.das.ldap.prototype.ModelTest
+-------------------------------------------------------------------------------
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.162 sec
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/surefire-reports/org.apache.tuscany.das.ldap.prototype.learning.LearningTest.txt
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/surefire-reports/org.apache.tuscany.das.ldap.prototype.learning.LearningTest.txt?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/surefire-reports/org.apache.tuscany.das.ldap.prototype.learning.LearningTest.txt (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/surefire-reports/org.apache.tuscany.das.ldap.prototype.learning.LearningTest.txt Thu May 31 12:58:13 2007
@@ -0,0 +1,4 @@
+-------------------------------------------------------------------------------
+Test set: org.apache.tuscany.das.ldap.prototype.learning.LearningTest
+-------------------------------------------------------------------------------
+Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.414 sec
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/test-classes/org/apache/tuscany/das/ldap/prototype/DASClientHelperTest.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/test-classes/org/apache/tuscany/das/ldap/prototype/DASClientHelperTest.class?view=auto&rev=543239
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/test-classes/org/apache/tuscany/das/ldap/prototype/DASClientHelperTest.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/test-classes/org/apache/tuscany/das/ldap/prototype/ModelTest.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/test-classes/org/apache/tuscany/das/ldap/prototype/ModelTest.class?view=auto&rev=543239
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/test-classes/org/apache/tuscany/das/ldap/prototype/ModelTest.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/test-classes/org/apache/tuscany/das/ldap/prototype/learning/LearningTest.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/test-classes/org/apache/tuscany/das/ldap/prototype/learning/LearningTest.class?view=auto&rev=543239
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/test-classes/org/apache/tuscany/das/ldap/prototype/learning/LearningTest.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/test-classes/workshop/partition/PartitionApplication.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/test-classes/workshop/partition/PartitionApplication.class?view=auto&rev=543239
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.prototype/target/test-classes/workshop/partition/PartitionApplication.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/.classpath
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/.classpath?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/.classpath (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/.classpath Thu May 31 12:58:13 2007
@@ -0,0 +1,9 @@
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="src" path="/das.ldap.constants"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/common/2.3.0-M4/common-2.3.0-M4.jar"/>
+</classpath>
\ No newline at end of file
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/.project
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/.project?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/.project (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/.project Thu May 31 12:58:13 2007
@@ -0,0 +1,16 @@
+<projectDescription>
+ <name>das.ldap.utils</name>
+ <comment/>
+ <projects>
+ <project>das.ldap.constants</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments/>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/.settings/org.eclipse.jdt.core.prefs?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/.settings/org.eclipse.jdt.core.prefs (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/.settings/org.eclipse.jdt.core.prefs Thu May 31 12:58:13 2007
@@ -0,0 +1,5 @@
+#Wed Apr 25 17:11:43 CDT 2007
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/pom.xml?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/pom.xml (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/pom.xml Thu May 31 12:58:13 2007
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<project>
+ <parent>
+ <artifactId>das.ldap.parent</artifactId>
+ <groupId>org.apache.tuscany</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.tuscany</groupId>
+ <artifactId>das.ldap.utils</artifactId>
+ <name>das.ldap.utils</name>
+ <version>1.0-SNAPSHOT</version>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.emf</groupId>
+ <artifactId>common</artifactId>
+ <version>2.3.0-M4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany</groupId>
+ <artifactId>das.ldap.constants</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+
+ </dependencies>
+</project>
\ No newline at end of file
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/create/InitialContextCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/create/InitialContextCreator.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/create/InitialContextCreator.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/create/InitialContextCreator.java Thu May 31 12:58:13 2007
@@ -0,0 +1,59 @@
+
+package org.apache.tuscany.das.ldap.create;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+import org.apache.tuscany.das.ldap.util.XSDNamespaceURITokenizer;
+import org.eclipse.emf.common.util.URI;
+
+/**
+ * The InitialContextCreator for a model's directory namespace
+ */
+public class InitialContextCreator
+{
+ /**
+ * Create the initial naming to which the
+ * ldap attributes belonging to the root DataObject
+ * will be bound.
+ *
+ * @param directoryContext the dir context
+ * @param xsdNamespace the xml namespace of the DataObjects
+ *
+ * @return the directory context
+ *
+ * @throws NamingException the naming exception
+ */
+ public static DirContext create(
+ String xsdNamespace,
+ DirContext directoryContext) throws NamingException
+ {
+ URI xsdNamespaceURI =
+ URI.createURI(
+ xsdNamespace );
+
+ String[] pathTokens =
+ XSDNamespaceURITokenizer.
+ createPathTokens(
+ xsdNamespaceURI );
+
+ String[] authorityTokens =
+ XSDNamespaceURITokenizer.
+ createAuthorityTokens(
+ xsdNamespaceURI );
+
+ directoryContext =
+ InitialContextCreatorHelper.
+ createAuthorityContext(
+ directoryContext,
+ authorityTokens );
+
+ directoryContext =
+ InitialContextCreatorHelper.
+ createPathContext(
+ directoryContext,
+ pathTokens );
+
+ return directoryContext;
+ }
+}
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/create/InitialContextCreatorHelper.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/create/InitialContextCreatorHelper.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/create/InitialContextCreatorHelper.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/create/InitialContextCreatorHelper.java Thu May 31 12:58:13 2007
@@ -0,0 +1,119 @@
+/*
+ * 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.Attributes;
+import javax.naming.directory.DirContext;
+
+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.SchemaObjectClassConstants;
+
+/**
+ * The Class InitialContextCreatorHelper.
+ */
+public class InitialContextCreatorHelper
+implements
+ObjectClassConstants,
+SchemaObjectClassConstants,
+AttributeTypeConstants
+{
+ /**
+ * Lookup the subcontext and if it does not exist,
+ * create it.
+ *
+ * @param dirContext the dir context
+ * @param subContext the sub context
+ *
+ * @return the dir context
+ *
+ * @throws NamingException the naming exception
+ */
+ public static DirContext createSubContext(
+ DirContext dirContext,
+ String subContext,
+ Attributes attributes)
+ throws NamingException
+ {
+ try
+ {
+ dirContext = ( DirContext ) dirContext.lookup( subContext );
+ }
+ catch ( NamingException e )
+ {
+ if (attributes == null)
+ {
+ dirContext = ( DirContext ) dirContext.createSubcontext( subContext );
+ }
+ else
+ {
+ dirContext = ( DirContext ) dirContext.createSubcontext( subContext, attributes );
+ }
+ }
+ return dirContext;
+ }
+
+ /**
+ * Creates the authority context.
+ *
+ * @param authorityTokens the authority tokens
+ * @param directoryContext the directory context
+ *
+ * @return the dir context
+ *
+ * @throws NamingException the naming exception
+ */
+ public static DirContext createAuthorityContext(
+ DirContext directoryContext,
+ String[] authorityTokens)
+ throws NamingException
+ {
+ for (int i = authorityTokens.length-1; i >= (0); i--)
+ {
+ String subContext = "cn=" + authorityTokens[i];
+ directoryContext = createSubContext( directoryContext, subContext, null );
+ }
+ return directoryContext;
+ }
+
+ /**
+ * Creates the path context.
+ *
+ * @param dirContext the dir context
+ * @param pathTokens the path tokens
+ *
+ * @return the dir context
+ *
+ * @throws NamingException the naming exception
+ */
+ public static DirContext createPathContext(
+ DirContext dirContext,
+ String[] pathTokens)
+ throws NamingException
+ {
+ for (int i = 1; i < (pathTokens.length); i++)
+ {
+ String subContext = "cn=" + pathTokens[i];
+ dirContext = createSubContext( dirContext, subContext, null );
+ }
+ return dirContext;
+ }
+}
\ No newline at end of file
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/ComplexTypeNamespaceQualifier.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/ComplexTypeNamespaceQualifier.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/ComplexTypeNamespaceQualifier.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/ComplexTypeNamespaceQualifier.java Thu May 31 12:58:13 2007
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.das.ldap.util;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class DataTypeNamespaceQualifier.
+ */
+public class ComplexTypeNamespaceQualifier
+{
+ /**
+ * Qualify.
+ *
+ * @param namespaceURI the namespace URI
+ * @param complexTypeName the name
+ *
+ * @return the string
+ */
+ public static String qualify(String namespaceURI, String complexTypeName )
+ {
+ return namespaceURI + "/" + complexTypeName;
+ }
+}
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/InitialContextCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/InitialContextCreator.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/InitialContextCreator.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/InitialContextCreator.java Thu May 31 12:58:13 2007
@@ -0,0 +1,59 @@
+
+package org.apache.tuscany.das.ldap.util;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+import org.apache.tuscany.das.ldap.util.XSDNamespaceURITokenizer;
+import org.eclipse.emf.common.util.URI;
+
+/**
+ * The InitialContextCreator for a model's directory namespace
+ */
+public class InitialContextCreator
+{
+ /**
+ * Create the initial naming to which the
+ * ldap attributes belonging to the root DataObject
+ * will be bound.
+ *
+ * @param directoryContext the dir context
+ * @param xsdNamespace the xml namespace of the DataObjects
+ *
+ * @return the directory context
+ *
+ * @throws NamingException the naming exception
+ */
+ public static DirContext create(
+ String xsdNamespace,
+ DirContext directoryContext) throws NamingException
+ {
+ URI xsdNamespaceURI =
+ URI.createURI(
+ xsdNamespace );
+
+ String[] pathTokens =
+ XSDNamespaceURITokenizer.
+ createPathTokens(
+ xsdNamespaceURI );
+
+ String[] authorityTokens =
+ XSDNamespaceURITokenizer.
+ createAuthorityTokens(
+ xsdNamespaceURI );
+
+ directoryContext =
+ InitialContextCreatorHelper.
+ createAuthorityContext(
+ directoryContext,
+ authorityTokens );
+
+ directoryContext =
+ InitialContextCreatorHelper.
+ createPathContext(
+ directoryContext,
+ pathTokens );
+
+ return directoryContext;
+ }
+}
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/InitialContextCreatorHelper.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/InitialContextCreatorHelper.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/InitialContextCreatorHelper.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/InitialContextCreatorHelper.java Thu May 31 12:58:13 2007
@@ -0,0 +1,119 @@
+/*
+ * 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.util;
+
+import javax.naming.NamingException;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+
+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.SchemaObjectClassConstants;
+
+/**
+ * The Class InitialContextCreatorHelper.
+ */
+public class InitialContextCreatorHelper
+implements
+ObjectClassConstants,
+SchemaObjectClassConstants,
+AttributeTypeConstants
+{
+ /**
+ * Lookup the subcontext and if it does not exist,
+ * create it.
+ *
+ * @param dirContext the dir context
+ * @param subContext the sub context
+ *
+ * @return the dir context
+ *
+ * @throws NamingException the naming exception
+ */
+ public static DirContext createSubContext(
+ DirContext dirContext,
+ String subContext,
+ Attributes attributes)
+ throws NamingException
+ {
+ try
+ {
+ dirContext = ( DirContext ) dirContext.lookup( subContext );
+ }
+ catch ( NamingException e )
+ {
+ if (attributes == null)
+ {
+ dirContext = ( DirContext ) dirContext.createSubcontext( subContext );
+ }
+ else
+ {
+ dirContext = ( DirContext ) dirContext.createSubcontext( subContext, attributes );
+ }
+ }
+ return dirContext;
+ }
+
+ /**
+ * Creates the authority context.
+ *
+ * @param authorityTokens the authority tokens
+ * @param directoryContext the directory context
+ *
+ * @return the dir context
+ *
+ * @throws NamingException the naming exception
+ */
+ public static DirContext createAuthorityContext(
+ DirContext directoryContext,
+ String[] authorityTokens)
+ throws NamingException
+ {
+ for (int i = authorityTokens.length-1; i >= (0); i--)
+ {
+ String subContext = "cn=" + authorityTokens[i];
+ directoryContext = createSubContext( directoryContext, subContext, null );
+ }
+ return directoryContext;
+ }
+
+ /**
+ * Creates the path context.
+ *
+ * @param dirContext the dir context
+ * @param pathTokens the path tokens
+ *
+ * @return the dir context
+ *
+ * @throws NamingException the naming exception
+ */
+ public static DirContext createPathContext(
+ DirContext dirContext,
+ String[] pathTokens)
+ throws NamingException
+ {
+ for (int i = 1; i < (pathTokens.length); i++)
+ {
+ String subContext = "cn=" + pathTokens[i];
+ dirContext = createSubContext( dirContext, subContext, null );
+ }
+ return dirContext;
+ }
+}
\ No newline at end of file
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/JNDIUtil.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/JNDIUtil.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/JNDIUtil.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/JNDIUtil.java Thu May 31 12:58:13 2007
@@ -0,0 +1,168 @@
+
+package org.apache.tuscany.das.ldap.util;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+/**
+ * The Class JNDIUtil.
+ */
+public class JNDIUtil
+{
+ /**
+ * Calculate DN components.
+ *
+ * @param context the context
+ *
+ * @return the string[] containing the components of the DN
+ *
+ * @throws NamingException the naming exception
+ */
+ public static String[] calculateDNComponents(
+ DirContext context)
+ throws NamingException
+ {
+ String contextDN =
+ context.getNameInNamespace();
+
+ String[] initialContextComponents =
+ contextDN.split( "[,]" );
+
+ return initialContextComponents;
+ }
+
+
+ /**
+ * Calculate DN components.
+ *
+ * @param contextDN the context DN
+ *
+ * @return the string[] containing the components of the DN
+ *
+ * @throws NamingException the naming exception
+ */
+ public static String[] calculateDNComponents(
+ String contextDN)
+ throws NamingException
+ {
+ String[] initialContextComponents =
+ contextDN.split( "[,]" );
+
+ return initialContextComponents;
+ }
+
+ /**
+ * Gets the parent context.
+ *
+ * @param partitionContext the partition context
+ * @param childContext the child context
+ *
+ * @return the parent context (Null if the child context is the root)
+ *
+ * @throws NamingException the naming exception
+ */
+ public static DirContext getParentContext(
+ DirContext childContext,
+ DirContext partitionContext)
+ throws NamingException
+ {
+ String[] childContextDNComponents =
+ calculateDNComponents( childContext );
+
+ String[] partitionDNComponents =
+ calculateDNComponents( partitionContext );
+
+ DirContext parentContext = null;
+
+ if (childContextDNComponents.length == partitionDNComponents.length)
+ {
+ return null;
+ }
+ else if ( (childContextDNComponents.length - 1) == partitionDNComponents.length)
+ {
+ return partitionContext;
+ }
+ else
+ {
+ String parentLookupDN =
+ calculateParentRelativeDN(
+ childContext, partitionContext.getNameInNamespace() );
+
+
+
+ parentContext =
+ ( DirContext ) partitionContext.lookup( parentLookupDN );
+ }
+ return parentContext;
+ }
+
+
+ /**
+ * Calculate parent relative DN.
+ * The parent relative DN is the
+ * DN of the parent context, relative
+ * to the partition context.
+ *
+ * So if the partition context is
+ * <i>ou=system</i> and
+ * the child context has DN
+ * <i>cn=accounts, cn=users, cn=example, ou=system</i>
+ *
+ * then the parent relative DN is
+ * <i>cn=users, cn=example</i>
+ *
+ * @param childContext the child context
+ * @param partitionDN the partition DN
+ *
+ * @return the string
+ *
+ * @throws NamingException the naming exception
+ */
+ public static String calculateParentRelativeDN(
+ DirContext childContext,
+ String partitionDN)
+ throws NamingException
+ {
+ String parentRelativeDN = null;
+
+ String[] childContextDNComponents =
+ calculateDNComponents( childContext );
+
+ String[] partitionDNComponents =
+ calculateDNComponents( partitionDN );
+
+ if (childContextDNComponents.length ==
+ partitionDNComponents.length)
+ {
+ return null;
+ }
+ else if (childContextDNComponents.length ==
+ partitionDNComponents.length + 1)
+ {
+ String childRDN = childContextDNComponents[0];
+ String childContextDN = childContext.getNameInNamespace();
+
+ int beginIndex = childRDN.length() + 1;
+ int endIndex = childContextDN.length();
+
+ parentRelativeDN = childContextDN.substring(
+ beginIndex, endIndex );
+
+ return parentRelativeDN;
+ }
+ else
+ {
+ String childRDN = childContextDNComponents[0];
+ String childContextDN = childContext.getNameInNamespace();
+
+ int beginIndex = childRDN.length() + 1;
+ int endIndex =
+ childContextDN.length() -
+ ( partitionDN.length() +1);
+
+ parentRelativeDN = childContextDN.substring(
+ beginIndex, endIndex );
+ }
+ return parentRelativeDN;
+ }
+}
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/LDAPNormalizer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/LDAPNormalizer.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/LDAPNormalizer.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/LDAPNormalizer.java Thu May 31 12:58:13 2007
@@ -0,0 +1,18 @@
+
+package org.apache.tuscany.das.ldap.util;
+
+public class LDAPNormalizer
+{
+
+ /**
+ * Normalize a qualified string for LDAP
+ * by replacing periods with dashes.
+ *
+ * @param qualifiedName the qualified name
+ */
+ public static void normalize(String qualifiedName)
+ {
+ qualifiedName = qualifiedName.replace( ".", "-" );
+ }
+
+}
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/SimpleTypeNamespaceQualifier.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/SimpleTypeNamespaceQualifier.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/SimpleTypeNamespaceQualifier.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/SimpleTypeNamespaceQualifier.java Thu May 31 12:58:13 2007
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.das.ldap.util;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class DataTypeNamespaceQualifier.
+ */
+public class SimpleTypeNamespaceQualifier
+{
+ /**
+ * Qualify.
+ *
+ * @param namespaceURI the namespace URI
+ * @param complexTypeName the name
+ *
+ * @return the string
+ */
+ public static String qualify(String namespaceURI, String complexTypeName, String simpleTypeName )
+ {
+ return namespaceURI + "/" + complexTypeName + "/" + simpleTypeName;
+ }
+}
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/XSDNamespaceToInitialContextTransformer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/XSDNamespaceToInitialContextTransformer.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/XSDNamespaceToInitialContextTransformer.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/XSDNamespaceToInitialContextTransformer.java Thu May 31 12:58:13 2007
@@ -0,0 +1,49 @@
+
+package org.apache.tuscany.das.ldap.util;
+
+import org.eclipse.emf.common.util.URI;
+
+/**
+ * The Class XSDNamespaceToInitialContextTransformer.
+ *
+ * Takes the XSD Namespace used by the DataObjects
+ * and transforms it into the DN of the initial context
+ * used for the root DataObject entry.
+ */
+public class XSDNamespaceToInitialContextTransformer
+{
+ /**
+ * Transform.
+ *
+ * @param namespaceURIString the namespace URI string
+ *
+ * @return the DN of the initial context
+ *
+ * @throws Exception the exception
+ */
+ public static String transform(String namespaceURIString) throws Exception
+ {
+ URI namespaceURI = URI.createURI(namespaceURIString);
+ String authority = namespaceURI.authority();
+
+ String path = namespaceURI.path();
+
+ String[] authorityTokens = authority.split( "[.]" );
+ String[] pathTokens = path.split("[/]");
+
+ String DN = new String("");
+
+ for (int i = (pathTokens.length-1); i > 0; i--)
+ {
+ DN = DN + "cn=" + pathTokens[i] + ", ";
+ }
+
+ for (int i = 0; i <= (authorityTokens.length-2); i++)
+ {
+ DN = DN + "cn=" + authorityTokens[i] + ", ";
+ }
+
+ DN = DN + "ou=" + authorityTokens[authorityTokens.length-1];
+ return DN;
+ }
+}
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/XSDNamespaceURITokenizer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/XSDNamespaceURITokenizer.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/XSDNamespaceURITokenizer.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/src/main/java/org/apache/tuscany/das/ldap/util/XSDNamespaceURITokenizer.java Thu May 31 12:58:13 2007
@@ -0,0 +1,26 @@
+
+package org.apache.tuscany.das.ldap.util;
+
+import org.eclipse.emf.common.util.URI;
+
+public class XSDNamespaceURITokenizer
+{
+
+ public static String[] createAuthorityTokens( URI xsdNamespaceURI )
+ {
+ String authority = xsdNamespaceURI.authority();
+ String[] authorityTokens = authority.split( "[.]" );
+ return authorityTokens;
+ }
+
+ public static String[] createPathTokens(URI xsdNamespace)
+ {
+ String path = xsdNamespace.path();
+ if (path != null)
+ {
+ return path.split("[/]");
+ }
+ else
+ return null;
+ }
+}
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/create/InitialContextCreator.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/create/InitialContextCreator.class?view=auto&rev=543239
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/create/InitialContextCreator.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/create/InitialContextCreatorHelper.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/create/InitialContextCreatorHelper.class?view=auto&rev=543239
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/create/InitialContextCreatorHelper.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/ComplexTypeNamespaceQualifier.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/ComplexTypeNamespaceQualifier.class?view=auto&rev=543239
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/ComplexTypeNamespaceQualifier.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/InitialContextCreator.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/InitialContextCreator.class?view=auto&rev=543239
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/InitialContextCreator.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/InitialContextCreatorHelper.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/InitialContextCreatorHelper.class?view=auto&rev=543239
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/InitialContextCreatorHelper.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/JNDIUtil.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/JNDIUtil.class?view=auto&rev=543239
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/JNDIUtil.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/LDAPNormalizer.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/LDAPNormalizer.class?view=auto&rev=543239
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/LDAPNormalizer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/SimpleTypeNamespaceQualifier.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/SimpleTypeNamespaceQualifier.class?view=auto&rev=543239
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/SimpleTypeNamespaceQualifier.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/XSDNamespaceToInitialContextTransformer.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/XSDNamespaceToInitialContextTransformer.class?view=auto&rev=543239
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/XSDNamespaceToInitialContextTransformer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/XSDNamespaceURITokenizer.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/XSDNamespaceURITokenizer.class?view=auto&rev=543239
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/classes/org/apache/tuscany/das/ldap/util/XSDNamespaceURITokenizer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/das.ldap.utils-1.0-SNAPSHOT.jar
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/das.ldap.utils-1.0-SNAPSHOT.jar?view=auto&rev=543239
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap.utils/target/das.ldap.utils-1.0-SNAPSHOT.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/.classpath
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/.classpath?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/.classpath (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/.classpath Thu May 31 12:58:13 2007
@@ -0,0 +1,55 @@
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/ecore-edit/2.3.0-M4/ecore-edit-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/mapping-ecore2ecore-editor/2.3.0-M4/mapping-ecore2ecore-editor-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/importer/2.3.0-M4/importer-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/ant/2.3.0-M4/ant-2.3.0-M4.jar"/>
+ <classpathentry kind="src" path="/das.ldap.utils"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/mapping-ecore2xml/2.3.0-M4/mapping-ecore2xml-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/mapping-xsd2ecore-editor/2.3.0-M4/mapping-xsd2ecore-editor-2.3.0-M4.jar"/>
+ <classpathentry kind="src" path="/das.ldap.configuration.model.v100"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/ecore/2.3.0-M4/ecore-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/xsd/ecore-importer/2.3.0-M4/ecore-importer-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/ecore-sdo-edit/2.3.0-M4/ecore-sdo-edit-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/common/2.3.0-M4/common-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/mapping/2.3.0-M4/mapping-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.3/commons-lang-2.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/directory/server/apacheds-core/1.0.0/apacheds-core-1.0.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/emf/2.3.0-M4/emf-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/xsd/ecore-exporter/2.3.0-M4/ecore-exporter-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/importer-rose/2.3.0-M4/importer-rose-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/ecore-change/2.3.0-M4/ecore-change-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/ecore-sdo/2.3.0-M4/ecore-sdo-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/edit-ui/2.3.0-M4/edit-ui-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/mapping-ecore2xml-ui/2.3.0-M4/mapping-ecore2xml-ui-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/exporter/2.3.0-M4/exporter-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/mapping-ui/2.3.0-M4/mapping-ui-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/importer-ecore/2.3.0-M4/importer-ecore-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/codegen-ui/2.3.0-M4/codegen-ui-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/ecore-change-edit/2.3.0-M4/ecore-change-edit-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/jdbm/jdbm/1.0/jdbm-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/codegen/2.3.0-M4/codegen-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/importer-java/2.3.0-M4/importer-java-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/mapping-xsd2ecore/2.3.0-M4/mapping-xsd2ecore-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/ecore-xmi/2.3.0-M4/ecore-xmi-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.2/commons-collections-3.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/slf4j/nlog4j/1.2.25/nlog4j-1.2.25.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/directory/server/apacheds-core-shared/1.0.0/apacheds-core-shared-1.0.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/common-ui/2.3.0-M4/common-ui-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/xsd/edit/2.3.0-M4/edit-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/codegen-ecore/2.3.0-M4/codegen-ecore-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/directory/shared/shared-asn1/0.9.5.3/shared-asn1-0.9.5.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/directory/shared/shared-ldap/0.9.5.3/shared-ldap-0.9.5.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/mapping-ecore2ecore/2.3.0-M4/mapping-ecore2ecore-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/commonj-sdo/2.3.0-M4/commonj-sdo-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/edit/2.3.0-M4/edit-2.3.0-M4.jar"/>
+ <classpathentry kind="src" path="/das.ldap.constants"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/codegen-ecore-ui/2.3.0-M4/codegen-ecore-ui-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/xsd/xsd/2.3.0-M4/xsd-2.3.0-M4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/eclipse/emf/converter/2.3.0-M4/converter-2.3.0-M4.jar"/>
+</classpath>
\ No newline at end of file
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/.project
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/.project?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/.project (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/.project Thu May 31 12:58:13 2007
@@ -0,0 +1,18 @@
+<projectDescription>
+ <name>das.ldap</name>
+ <comment/>
+ <projects>
+ <project>das.ldap.utils</project>
+ <project>das.ldap.configuration.model.v100</project>
+ <project>das.ldap.constants</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments/>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/.settings/org.eclipse.jdt.core.prefs?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/.settings/org.eclipse.jdt.core.prefs (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/.settings/org.eclipse.jdt.core.prefs Thu May 31 12:58:13 2007
@@ -0,0 +1,5 @@
+#Wed Apr 18 09:51:27 CDT 2007
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/backup/ConnectionManagerTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/backup/ConnectionManagerTest.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/backup/ConnectionManagerTest.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/backup/ConnectionManagerTest.java Thu May 31 12:58:13 2007
@@ -0,0 +1,373 @@
+package org.apache.tuscany.das.ldap.configuration.v100;
+
+import java.util.Hashtable;
+
+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.tuscany.das.ldap.configuration.model.v100.DASConfiguration;
+import org.apache.tuscany.das.ldap.configuration.model.v100.DASLdapModelV100Factory;
+import org.apache.tuscany.das.ldap.configuration.model.v100.ConnectionManager;
+import org.apache.tuscany.das.ldap.schema.constants.AttributeTypeConstants;
+import org.apache.tuscany.das.ldap.schema.constants.ObjectClassConstants;
+import org.apache.tuscany.das.ldap.util.InitialContextCreator;
+
+import junit.framework.TestCase;
+
+public class ConnectionManagerTest extends TestCase
+implements AttributeTypeConstants, ObjectClassConstants {
+
+ private DASLdapModelV100Factory dasLdapV100Factory = null;
+ private ConnectionManager connectionManager = null;
+ private DirContext partitionContext = null;
+ private DirContext schemaContext = null;
+
+ private String xsdNamespace =
+ "http://example.org/users/accounts";
+
+ protected void setUp()
+ throws Exception {
+ super.setUp();
+ dasLdapV100Factory =
+ DASLdapModelV100Factory.eINSTANCE;
+
+ DASConfiguration dasConfiguration =
+ dasLdapV100Factory.createDASConfiguration();
+
+ dasConfiguration.setXsdNsURI( xsdNamespace );
+
+ connectionManager =
+ dasLdapV100Factory.createConnectionManager();
+
+ connectionManager.setDasPartitionName( "system" );
+
+ connectionManager.setDasConfiguration( dasConfiguration );
+ }
+
+ protected void tearDown()
+ throws Exception {
+ super.tearDown();
+ }
+
+ public void testCreateNamespacedContext()
+ throws NamingException
+ {
+ DirContext directoryContext =
+ connectionManager.createNamespacedContext();
+
+ assertEquals(
+ "cn=accounts,cn=users,cn=example,cn=org," +
+ connectionManager.getDASPartitionDN(),
+ directoryContext.getNameInNamespace() );
+
+ connectionManager.disconnect( directoryContext );
+ }
+
+ public void testCreateSchemaAttributesTypeContext()
+ throws NamingException
+ {
+ DirContext directoryContext =
+ connectionManager.createSchemaAttributeTypesContext();
+
+ System.out.println(directoryContext.getNameInNamespace());
+
+ assertEquals(
+ "ou=attributeTypes,cn="
+ + connectionManager.getDasPartitionName()
+ + ",ou=schema",
+ directoryContext.getNameInNamespace());
+
+ connectionManager.disconnect( directoryContext );
+ }
+
+ public void testCreateSchemaObjectClassesContext()
+ throws NamingException
+ {
+ DirContext directoryContext =
+ connectionManager.createSchemaObjectClassesContext();
+
+ System.out.println(directoryContext.getNameInNamespace());
+
+ assertEquals(
+ "ou=objectClasses,cn="
+ + connectionManager.getDasPartitionName()
+ + ",ou=schema",
+ directoryContext.getNameInNamespace());
+
+ connectionManager.disconnect( directoryContext );
+ }
+
+ /*
+ public void testCreateObjectClass()
+ throws NamingException
+ {
+ DirContext directoryContext =
+ connectionManager.createSchemaObjectClassesContext();
+
+ Attribute attribute = new BasicAttribute( "objectClass", "metaObjectclass" );
+ attribute.add("metaTop" );
+ attribute.add( "top" );
+
+ Attributes attributes = new BasicAttributes();
+
+ attributes.put( "m-oid", "1.3.6.1.4.1.18060.18060.18060.0.4.1.2.28" );
+ //attributes.put( "m-description", "org.example.user.account.Account" );
+ //attributes.put( "m-must", "id" );
+ //attributes.put( "m-must", "org-example-user-account-Account-name" );
+ //attributes.put( "m-may", "street" );
+ attributes.put( "m-obsolete", "false" );
+
+ directoryContext.createSubcontext(
+ "m-oid=1.3.6.1.4.1.18060.18060.18060.0.4.1.2.28",
+ attributes);
+
+ connectionManager.disconnect( directoryContext );
+ }
+ */
+
+ /*
+ 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 );
+ }
+
+
+
+ private 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" );
+ }
+ */
+
+ /*
+ public void testCreateSyntax() throws NamingException
+ {
+ DirContext syntaxContext =
+ connectionManager.createSchemaSyntaxesContext();
+
+ DirContext syntaxCheckersContext =
+ connectionManager.createSchemaSyntaxCheckersContext();
+
+
+ Attributes syntaxCheckerAttributes =
+ new BasicAttributes();
+ Attribute syntaxCheckerAttribute =
+ new BasicAttribute("objectClass", "metaSyntaxChecker");
+ syntaxCheckerAttribute.add("metaTop");
+ syntaxCheckerAttribute.add("top");
+
+ syntaxCheckerAttributes.put( syntaxCheckerAttribute );
+ syntaxCheckerAttributes.put(
+ "m-fqcn",
+ "org.apache.directory.shared.ldap.schema.syntax.AcceptAllSyntaxChecker" );
+
+ syntaxCheckerAttributes.put( "m-oid","1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5" );
+ syntaxCheckersContext.destroySubcontext( "m-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5" );
+ syntaxCheckersContext.createSubcontext(
+ "m-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5",
+ syntaxCheckerAttributes);
+
+
+ Attributes attributes = new BasicAttributes();
+ Attribute attribute = new BasicAttribute(
+ "objectClass",
+ "metaSyntax");
+ attribute.add("metaTop");
+ attribute.add("top");
+
+ attributes.put( "m-oid","1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5" );
+
+ syntaxContext.createSubcontext(
+ "m-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5",
+ attributes);
+ }
+ */
+
+ public void testCreateSchemaSyntaxesContext()
+ throws NamingException
+ {
+ DirContext directoryContext =
+ connectionManager.createSchemaSyntaxesContext();
+
+ System.out.println(directoryContext.getNameInNamespace());
+
+ assertEquals(
+ "ou=syntaxes,cn="
+ + connectionManager.getDasPartitionName()
+ + ",ou=schema",
+ directoryContext.getNameInNamespace());
+
+ connectionManager.disconnect( directoryContext );
+ }
+
+ public void testCreateSchemaSyntaxCheckersContext()
+ throws NamingException
+ {
+ DirContext directoryContext =
+ connectionManager.createSchemaSyntaxCheckersContext();
+
+ System.out.println(directoryContext.getNameInNamespace());
+
+ assertEquals(
+ "ou=syntaxCheckers,cn="
+ + connectionManager.getDasPartitionName()
+ + ",ou=schema",
+ directoryContext.getNameInNamespace());
+
+ connectionManager.disconnect( directoryContext );
+ }
+
+
+/*
+ public void testConnect()
+ throws NamingException
+ {
+ partitionContext = connectionManager.connect();
+
+ assertEquals(
+ partitionContext.getNameInNamespace(),
+ "ou=das");
+
+ System.out.println(partitionContext.getNameInNamespace());
+
+ partitionContext.close();
+ }
+*/
+
+ /*
+ public void testSchemaConnect()
+ throws NamingException
+ {
+
+ schemaContext = connectionManager.schemaConnect();
+
+ assertEquals(
+ schemaContext.getNameInNamespace(),
+ "cn=das,ou=schema");
+
+ System.out.println(schemaContext.getNameInNamespace());
+ schemaContext.close();
+
+ }
+ */
+
+
+ /*
+ public void testIsEPackageMetaDataWritten()
+ throws NamingException
+ {
+// directoryContext = jndiProperties.schemaConnect();
+ directoryContext = connect();
+ DirContext dirContext = ( DirContext )
+ directoryContext.createSubcontext( "cn=test1" );
+
+ dirContext.createSubcontext( "cn=test2" );
+
+ directoryContext.lookup( "cn=test2, cn=test1" );
+
+ dirContext.destroySubcontext( "cn=test2" );
+ directoryContext.destroySubcontext( "cn=test1" );
+
+ directoryContext.close();
+ }
+ */
+
+ public void testBigTime() throws NamingException
+ {
+ DirContext directoryContext = connect();
+
+ DirContext dasSchemaContext =
+ InitialContextCreator.
+ createSchemaRootContext( directoryContext, "das" );
+
+ DirContext syntaxCheckersContext =
+ InitialContextCreator.
+ createSchemaSyntaxCheckersContext( dasSchemaContext);
+
+ Attributes syntaxCheckerAttributes =
+ new BasicAttributes();
+ Attribute syntaxCheckerAttribute =
+ new BasicAttribute("objectClass", "metaSyntaxChecker");
+ syntaxCheckerAttribute.add("metaTop");
+ syntaxCheckerAttribute.add("top");
+
+ syntaxCheckerAttributes.put( syntaxCheckerAttribute );
+ syntaxCheckerAttributes.put(
+ "m-fqcn",
+ "org.apache.directory.shared.ldap.schema.syntax.AcceptAllSyntaxChecker" );
+
+ syntaxCheckerAttributes.put( "m-oid","1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5" );
+ //syntaxCheckersContext.destroySubcontext( "m-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5" );
+ syntaxCheckersContext.createSubcontext(
+ "m-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5",
+ syntaxCheckerAttributes);
+
+
+
+ DirContext syntaxesContext =
+ InitialContextCreator.
+ createSchemaSyntaxesContext( dasSchemaContext);
+
+ Attributes attributes = new BasicAttributes();
+ Attribute attribute = new BasicAttribute(
+ "objectClass",
+ "metaSyntax");
+ attribute.add("metaTop");
+ attribute.add("top");
+
+ attributes.put( "m-oid","1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5" );
+
+ syntaxesContext.createSubcontext(
+ "m-oid=1.3.6.1.4.1.18060.0.4.0.0.1.1.5.5.5.5",
+ attributes);
+
+ directoryContext.close();
+ }
+
+
+ public DirContext connect() throws NamingException
+ {
+ Hashtable<String,String> env = new Hashtable<String, String>();
+ //"org.apache.directory.server.core.jndi.CoreContextFactory"
+ env.put(
+ "java.naming.factory.initial",
+ "com.sun.jndi.ldap.LdapCtxFactory" );
+ env.put(
+ "java.naming.provider.url",
+ "ldap://localhost:10389/ou=schema");
+ env.put(
+ "java.naming.security.authentication",
+ "simple");
+ env.put(
+ "java.naming.security.principal",
+ "uid=admin,ou=system" );
+ env.put(
+ "java.naming.security.credentials",
+ "secret" );
+
+ return new InitialDirContext(env);
+ }
+
+ public void testModelLoad()
+ {
+ assertTrue(true);
+ }
+}
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/backup/InitialContextCreatorHelper.java.bak
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/backup/InitialContextCreatorHelper.java.bak?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/backup/InitialContextCreatorHelper.java.bak (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/backup/InitialContextCreatorHelper.java.bak Thu May 31 12:58:13 2007
@@ -0,0 +1,182 @@
+/*
+ * 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.Attributes;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.DirContext;
+
+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.SchemaObjectClassConstants;
+
+/**
+ * The Class InitialContextCreatorHelper.
+ */
+public class InitialContextCreatorHelper
+implements
+ObjectClassConstants,
+SchemaObjectClassConstants,
+AttributeTypeConstants
+{
+ /**
+ * Lookup the subcontext and if it does not exist,
+ * create it.
+ *
+ * @param dirContext the dir context
+ * @param subContext the sub context
+ *
+ * @return the dir context
+ *
+ * @throws NamingException the naming exception
+ */
+ public static DirContext createSubContext(
+ DirContext dirContext,
+ String subContext,
+ Attributes attributes)
+ throws NamingException
+ {
+ try
+ {
+ dirContext = ( DirContext ) dirContext.lookup( subContext );
+ }
+ catch ( NamingException e )
+ {
+ if (attributes == null)
+ {
+ dirContext = ( DirContext ) dirContext.createSubcontext( subContext );
+ }
+ else
+ {
+ dirContext = ( DirContext ) dirContext.createSubcontext( subContext, attributes );
+ }
+ }
+ return dirContext;
+ }
+
+ /**
+ * Creates the authority context.
+ *
+ * @param authorityTokens the authority tokens
+ * @param directoryContext the directory context
+ *
+ * @return the dir context
+ *
+ * @throws NamingException the naming exception
+ */
+ public static DirContext createAuthorityContext(
+ DirContext directoryContext,
+ String[] authorityTokens)
+ throws NamingException
+ {
+ for (int i = authorityTokens.length-1; i >= (0); i--)
+ {
+ String subContext = "cn=" + authorityTokens[i];
+ directoryContext = createSubContext( directoryContext, subContext, null );
+ }
+ return directoryContext;
+ }
+
+ /**
+ * Creates the path context.
+ *
+ * @param dirContext the dir context
+ * @param pathTokens the path tokens
+ *
+ * @return the dir context
+ *
+ * @throws NamingException the naming exception
+ */
+ public static DirContext createPathContext(
+ DirContext dirContext,
+ String[] pathTokens)
+ throws NamingException
+ {
+ for (int i = 1; i < (pathTokens.length); i++)
+ {
+ String subContext = "cn=" + pathTokens[i];
+ dirContext = createSubContext( dirContext, subContext, null );
+ }
+ return dirContext;
+ }
+
+ /**
+ * Creates the schema authority context.
+ *
+ * @param authorityTokens the authority tokens
+ * @param directoryContext the directory context
+ *
+ * @return the dir context
+ *
+ * @throws NamingException the naming exception
+ */
+ public static DirContext createSchemaAuthorityContext(
+ DirContext directoryContext,
+ String[] authorityTokens)
+ throws NamingException
+ {
+ Attributes attributes = new BasicAttributes();
+ attributes.put(OBJECT_CLASS, TOP);
+ attributes.put(OBJECT_CLASS, META_SCHEMA);
+
+ for (int i = 0; i <= (authorityTokens.length-2); i++)
+ {
+ String subContext = CN + "=" + authorityTokens[i];
+ attributes.put(CN, authorityTokens[i]);
+
+ directoryContext = createSubContext( directoryContext, subContext, null );
+ }
+ return directoryContext;
+ }
+
+ /**
+ * Creates the schema path context.
+ *
+ * @param dirContext the dir context
+ * @param pathTokens the path tokens
+ *
+ * @return the dir context
+ *
+ * @throws NamingException the naming exception
+ */
+ public static DirContext createSchemaPathContext(
+ DirContext dirContext,
+ String[] pathTokens)
+ throws NamingException
+ {
+ Attributes attributes = new BasicAttributes();
+ attributes.put(OBJECT_CLASS, TOP);
+ attributes.put(OBJECT_CLASS, META_SCHEMA);
+
+ for (int i = 1; i < (pathTokens.length); i++)
+ {
+
+ String subContext = CN + "=" + pathTokens[i];
+ attributes.put(CN, pathTokens[i]);
+
+ dirContext = createSubContext(
+ dirContext,
+ subContext,
+ attributes );
+ }
+ return dirContext;
+ }
+}
\ No newline at end of file