Commit 6ed88283 authored by Emmanuel Bourg's avatar Emmanuel Bourg

New upstream version 2.0.0~M21

parent a6397209
......@@ -271,3 +271,44 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
==================================================================================================
slf4j 1.7.10 license:
--------------------------------------------------------------------------------------------------
Copyright (c) 2004-2013 QOS.ch
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
==========================================================================
For the AVL Set code : http://bobah.net/d4d/source-code/misc/java-avl-tree
--------------------------------------------------------------------------
Copyright 2001-2014 Vladimir Lysyy
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this source code 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.
ApacheDS
Copyright 2003-2014 The Apache Software Foundation
Copyright 2003-2015 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
Copyright 1998-2008 The OpenLDAP Foundation
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted only as authorized by the OpenLDAP
Public License.
A copy of this license is available in the file LICENSE in the
top-level directory of the distribution or, alternatively, at
<http://www.OpenLDAP.org/license.html>.
OpenLDAP is a registered trademark of the OpenLDAP Foundation.
Individual files and/or contributed packages may be copyright by
other parties and/or subject to additional restrictions.
This work is derived from the University of Michigan LDAP v3.3
distribution. Information concerning this software is available
at <http://www.umich.edu/~dirsvcs/ldap/ldap.html>.
This work also contains materials derived from public sources.
Additional information about OpenLDAP can be obtained at
<http://www.openldap.org/>.
---
Portions Copyright 1998-2008 Kurt D. Zeilenga.
Portions Copyright 1998-2006 Net Boolean Incorporated.
Portions Copyright 2001-2006 IBM Corporation.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted only as authorized by the OpenLDAP
Public License.
---
Portions Copyright 1999-2007 Howard Y.H. Chu.
Portions Copyright 1999-2007 Symas Corporation.
Portions Copyright 1998-2003 Hallvard B. Furuseth.
Portions Copyright 2007 Gavin Henry
Portions Copyright 2007 Suretec Systems
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that this notice is preserved.
The names of the copyright holders may not be used to endorse or
promote products derived from this software without their specific
prior written permission. This software is provided ``as is''
without express or implied warranty.
---
Portions Copyright (c) 1992-1996 Regents of the University of Michigan.
All rights reserved.
Redistribution and use in source and binary forms are permitted
provided that this notice is preserved and that due credit is given
to the University of Michigan at Ann Arbor. The name of the
University may not be used to endorse or promote products derived
from this software without specific prior written permission. This
software is provided ``as is'' without express or implied warranty.
---
Portions Copyright (c) 2001-2011 Vladimir Lysyy
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this source code 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.
......@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-parent</artifactId>
<version>2.0.0-M20</version>
<version>2.0.0-M21</version>
</parent>
<artifactId>apacheds-all</artifactId>
......
......@@ -12,8 +12,10 @@
<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;sourceLookupDirector&gt;&#10;&lt;sourceContainers duplicates=&quot;false&quot;&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;folder nest=&amp;quot;false&amp;quot; path=&amp;quot;/shared-ldap-extras-codec/src/main/java/org/apache/directory/shared/ldap/extras&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.debug.core.containerType.folder&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;default/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#10;&lt;/sourceContainers&gt;&#10;&lt;/sourceLookupDirector&gt;&#10;"/>
<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.directory.server.UberjarMain"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="./target/instance"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="apacheds-service"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-javaagent:/Users/elecharny/jip-1.1.1/profile/profile.jar -Dprofile.properties=/Users/elecharny/jip-1.1.1/profile/profile.properties"/>
</launchConfiguration>
......@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-parent</artifactId>
<version>2.0.0-M20</version>
<version>2.0.0-M21</version>
</parent>
<artifactId>apacheds-core-annotations</artifactId>
......
......@@ -29,8 +29,13 @@ import java.lang.reflect.Method;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
public class AnnotationUtils
public final class AnnotationUtils
{
private AnnotationUtils()
{
}
/**
* Get an instance of a class extracted from the annotation found in the method
* or the class. We iterate on the stack trace until we find the desired annotation.
......
......@@ -50,7 +50,7 @@ public @interface CreateAuthenticator
/** Delegate host, use for testing DelegatingAuthenticator */
String delegateHost() default "localhost";
String delegateHost() default "";
/** Delegate port, use for testing DelegatingAuthenticator */
......
......@@ -23,6 +23,7 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.net.InetAddress;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
......@@ -34,6 +35,7 @@ import org.apache.directory.api.ldap.model.ldif.LdifEntry;
import org.apache.directory.api.ldap.model.ldif.LdifReader;
import org.apache.directory.api.ldap.model.name.Dn;
import org.apache.directory.api.ldap.model.schema.SchemaManager;
import org.apache.directory.api.util.Strings;
import org.apache.directory.server.core.annotations.AnnotationUtils;
import org.apache.directory.server.core.annotations.ApplyLdifFiles;
import org.apache.directory.server.core.annotations.ApplyLdifs;
......@@ -64,12 +66,17 @@ import org.slf4j.LoggerFactory;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
public class DSAnnotationProcessor
public final class DSAnnotationProcessor
{
/** A logger for this class */
private static final Logger LOG = LoggerFactory.getLogger( DSAnnotationProcessor.class );
private DSAnnotationProcessor()
{
}
/**
* Create the DirectoryService
*/
......@@ -124,7 +131,15 @@ public class DSAnnotationProcessor
if ( auth instanceof DelegatingAuthenticator )
{
DelegatingAuthenticator dauth = ( DelegatingAuthenticator ) auth;
dauth.setDelegateHost( createAuthenticator.delegateHost() );
String host = createAuthenticator.delegateHost();
if ( Strings.isEmpty( host ) )
{
host = InetAddress.getLocalHost().getHostName();
}
dauth.setDelegateHost( host );
dauth.setDelegatePort( createAuthenticator.delegatePort() );
dauth.setDelegateSsl( createAuthenticator.delegateSsl() );
dauth.setDelegateTls( createAuthenticator.delegateTls() );
......@@ -229,7 +244,7 @@ public class DSAnnotationProcessor
{
// The annotation contains a specific partition type, we use
// that type.
Class<?> partypes[] = new Class[]
Class<?>[] partypes = new Class[]
{ SchemaManager.class, DnFactory.class };
Constructor<?> constructor = createPartition.type().getConstructor( partypes );
partition = ( Partition ) constructor.newInstance( new Object[]
......@@ -492,14 +507,14 @@ public class DSAnnotationProcessor
{
String[] ldifs = applyLdifs.value();
String DN_START = "dn:";
String dnStart = "dn:";
StringBuilder sb = new StringBuilder();
for ( int i = 0; i < ldifs.length; )
{
String s = ldifs[i++].trim();
if ( s.startsWith( DN_START ) )
if ( s.startsWith( dnStart ) )
{
sb.append( s ).append( '\n' );
......@@ -507,7 +522,7 @@ public class DSAnnotationProcessor
while ( i < ldifs.length )
{
s = ldifs[i++];
if ( !s.startsWith( DN_START ) )
if ( !s.startsWith( dnStart ) )
{
sb.append( s ).append( '\n' );
}
......
......@@ -24,7 +24,6 @@ import java.io.File;
import org.apache.directory.api.ldap.model.schema.SchemaManager;
import org.apache.directory.server.core.api.DnFactory;
import org.apache.directory.server.core.api.partition.Partition;
import org.apache.directory.server.xdbm.Index;
/**
......
......@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-parent</artifactId>
<version>2.0.0-M20</version>
<version>2.0.0-M21</version>
</parent>
<artifactId>apacheds-core-api</artifactId>
......
......@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
public abstract class AbstractLayout
{
/** The logger*/
private static final Logger log = LoggerFactory.getLogger( AbstractLayout.class );
private static final Logger LOG = LoggerFactory.getLogger( AbstractLayout.class );
/** The required directories */
private File[] requiredDirectories = new File[0];
......@@ -149,7 +149,7 @@ public abstract class AbstractLayout
*/
public void verifyInstallation()
{
log.debug( "Verifying required directories" );
LOG.debug( "Verifying required directories" );
// Verifying required directories
for ( File requiredDirectory : requiredDirectories )
......@@ -158,7 +158,7 @@ public abstract class AbstractLayout
if ( !requiredDirectory.exists() )
{
String message = "The required '" + requiredDirectory + " directory does not exist!";
log.error( message );
LOG.error( message );
throw new IllegalStateException( message );
}
......@@ -166,7 +166,7 @@ public abstract class AbstractLayout
if ( requiredDirectory.isFile() )
{
String message = "'" + requiredDirectory + "' is a file when it should be a directory.";
log.error( message );
LOG.error( message );
throw new IllegalStateException( message );
}
......@@ -176,14 +176,14 @@ public abstract class AbstractLayout
String message = "'" + requiredDirectory
+ "' is write protected from the current user '"
+ System.getProperty( "user.name" ) + "'";
log.error( message );
LOG.error( message );
throw new IllegalStateException( message );
}
}
log.debug( "Required directories verification finished successfully." );
LOG.debug( "Required directories verification finished successfully." );
log.debug( "Verifying required files" );
LOG.debug( "Verifying required files" );
// Verifying required files
for ( File requiredFile : requiredFiles )
......@@ -192,7 +192,7 @@ public abstract class AbstractLayout
if ( !requiredFile.exists() )
{
String message = "The required'" + requiredFile + "' file does not exist!";
log.error( message );
LOG.error( message );
throw new IllegalStateException( message );
}
......@@ -200,7 +200,7 @@ public abstract class AbstractLayout
if ( requiredFile.isDirectory() )
{
String message = "'" + requiredFile + "' is a directory when it should be a file.";
log.error( message );
LOG.error( message );
throw new IllegalStateException( message );
}
......@@ -209,11 +209,11 @@ public abstract class AbstractLayout
{
String message = "'" + requiredFile + "' is not readable by the current user '"
+ System.getProperty( "user.name" ) + "'.";
log.error( message );
LOG.error( message );
throw new IllegalStateException( message );
}
}
log.debug( "Required files verification finished successfully." );
LOG.debug( "Required files verification finished successfully." );
}
}
/*
* 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.directory.server.core.api;
import org.apache.directory.api.ldap.model.constants.SchemaConstants;
import org.apache.directory.api.ldap.model.schema.AttributeType;
import org.apache.directory.api.ldap.model.schema.SchemaManager;
/**
* Provides commonly used {@link AttributeType}s.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
public class AttributeTypeProvider
{
private final AttributeType accessControlSubentries;
private final AttributeType administrativeRole;
private final AttributeType collectiveAttributeSubentries;
private final AttributeType collectiveExclusions;
private final AttributeType creatorsName;
private final AttributeType createTimestamp;
private final AttributeType entryACI;
private final AttributeType entryCSN;
private final AttributeType entryDN;
private final AttributeType entryUUID;
private final AttributeType member;
private final AttributeType modifiersName;
private final AttributeType modifyTimestamp;
private final AttributeType objectClass;
private final AttributeType prescriptiveACI;
private final AttributeType subentryACI;
private final AttributeType subschemaSubentry;
private final AttributeType subtreeSpecification;
private final AttributeType triggerExecutionSubentries;
private final AttributeType uniqueMember;
private final AttributeType userPassword;
private final AttributeType[] subentryOperationalAttributes;
public AttributeTypeProvider( SchemaManager schemaManager )
{
accessControlSubentries = schemaManager.getAttributeType( SchemaConstants.ACCESS_CONTROL_SUBENTRIES_AT );
administrativeRole = schemaManager.getAttributeType( SchemaConstants.ADMINISTRATIVE_ROLE_AT );
collectiveAttributeSubentries = schemaManager
.getAttributeType( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
collectiveExclusions = schemaManager.getAttributeType( SchemaConstants.COLLECTIVE_EXCLUSIONS_AT );
creatorsName = schemaManager.getAttributeType( SchemaConstants.CREATORS_NAME_AT );
createTimestamp = schemaManager.getAttributeType( SchemaConstants.CREATE_TIMESTAMP_AT );
entryACI = schemaManager.getAttributeType( SchemaConstants.ENTRY_ACI_AT_OID );
entryCSN = schemaManager.getAttributeType( SchemaConstants.ENTRY_CSN_AT );
entryDN = schemaManager.getAttributeType( SchemaConstants.ENTRY_DN_AT );
entryUUID = schemaManager.getAttributeType( SchemaConstants.ENTRY_UUID_AT );
member = schemaManager.getAttributeType( SchemaConstants.MEMBER_AT );
modifiersName = schemaManager.getAttributeType( SchemaConstants.MODIFIERS_NAME_AT );
modifyTimestamp = schemaManager.getAttributeType( SchemaConstants.MODIFY_TIMESTAMP_AT );
objectClass = schemaManager.getAttr