Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded OpenDJ module initial commit #340

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get install ppa-purge && sudo ppa-purge -y ppa:ubuntu-toolchain-r/test
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo dpkg --add-architecture i386
sudo mkdir -pm755 /etc/apt/keyrings && sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get install ppa-purge && sudo ppa-purge -y ppa:ubuntu-toolchain-r/test
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo dpkg --add-architecture i386
sudo mkdir -pm755 /etc/apt/keyrings && sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install wine+rpm for distribution
shell: bash
run: |
sudo apt-get install ppa-purge && sudo ppa-purge -y ppa:ubuntu-toolchain-r/test
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo dpkg --add-architecture i386
sudo mkdir -pm755 /etc/apt/keyrings && sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
Expand Down
112 changes: 112 additions & 0 deletions opendj-embedded/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
The contents of this file are subject to the terms of the Common Development and
Distribution License (the License). You may not use this file except in compliance with the
License.

You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
specific language governing permission and limitations under the License.

When distributing Covered Software, include this CDDL Header Notice in each file and include
the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
Header, with the fields enclosed by brackets [] replaced by your own identifying
information: "Portions Copyright [year] [name of copyright owner]".

Copyright 2024 3A Systems LLC.
-->
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.openidentityplatform.opendj</groupId>
<artifactId>opendj-parent</artifactId>
<version>4.6.3</version>
</parent>
<name>OpenDJ Embedded Server</name>
<artifactId>opendj-embedded</artifactId>

<dependencies>
<dependency>
<groupId>org.openidentityplatform.opendj</groupId>
<artifactId>opendj-server-legacy</artifactId>
<type>jar</type>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.2.11</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.9</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<resources>
<resource><directory>${project.basedir}/src/main/resources</directory></resource>
<resource><directory>${project.build.directory}/test-resources</directory></resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
<configuration>
<properties>
<property>
<name>usedefaultlisteners</name>
<value>true</value>
</property>
</properties>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>generate-resources</phase>
<goals>
<goal>copy</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.openidentityplatform.opendj</groupId>
<artifactId>opendj-server-legacy</artifactId>
<type>zip</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/test-resources/embedded-opendj</outputDirectory>
<destFileName>opendj.zip</destFileName>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions Copyright [year] [name of copyright owner]".
*
* Copyright 2024 3A Systems LLC.
*/

package org.openidentityplatform.opendj.embedded;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public class Config {

private final String CONFIG_PREFIX = Config.class.getPackage().getName();
private int port = Integer.parseInt(System.getProperty(CONFIG_PREFIX + ".port", "1389"));

private int adminPort = Integer.parseInt(System.getProperty(CONFIG_PREFIX + ".admin_port", "4444"));

private String adminPassword = System.getProperty(CONFIG_PREFIX + ".password", "passw0rd");

private String baseDN = System.getProperty(CONFIG_PREFIX + ".root", "dc=openidentityplatform,dc=org");

private String backendType = System.getProperty(CONFIG_PREFIX + ".backend", "je");

private int jmxPort = Integer.parseInt(System.getProperty(CONFIG_PREFIX + ".jmx_port", "1689"));

private String ldifSchema = System.getProperty(CONFIG_PREFIX + ".ldif.schema");

private String file = System.getProperty(CONFIG_PREFIX + ".ldif.data", "/test.ldif");

private Set<String> skipSet = new HashSet<>(Arrays.asList(System.getProperty(CONFIG_PREFIX + ".skip", ",ou=sample-skip-group,").toLowerCase().split(";")));

public int getPort() {
return port;
}

public void setPort(int port) {
this.port = port;
}

public int getAdminPort() {
return adminPort;
}

public void setAdminPort(int adminPort) {
this.adminPort = adminPort;
}


public String getAdminPassword() {
return adminPassword;
}

public void setAdminPassword(String adminPassword) {
this.adminPassword = adminPassword;
}

public String getBaseDN() {
return baseDN;
}

public void setBaseDN(String baseDN) {
this.baseDN = baseDN;
}

public String getBackendType() {
return backendType;
}

public void setBackendType(String backendType) {
this.backendType = backendType;
}

public int getJmxPort() {
return jmxPort;
}

public void setJmxPort(int jmxPort) {
this.jmxPort = jmxPort;
}

public String getLdifSchema() {
return ldifSchema;
}

public void setLdifSchema(String ldifSchema) {
this.ldifSchema = ldifSchema;
}

public String getFile() {
return file;
}

public void setFile(String file) {
this.file = file;
}


public Set<String> getSkipSet() {
return skipSet;
}

public void setSkipSet(Set<String> skipSet) {
this.skipSet = skipSet;
}

@Override
public String toString() {
return "Config {" +
"port=" + port +
", adminPort=" + adminPort +
", adminPassword='" + adminPassword + '\'' +
", baseDN='" + baseDN + '\'' +
", backendType='" + backendType + '\'' +
", jmxPort=" + jmxPort +
", ldifSchema='" + ldifSchema + '\'' +
", file='" + file + '\'' +
", skipSet=" + skipSet +
'}';
}
}
Loading