directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szoer...@apache.org
Subject svn commit: r777131 - in /directory/sandbox/szoerner/apacheds-tomcatrealm: ./ 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/tomcatrealm/
Date Thu, 21 May 2009 14:30:56 GMT
Author: szoerner
Date: Thu May 21 14:30:55 2009
New Revision: 777131

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

Added:
    directory/sandbox/szoerner/apacheds-tomcatrealm/
    directory/sandbox/szoerner/apacheds-tomcatrealm/pom.xml
    directory/sandbox/szoerner/apacheds-tomcatrealm/src/
    directory/sandbox/szoerner/apacheds-tomcatrealm/src/main/
    directory/sandbox/szoerner/apacheds-tomcatrealm/src/main/java/
    directory/sandbox/szoerner/apacheds-tomcatrealm/src/main/java/org/
    directory/sandbox/szoerner/apacheds-tomcatrealm/src/main/java/org/apache/
    directory/sandbox/szoerner/apacheds-tomcatrealm/src/main/java/org/apache/directory/
    directory/sandbox/szoerner/apacheds-tomcatrealm/src/main/java/org/apache/directory/tomcatrealm/
    directory/sandbox/szoerner/apacheds-tomcatrealm/src/main/java/org/apache/directory/tomcatrealm/EmbeddedApacheDsRealm.java

Added: directory/sandbox/szoerner/apacheds-tomcatrealm/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/szoerner/apacheds-tomcatrealm/pom.xml?rev=777131&view=auto
==============================================================================
--- directory/sandbox/szoerner/apacheds-tomcatrealm/pom.xml (added)
+++ directory/sandbox/szoerner/apacheds-tomcatrealm/pom.xml Thu May 21 14:30:55 2009
@@ -0,0 +1,206 @@
+<?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.apache.directory.samples</groupId>
+  <artifactId>apachedsTomcatRealm</artifactId>
+  <packaging>jar</packaging>
+  <version>0.1-SNAPSHOT</version>
+  <name>ApacheDS embedded as Tomcat realm</name>
+  <url>http://maven.apache.org</url>
+  
+  <build>
+    <finalName>apachedsTomcatRealm</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>tomcat</groupId>
+      <artifactId>catalina</artifactId>
+      <version>5.5.23</version>
+    </dependency>
+    <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/apacheds-tomcatrealm/src/main/java/org/apache/directory/tomcatrealm/EmbeddedApacheDsRealm.java
URL: http://svn.apache.org/viewvc/directory/sandbox/szoerner/apacheds-tomcatrealm/src/main/java/org/apache/directory/tomcatrealm/EmbeddedApacheDsRealm.java?rev=777131&view=auto
==============================================================================
--- directory/sandbox/szoerner/apacheds-tomcatrealm/src/main/java/org/apache/directory/tomcatrealm/EmbeddedApacheDsRealm.java
(added)
+++ directory/sandbox/szoerner/apacheds-tomcatrealm/src/main/java/org/apache/directory/tomcatrealm/EmbeddedApacheDsRealm.java
Thu May 21 14:30:55 2009
@@ -0,0 +1,211 @@
+package org.apache.directory.tomcatrealm;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.IOException;
+import java.security.Principal;
+import java.security.cert.X509Certificate;
+
+import org.apache.catalina.Container;
+import org.apache.catalina.Context;
+import org.apache.catalina.Lifecycle;
+import org.apache.catalina.LifecycleException;
+import org.apache.catalina.LifecycleListener;
+import org.apache.catalina.Realm;
+import org.apache.catalina.connector.Request;
+import org.apache.catalina.connector.Response;
+import org.apache.catalina.deploy.SecurityConstraint;
+import org.apache.directory.server.core.DefaultDirectoryService;
+import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.ldap.LdapService;
+import org.apache.directory.server.protocol.shared.SocketAcceptor;
+
+public class EmbeddedApacheDsRealm implements Realm, Lifecycle {
+
+	private PropertyChangeSupport propertyChangeSupport;
+
+	private Container container;
+
+	private DirectoryService directoryService;
+
+	private SocketAcceptor socketAcceptor;
+
+	private LdapService ldapService;
+
+	public EmbeddedApacheDsRealm() {
+		this.propertyChangeSupport = new PropertyChangeSupport(this);
+	}
+
+	/**
+	 * Startup ApacheDS embedded.
+	 */
+	@Override
+	public void start() throws LifecycleException {
+		try {				
+			directoryService = new DefaultDirectoryService();
+			directoryService.setShutdownHookEnabled(true);
+
+			socketAcceptor = new SocketAcceptor(null);
+			ldapService = new LdapService();
+			ldapService.setSocketAcceptor(socketAcceptor);
+			ldapService.setDirectoryService(directoryService);
+
+			// Set LDAP port to 10389
+			ldapService.setIpPort(10389);
+
+			// Determine an appropriate working directory
+			// ??
+
+			directoryService.startup();
+			ldapService.start();
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new LifecycleException(e);
+		}
+	}
+
+	/**
+	 * Shutdown ApacheDS embedded.
+	 */
+	@Override
+	public void stop() throws LifecycleException {
+		
+		System.out.println("EmbeddedApacheDsRealm::stop()");
+		
+		try {
+			ldapService.stop();
+			directoryService.shutdown();
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new LifecycleException(e);
+		}
+	}
+
+	/**
+	 * Set the Container with which this Realm has been associated.
+	 */
+	@Override
+	public void setContainer(Container container) {
+		this.container = container;
+	}
+
+	/**
+	 * Return the Container with which this Realm has been associated.
+	 */
+	@Override
+	public Container getContainer() {
+		return this.container;
+	}
+
+	/**
+	 * Add a property change listener to this component.
+	 */
+	@Override
+	public void addPropertyChangeListener(PropertyChangeListener listener) {
+		this.propertyChangeSupport.addPropertyChangeListener(listener);
+	}
+
+	/**
+	 * Remove a property change listener from this component.
+	 */
+	@Override
+	public void removePropertyChangeListener(PropertyChangeListener listener) {
+		this.propertyChangeSupport.removePropertyChangeListener(listener);
+	}
+
+	/**
+	 * Return descriptive information about this Realm implementation and the
+	 * corresponding version number, in the format <description>/<version>.
+	 */
+	@Override
+	public String getInfo() {
+		return "EmbeddedApacheDsRealm/0.1";
+	}
+
+	/**
+	 * Return the Principal associated with the specified username and
+	 * credentials, if there is one; otherwise return null.
+	 */
+	@Override
+	public Principal authenticate(String username, String credentials) {
+		
+		System.out.println("authenticate "+username);
+		
+		return null;
+	}
+
+	/**
+	 * Return true if the specified Principal has the specified security role,
+	 * within the context of this Realm; otherwise return false.
+	 */
+	@Override
+	public boolean hasRole(Principal principal, String role) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public Principal authenticate(X509Certificate[] arg0) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Principal authenticate(String arg0, byte[] arg1) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Principal authenticate(String arg0, String arg1, String arg2,
+			String arg3, String arg4, String arg5, String arg6, String arg7) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void backgroundProcess() {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public SecurityConstraint[] findSecurityConstraints(Request arg0,
+			Context arg1) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public boolean hasResourcePermission(Request arg0, Response arg1,
+			SecurityConstraint[] arg2, Context arg3) throws IOException {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean hasUserDataPermission(Request arg0, Response arg1,
+			SecurityConstraint[] arg2) throws IOException {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public void addLifecycleListener(LifecycleListener listener) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public LifecycleListener[] findLifecycleListeners() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void removeLifecycleListener(LifecycleListener listener) {
+		// TODO Auto-generated method stub
+
+	}
+
+}



Mime
View raw message