directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szoer...@apache.org
Subject svn commit: r710144 - in /directory/sandbox/szoerner/envpartition: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/directory/ src/main/java/org/apache/directory/samples/ src/main/java/org/apache/di...
Date Mon, 03 Nov 2008 19:46:09 GMT
Author: szoerner
Date: Mon Nov  3 11:46:08 2008
New Revision: 710144

URL: http://svn.apache.org/viewvc?rev=710144&view=rev
Log: (empty)

Added:
    directory/sandbox/szoerner/envpartition/
    directory/sandbox/szoerner/envpartition/pom.xml
    directory/sandbox/szoerner/envpartition/src/
    directory/sandbox/szoerner/envpartition/src/main/
    directory/sandbox/szoerner/envpartition/src/main/java/
    directory/sandbox/szoerner/envpartition/src/main/java/org/
    directory/sandbox/szoerner/envpartition/src/main/java/org/apache/
    directory/sandbox/szoerner/envpartition/src/main/java/org/apache/directory/
    directory/sandbox/szoerner/envpartition/src/main/java/org/apache/directory/samples/
    directory/sandbox/szoerner/envpartition/src/main/java/org/apache/directory/samples/partition/
    directory/sandbox/szoerner/envpartition/src/main/java/org/apache/directory/samples/partition/env/
    directory/sandbox/szoerner/envpartition/src/main/java/org/apache/directory/samples/partition/env/EnvironmentPartition.java
    directory/sandbox/szoerner/envpartition/src/main/resources/
    directory/sandbox/szoerner/envpartition/src/main/resources/log4j.properties
    directory/sandbox/szoerner/envpartition/src/test/
    directory/sandbox/szoerner/envpartition/src/test/java/
    directory/sandbox/szoerner/envpartition/src/test/java/org/
    directory/sandbox/szoerner/envpartition/src/test/java/org/apache/
    directory/sandbox/szoerner/envpartition/src/test/java/org/apache/directory/
    directory/sandbox/szoerner/envpartition/src/test/java/org/apache/directory/samples/
    directory/sandbox/szoerner/envpartition/src/test/java/org/apache/directory/samples/partition/
    directory/sandbox/szoerner/envpartition/src/test/java/org/apache/directory/samples/partition/env/
    directory/sandbox/szoerner/envpartition/src/test/java/org/apache/directory/samples/partition/env/EnvironmentPartitionTest.java

Added: directory/sandbox/szoerner/envpartition/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/szoerner/envpartition/pom.xml?rev=710144&view=auto
==============================================================================
--- directory/sandbox/szoerner/envpartition/pom.xml (added)
+++ directory/sandbox/szoerner/envpartition/pom.xml Mon Nov  3 11:46:08 2008
@@ -0,0 +1,201 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.example</groupId>
+  <artifactId>myProject</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>Embed ApacheDS as a Web Application</name>
+  <url>http://maven.apache.org</url>
+  
+  <build>
+    <finalName>myProject</finalName>
+    <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <groupId>org.apache.maven.plugins</groupId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-bootstrap-extract</artifactId>
+      <version>1.5.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-bootstrap-partition</artifactId>
+      <version>1.5.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-core</artifactId>
+      <version>1.5.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-core-avl</artifactId>
+      <version>1.5.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-core-cursor</artifactId>
+      <version>1.5.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-core-entry</artifactId>
+      <version>1.5.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-core-jndi</artifactId>
+      <version>1.5.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-core-shared</artifactId>
+      <version>1.5.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-jdbm</artifactId>
+      <version>1.5.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-jdbm-store</artifactId>
+      <version>1.5.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-protocol-ldap</artifactId>
+      <version>1.5.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-protocol-shared</artifactId>
+      <version>1.5.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-schema-bootstrap</artifactId>
+      <version>1.5.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-schema-registries</artifactId>
+      <version>1.5.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-utils</artifactId>
+      <version>1.5.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-xdbm-base</artifactId>
+      <version>1.5.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-xdbm-search</artifactId>
+      <version>1.5.4</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-collections</groupId>
+      <artifactId>commons-collections</artifactId>
+      <version>3.2.1</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>2.4</version>
+    </dependency>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <version>1.2.14</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.mina</groupId>
+      <artifactId>mina-core</artifactId>
+      <version>1.1.7</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.mina</groupId>
+      <artifactId>mina-filter-ssl</artifactId>
+      <version>1.1.7</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.shared</groupId>
+      <artifactId>shared-asn1</artifactId>
+      <version>0.9.12</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.shared</groupId>
+      <artifactId>shared-asn1-codec</artifactId>
+      <version>0.9.12</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.shared</groupId>
+      <artifactId>shared-bouncycastle-reduced</artifactId>
+      <version>0.9.12</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.shared</groupId>
+      <artifactId>shared-ldap</artifactId>
+      <version>0.9.12</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.shared</groupId>
+      <artifactId>shared-ldap-constants</artifactId>
+      <version>0.9.12</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>1.5.2</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+      <version>1.5.2</version>
+    </dependency>
+    <dependency>
+      <groupId>antlr</groupId>
+      <artifactId>antlr</artifactId>
+      <version>2.7.7</version>
+    </dependency>
+      <dependency>
+        <groupId>junit</groupId>
+        <artifactId>junit</artifactId>
+        <version>4.4</version>
+      </dependency>  </dependencies>
+</project>

Added: directory/sandbox/szoerner/envpartition/src/main/java/org/apache/directory/samples/partition/env/EnvironmentPartition.java
URL: http://svn.apache.org/viewvc/directory/sandbox/szoerner/envpartition/src/main/java/org/apache/directory/samples/partition/env/EnvironmentPartition.java?rev=710144&view=auto
==============================================================================
--- directory/sandbox/szoerner/envpartition/src/main/java/org/apache/directory/samples/partition/env/EnvironmentPartition.java
(added)
+++ directory/sandbox/szoerner/envpartition/src/main/java/org/apache/directory/samples/partition/env/EnvironmentPartition.java
Mon Nov  3 11:46:08 2008
@@ -0,0 +1,176 @@
+package org.apache.directory.samples.partition.env;
+
+import javax.naming.OperationNotSupportedException;
+
+import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.ClonedServerEntry;
+import org.apache.directory.server.core.filtering.EntryFilteringCursor;
+import org.apache.directory.server.core.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.interceptor.context.BindOperationContext;
+import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
+import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
+import org.apache.directory.server.core.interceptor.context.ListOperationContext;
+import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
+import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
+import org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext;
+import org.apache.directory.server.core.interceptor.context.MoveOperationContext;
+import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
+import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
+import org.apache.directory.server.core.partition.Partition;
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class EnvironmentPartition implements Partition {
+
+    /** The logger */
+    private static final Logger LOG = LoggerFactory
+            .getLogger(EnvironmentPartition.class);
+
+    private String id;
+
+    private String suffix;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getSuffix() {
+        return suffix;
+    }
+
+    public void setSuffix(String suffix) {
+        this.suffix = suffix;
+    }
+
+    public void bind(BindOperationContext ctx) throws Exception {
+
+        LOG.debug("bind()");
+
+        // TODO Auto-generated method stub
+    }
+
+    public void delete(DeleteOperationContext ctx)
+            throws OperationNotSupportedException {
+        throw new OperationNotSupportedException();
+    }
+
+    public void add(AddOperationContext ctx)
+            throws OperationNotSupportedException {
+        throw new OperationNotSupportedException();
+    }
+
+    public void modify(ModifyOperationContext ctx)
+            throws OperationNotSupportedException {
+        throw new OperationNotSupportedException();
+    }
+
+    public void move(MoveOperationContext ctx)
+            throws OperationNotSupportedException {
+        throw new OperationNotSupportedException();
+    }
+
+    public void moveAndRename(MoveAndRenameOperationContext ctx)
+            throws OperationNotSupportedException {
+        throw new OperationNotSupportedException();
+    }
+
+    public void rename(RenameOperationContext ctx)
+            throws OperationNotSupportedException {
+        throw new OperationNotSupportedException();
+    }
+
+    public void init(DirectoryService service) throws Exception {
+        LOG.debug("init()");
+    }
+
+    public boolean isInitialized() {
+        LOG.debug("isInitialized()");
+        return true;
+    }
+
+    public void destroy() throws Exception {
+        LOG.debug("destroy()");
+    }
+
+    public int getCacheSize() {
+        return 0;
+    }
+
+    public LdapDN getSuffixDn() throws Exception {
+
+        LOG.debug("getSuffixDn()");
+
+        return new LdapDN(suffix); // TODO: Check, whether OK ...
+    }
+
+    @Override
+    public LdapDN getUpSuffixDn() throws Exception {
+
+        LOG.debug("getUpSuffixDn()");
+
+        return getSuffixDn();
+    }
+
+    @Override
+    public boolean hasEntry(EntryOperationContext ctx) throws Exception {
+
+        LOG.debug("hasEntry()");
+
+        return false;
+    }
+
+    @Override
+    public EntryFilteringCursor list(ListOperationContext ctx) throws Exception {
+
+        LOG.debug("list()");
+
+        return null;
+    }
+
+    @Override
+    public ClonedServerEntry lookup(LookupOperationContext ctx)
+            throws Exception {
+
+        LOG.debug("lookup()");
+
+        return null;
+    }
+
+    @Override
+    public ClonedServerEntry lookup(Long arg0) throws Exception {
+        // TODO Auto-generated method stub
+
+        LOG.debug("lookup()");
+
+        return null;
+    }
+
+    @Override
+    public EntryFilteringCursor search(SearchOperationContext ctx)
+            throws Exception {
+        LOG.debug("search()");
+
+        return null;
+    }
+
+    @Override
+    public void setCacheSize(int cacheSize) {
+    }
+
+    @Override
+    public void sync() throws Exception {
+        LOG.debug("sync()");
+    }
+
+    @Override
+    public void unbind(UnbindOperationContext arg0) throws Exception {
+        LOG.debug("unbind()");
+    }
+
+}

Added: directory/sandbox/szoerner/envpartition/src/main/resources/log4j.properties
URL: http://svn.apache.org/viewvc/directory/sandbox/szoerner/envpartition/src/main/resources/log4j.properties?rev=710144&view=auto
==============================================================================
--- directory/sandbox/szoerner/envpartition/src/main/resources/log4j.properties (added)
+++ directory/sandbox/szoerner/envpartition/src/main/resources/log4j.properties Mon Nov  3
11:46:08 2008
@@ -0,0 +1,30 @@
+#    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.
+log4j.rootCategory=INFO, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=apacheds-rolling.log
+
+log4j.appender.R.MaxFileSize=1024KB
+# Keep some backup files
+log4j.appender.R.MaxBackupIndex=5
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n
+

Added: directory/sandbox/szoerner/envpartition/src/test/java/org/apache/directory/samples/partition/env/EnvironmentPartitionTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/szoerner/envpartition/src/test/java/org/apache/directory/samples/partition/env/EnvironmentPartitionTest.java?rev=710144&view=auto
==============================================================================
--- directory/sandbox/szoerner/envpartition/src/test/java/org/apache/directory/samples/partition/env/EnvironmentPartitionTest.java
(added)
+++ directory/sandbox/szoerner/envpartition/src/test/java/org/apache/directory/samples/partition/env/EnvironmentPartitionTest.java
Mon Nov  3 11:46:08 2008
@@ -0,0 +1,34 @@
+package org.apache.directory.samples.partition.env;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.directory.server.core.DefaultDirectoryService;
+import org.apache.directory.server.core.DirectoryService;
+
+public class EnvironmentPartitionTest extends TestCase {
+
+    public void testAddPartition() throws Exception {
+        DirectoryService directoryService;
+
+        directoryService = new DefaultDirectoryService();
+        directoryService.setShutdownHookEnabled(true);
+
+        // Determine an appropriate working directory
+        File workingDir = new File("work");
+        directoryService.setWorkingDirectory(workingDir);
+
+        // Create a new partition
+        EnvironmentPartition envPartition = new EnvironmentPartition();
+        envPartition.setId("env");
+        envPartition.setSuffix("ou=env");
+        envPartition.init(directoryService);
+
+        directoryService.addPartition(envPartition);
+        directoryService.startup();
+        
+        directoryService.shutdown();
+    }
+
+}



Mime
View raw message