Skip to content
Commits on Source (9)
target/
.project
.classpath
.settings/
.svn/
bin/
# Intellij
*.ipr
*.iml
.idea
out/
.DS_Store
/bootstrap
/dependencies.xml
.java-version
META-INF/
dependency-reduced-pom.xml
......@@ -249,3 +249,66 @@ OpenLDAP is a registered trademark of the OpenLDAP Foundation.
Copyright 1999-2003 The OpenLDAP Foundation, Redwood City,
California, USA. All Rights Reserved. Permission to copy and
distribute verbatim copies of this document is granted.
----------------------------------------------------------------
Copyright (c) 2000 - 2011 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
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.
==================================================================================================
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-2013 The Apache Software Foundation
Copyright 2003-2017 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-M15</version>
<version>2.0.0-M24</version>
</parent>
<artifactId>apacheds-all</artifactId>
......@@ -74,7 +74,7 @@
<dependency>
<groupId>org.apache.directory.jdbm</groupId>
<artifactId>apacheds-jdbm1</artifactId>
<type>bundle</type>
<!--type>bundle</type-->
</dependency>
<dependency>
......@@ -163,7 +163,7 @@
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
<filters>
<filter>
<artifact>bouncycastle:bcprov-jdk15</artifact>
<artifact>org.bouncycastle:bcprov-jdk15on</artifact>
<excludes>
<exclude>META-INF/BCKEY.SF</exclude>
<exclude>META-INF/BCKEY.DSA</exclude>
......
......@@ -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>
<?xml version="1.0"?>
<!--
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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-parent</artifactId>
<version>2.0.0-M18-SNAPSHOT</version>
</parent>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-bulkloader</artifactId>
<name>ApacheDS Mavibot bulkloader</name>
<dependencies>
<dependency>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-mavibot-partition</artifactId>
</dependency>
<dependency>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-server-config</artifactId>
</dependency>
<dependency>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-ldif-partition</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.apache.directory.mavibot.btree.MavibotPartitionBuilder</mainClass>
</transformer>
</transformers>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
/*
* 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.mavibot.btree;
import java.util.UUID;
import org.apache.directory.api.ldap.model.name.Dn;
import org.apache.directory.api.ldap.model.schema.comparators.DnComparator;
import org.apache.directory.server.core.api.partition.Partition;
/**
* TODO DnTuple.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
public class DnTuple implements Comparable<DnTuple>
{
/** The DN */
private Dn dn;
/** The DN length */
private int len;
/** The offset if the LDIF file */
private long offset;
/** The DN ID */
private String id;
private DnTuple parent;
private int nbChildren = 0;
private int nbDecendents = 0;
private static final DnComparator COMPARATOR = new DnComparator( null );
public DnTuple( Dn dn, long offset, int len )
{
this.dn = dn;
this.offset = offset;
this.len = len;
this.id = UUID.randomUUID().toString();
}
public Dn getDn()
{
return dn;
}
public int getLen()
{
return len;
}
public long getOffset()
{
return offset;
}
public String getParentId()
{
if ( parent == null )
{
return Partition.ROOT_ID;
}
return parent.getId();
}
public DnTuple getParent()
{
return parent;
}
public void setParent( DnTuple parent )
{
this.parent = parent;
}
public String getId()
{
return id;
}
@Override
public int compareTo( DnTuple otherTuple )
{
return COMPARATOR.compare( otherTuple.dn, dn );
}
@Override
public int hashCode()
{
return dn.hashCode();
}
@Override
public boolean equals( Object obj )
{
if ( this == obj )
{
return true;
}
if ( obj == null )
{
return false;
}
DnTuple other = ( DnTuple ) obj;
if ( dn == null )
{
if ( other.dn != null )
{
return false;
}
}
else if ( !dn.equals( other.dn ) )
{
return false;
}
return true;
}
public void setId( String id )
{
this.id = id;
}
public int getNbChildren()
{
return nbChildren;
}
public int getNbDecendents()
{
return nbDecendents;
}
public void addChild()
{
nbChildren++;
}
public void addDecendent()
{
nbDecendents++;
if ( parent != null )
{
parent.addDecendent();
}
}
@Override
public String toString()
{
return "DnTuple [dn=" + dn + ", len=" + len + ", offset=" + offset + ", id=" + id + ", parentId="
+ getParentId()
+ ", nbChildren=" + nbChildren + ", nbDecendents=" + nbDecendents + "]";
}
}
/*
* 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.mavibot.btree;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.NoSuchElementException;
import org.apache.directory.api.i18n.I18n;
import org.apache.directory.api.ldap.model.exception.LdapException;
import org.apache.directory.api.ldap.model.ldif.LdapLdifException;
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.server.core.api.DnFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* An LDIF reader that gathers an entry's DN, length and offset.
* This is a special parser implemented for use in bulk loader tool.
*
* This class is not suitable for general purpose use.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
/** no qualifier */ class FastLdifReader extends LdifReader
{
/** A logger for this class */
private static final Logger LOG = LoggerFactory.getLogger( FastLdifReader.class );
/** the pre-fetched DnTuple */
private DnTuple firstFetchedTuple;
/** the next tuple */
private DnTuple nextTuple;
/** The DnFactory */
private DnFactory dnFactory;
/**
*
* Creates a new instance of FastLdifReader.
*
* @param file the LDIF file
* @throws LdapException
* @throws FileNotFoundException
*/
public FastLdifReader( File file, DnFactory dnFactory ) throws LdapException, FileNotFoundException
{
super();
reader = new PositionBufferedReader( new FileReader( file ) );
this.dnFactory = dnFactory;
validateDn = false;
init();
}
@Override
public void init() throws LdapException
{
lines = new ArrayList<String>();
position = 0;
version = DEFAULT_VERSION;
containsChanges = false;
containsEntries = false;
// No need to validate the Dn while we are parsing it from the LDIF file
validateDn = false;
// First get the version - if any -
fastParseVersion();
firstFetchedTuple = parseDnAlone();
}
/**
* Parse the version from the ldif input.
*
* @return A number representing the version (default to 1)
* @throws LdapLdifException If the version is incorrect or if the input is incorrect
*/
private void fastParseVersion() throws LdapLdifException
{
// First, read a list of lines
fastReadLines();
if ( lines.size() == 0 )
{
LOG.warn( "The ldif file is empty" );
return;
}
// get the first line
String line = lines.get( 0 );
// <ldif-file> ::= "version:" <fill> <number>
if ( line.startsWith( "version:" ) )
{
// Ok, skip the line
position += "version:".length();
// We have found the version, just discard the line from the list
lines.remove( 0 );
}
return;
}
@Override
public boolean hasNext()
{
return ( firstFetchedTuple != null );
}
public DnTuple getDnTuple()
{
return nextTuple;
}
@Override
public LdifEntry next()
{
try
{
LOG.debug( "next(): -- called" );
nextTuple = firstFetchedTuple;
// Read all the lines for one single entry
fastReadLines();
try
{
firstFetchedTuple = parseDnAlone();
}
catch ( LdapLdifException ne )
{
error = ne;
throw new NoSuchElementException( ne.getMessage() );
}
catch ( LdapException le )
{
throw new NoSuchElementException( le.getMessage() );
}
//System.out.println( nextTuple );
LOG.debug( "next(): -- saving DnTuple {}\n", nextTuple );
return null;
}
catch ( LdapLdifException ne )
{
ne.printStackTrace();
LOG.error( I18n.err( I18n.ERR_12071 ) );
error = ne;
return null;
}
}
/**
* Get teh DN from an entry, ignoring the remaining data
*/
private DnTuple parseDnAlone() throws LdapException
{
if ( ( lines == null ) || ( lines.size() == 0 ) )
{
LOG.debug( "The entry is empty : end of ldif file" );
return null;
}
// The entry must start with a dn: or a dn::
String line = lines.get( 0 );
lineNumber -= ( lines.size() - 1 );
String name = parseDn( line );
Dn dn = dnFactory.create( name );
DnTuple tuple = new DnTuple( dn, entryOffset, (int)(offset - entryOffset) );
return tuple;
}
protected String getLine() throws IOException
{
return ( ( PositionBufferedReader ) reader ).readLine();
}
/**
* Reads an entry in a ldif buffer, and returns the resulting lines, without
* comments, and unfolded.
*
* The lines represent *one* entry.
*
* @throws LdapLdifException If something went wrong
*/
private void fastReadLines() throws LdapLdifException
{
String line;
boolean insideComment = true;
boolean isFirstLine = true;
lines.clear();
entryOffset = offset;
StringBuffer sb = new StringBuffer();
try
{
while ( ( line = getLine() ) != null )
{
lineNumber++;
if ( line.length() == 0 )
{
if ( isFirstLine )
{
continue;
}
else
{
// The line is empty, we have read an entry
insideComment = false;
offset = ((PositionBufferedReader)reader).getFilePos();
break;
}
}
// We will read the first line which is not a comment
switch ( line.charAt( 0 ) )
{
case '#':
insideComment = true;
break;
case ' ':
isFirstLine = false;
if ( insideComment )
{
continue;
}
else if ( sb.length() == 0 )
{
LOG.error( I18n.err( I18n.ERR_12062_EMPTY_CONTINUATION_LINE ) );
throw new LdapLdifException( I18n.err( I18n.ERR_12061_LDIF_PARSING_ERROR ) );
}
else
{
sb.append( line.substring( 1 ) );
}
insideComment = false;
break;
default:
isFirstLine = false;
// We have found a new entry
// First, stores the previous one if any.
if ( sb.length() != 0 )
{
lines.add( sb.toString() );
}
sb = new StringBuffer( line );
insideComment = false;
break;
}
offset = ((PositionBufferedReader)reader).getFilePos();
}
}
catch ( IOException ioe )
{
throw new LdapLdifException( I18n.err( I18n.ERR_12063_ERROR_WHILE_READING_LDIF_LINE ), ioe );
}
// Stores the current line if necessary.
if ( sb.length() != 0 )
{
lines.add( sb.toString() );
}
}
}
/*
* 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.mavibot.btree;
import java.util.Comparator;
/**
* TODO IndexTupleComparator.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
@SuppressWarnings("all")
public class IndexTupleComparator implements Comparator<Tuple>
{
private Comparator keyComp;
public IndexTupleComparator( Comparator keyComp )
{
this.keyComp = keyComp;
}
@Override
public int compare( Tuple o1, Tuple o2 )
{
return keyComp.compare( o1.getKey(), o2.getKey() );
}
}
/*
* 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.mavibot.btree;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Set;
import org.apache.directory.api.ldap.model.entry.Entry;
import org.apache.directory.api.ldap.model.schema.SchemaManager;
import org.apache.directory.api.ldap.model.schema.registries.Schema;
import org.apache.directory.api.ldap.model.schema.registries.SchemaLoader;
import org.apache.directory.api.ldap.schema.loader.LdifSchemaLoader;
import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager;
import org.apache.directory.mavibot.btree.memory.BulkDataSorter;
import org.apache.directory.mavibot.btree.serializer.ElementSerializer;
import org.apache.directory.mavibot.btree.serializer.StringSerializer;
import org.apache.directory.server.core.partition.impl.btree.mavibot.LdifTupleComparator;
import org.apache.directory.server.core.partition.impl.btree.mavibot.LdifTupleReaderWriter;
import org.apache.directory.server.core.partition.impl.btree.mavibot.MavibotEntrySerializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* TODO LdifDataLoader.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
public class LdifDataLoader
{
private SchemaManager schemaManager;
private ElementSerializer<String> keySerializer = StringSerializer.INSTANCE;
private ElementSerializer<Entry> valSerializer = new MavibotEntrySerializer();
private static final Logger LOG = LoggerFactory.getLogger( LdifDataLoader.class );
public LdifDataLoader()
{
}
public boolean load( String schemaPartitionDir, String ldifFile, String targetPartitionDir )
{
initSchema( schemaPartitionDir );
if( schemaManager == null )
{
LOG.warn( "Failed to load the schema, aborting data load" );
return false;
}
return load( ldifFile, targetPartitionDir );
}
public boolean load( String ldifFile, String targetPartitionDir )
{
if( schemaManager == null )
{
LOG.warn( "No SchemaManager instance was found, aborting data load" );
return false;
}
File dataFile = new File( ldifFile );
if( !dataFile.exists() )
{
LOG.warn( "File {} does not exist", ldifFile );
return false;
}
else
{
if( !dataFile.canRead() )
{
LOG.warn( "File {} cannot be read by the current user", ldifFile );
return false;
}
}
RecordManager rm = new RecordManager( targetPartitionDir );
Set<String> existing = rm.getManagedTrees();
if( existing.size() > 2 )
{
LOG.warn( "Looks like the given partition directory {} already contains data of a mavibot partiton, please delete this data file and rerun this tool", ldifFile );
return false;
}
//MavibotPartitionBuilder<String, Entry> builder = new MavibotPartitionBuilder<String, Entry>( rm, "master", BTree.DEFAULT_PAGE_SIZE, keySerializer, valSerializer );
LdifTupleReaderWriter readerWriter = new LdifTupleReaderWriter( ldifFile, schemaManager );
LdifTupleComparator tupleComparator = new LdifTupleComparator();
BulkDataSorter sorter = new BulkDataSorter( readerWriter, tupleComparator, 10 );
try
{
sorter.sort( dataFile );
//builder.build( sorter.getMergeSortedTuples() );
return true;
}
catch( Exception e )
{
LOG.warn( "Errors occurred while loading data from the data file {}", ldifFile, e );
}
finally
{
try
{
rm.close();
}
catch( IOException e )
{
LOG.warn( "Failed to close the recordmanager", e );
}
}
return false;
}
private void initSchema( String dir )
{
if( schemaManager != null )
{
return;
}
try
{
File schemaRepository = new File( dir );
if( !schemaRepository.exists() )
{
LOG.warn( "The given schema location {} does not exist", dir );
}
SchemaLoader loader = new LdifSchemaLoader( schemaRepository );
schemaManager = new DefaultSchemaManager( loader );
LOG.debug( "Loading all enabled schemas" );
schemaManager.loadAllEnabled();
LOG.debug( "Loading all disabled schemas" );
List<Schema> lstDisabled = schemaManager.getDisabled();
for( Schema s : lstDisabled )
{
schemaManager.loadDisabled( s );
}
LOG.debug( "Successfully loaded schemas" );
}
catch( Exception e )
{
schemaManager = null;
LOG.warn( e.getMessage(), e );
}
}
/**
* @param schemaManager the schemaManager to set
*/
public void setSchemaManager( SchemaManager schemaManager )
{
this.schemaManager = schemaManager;
}
public static void main( String[] args )
{
}
}
/*
* 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.mavibot.btree;
/**
* Command line options for bulk loader.
*
* Here are the various options :
* <ul>
* <li>-c : The configuration directory</li>
* <li>-clean : delete the content of the output directory</li>
* <li>-h : gives the list of possible options</li>
* <li>-i : the LDIF file to be loaded</li>
* <li>-n : the number of keys stored in each node</li>
* <li>-o : the directory where the resulting partition will be stored</li>
* <li>-rid : the replica ID</li>
* <li>-verify : check that we have loaded all the entries in the MAsterTable</li>
* </ul>
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
public enum Option
{
HELP("-h", "Prints the details of the options"),
INPUT_FILE("-i", "Path of the LDIF file to be used as input"),
OUT_DIR("-o", "Path of the directory where the data files will be stored"),
CLEAN_OUT_DIR("-clean", "Deletes the output directory's contents if present"),
NUM_KEYS_PER_NODE("-n", "(optional) The number of keys to be present in each node, default is 16"),
DS_RID("-rid", "(optional) The RID value to be used in the entryCSN values, default is 1"),
CONFIG_DIR("-c", "The configuration partition directory"),
VERIFY_MASTER_TABLE("-verify", "(optional) Verifies the master table by just browsing (entries are not verified)"),
UNKNOWN(null, "Unknown Option");
private String text;
private String desc;
private Option( String text, String desc )
{
this.text = text;
this.desc = desc;
}
public String getText()
{
return text;
}
public String getDesc()
{
return desc;
}
public static Option getOpt( String opt )
{
if ( opt == null )
{
return UNKNOWN;
}
opt = opt.trim();
if ( opt.equalsIgnoreCase( HELP.text ) )
{
return HELP;
}
if ( opt.equalsIgnoreCase( VERIFY_MASTER_TABLE.text ) )
{
return VERIFY_MASTER_TABLE;
}
if ( opt.equalsIgnoreCase( INPUT_FILE.text ) )
{
return INPUT_FILE;
}
if ( opt.equalsIgnoreCase( OUT_DIR.text ) )
{
return OUT_DIR;
}
if ( opt.equalsIgnoreCase( CLEAN_OUT_DIR.text ) )
{
return CLEAN_OUT_DIR;
}
if ( opt.equalsIgnoreCase( NUM_KEYS_PER_NODE.text ) )
{
return NUM_KEYS_PER_NODE;
}
if ( opt.equalsIgnoreCase( CONFIG_DIR.text ) )
{
return CONFIG_DIR;
}
return UNKNOWN;
}
}
/*
* 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.mavibot.btree;
import java.io.IOException;
import java.io.Reader;
/**
* Code taken from Harmony.
*
* This modified class keep a track of the current position in the file,
* whether the OS is linux/unix or Windows.
*
* Wraps an existing {@link Reader} and <em>buffers</em> the input. Expensive
* interaction with the underlying reader is minimized, since most (smaller)
* requests can be satisfied by accessing the buffer alone. The drawback is that
* some extra space is required to hold the buffer and that copying takes place
* when filling that buffer, but this is usually outweighed by the performance
* benefits.
*
* <p/>A typical application pattern for the class looks like this:<p/>
*
* <pre>
* BufferedReader buf = new BufferedReader(new FileReader(&quot;file.java&quot;));
* </pre>
*
* @see BufferedWriter
* @since 1.1
*/
public class PositionBufferedReader extends Reader
{
private Reader in;
/**
* The characters that can be read and refilled in bulk. We maintain three
* indices into this buffer:<pre>
* { X X X X X X X X X X X X - - }
* ^ ^ ^
* | | |
* mark pos end</pre>
* Pos points to the next readable character. End is one greater than the
* last readable character. When {@code pos == end}, the buffer is empty and
* must be {@link #fillBuf() filled} before characters can be read.
*
* <p>Mark is the value pos will be set to on calls to {@link #reset}. Its
* value is in the range {@code [0...pos]}. If the mark is {@code -1}, the
* buffer cannot be reset.
*
* <p>MarkLimit limits the distance between the mark and the pos. When this
* limit is exceeded, {@link #reset} is permitted (but not required) to
* throw an exception. For shorter distances, {@link #reset} shall not throw
* (unless the reader is closed).
*/
private char[] buf;
private int pos;
private int end;
private int mark = -1;
private int markLimit = -1;
/** The current position in the file */
private long filePos;
/**
* Constructs a new BufferedReader on the Reader {@code in}. The
* buffer gets the default size (8 KB).
*
* @param in
* the Reader that is buffered.
*/
public PositionBufferedReader( Reader in )
{
super( in );
this.in = in;
buf = new char[8192];
}
/**
* Closes this reader. This implementation closes the buffered source reader
* and releases the buffer. Nothing is done if this reader has already been
* closed.
*
* @throws IOException
* if an error occurs while closing this reader.
*/
@Override
public void close() throws IOException
{
synchronized ( lock )
{
if ( !isClosed() )
{
in.close();
buf = null;
}
}
}
/**
* Populates the buffer with data. It is an error to call this method when
* the buffer still contains data; ie. if {@code pos < end}.
*
* @return the number of bytes read into the buffer, or -1 if the end of the
* source stream has been reached.
*/
private int fillBuf() throws IOException
{
// assert(pos == end);
if ( mark == -1 || ( pos - mark >= markLimit ) )
{
/* mark isn't set or has exceeded its limit. use the whole buffer */
int result = in.read( buf, 0, buf.length );
if ( result > 0 )
{
mark = -1;
pos = 0;
end = result;
}
return result;
}
if ( mark == 0 && markLimit > buf.length )
{
/* the only way to make room when mark=0 is by growing the buffer */
int newLength = buf.length * 2;
if ( newLength > markLimit )
{
newLength = markLimit;
}
char[] newbuf = new char[newLength];
System.arraycopy( buf, 0, newbuf, 0, buf.length );
buf = newbuf;
}
else if ( mark > 0 )
{
/* make room by shifting the buffered data to left mark positions */
System.arraycopy( buf, mark, buf, 0, buf.length - mark );
pos -= mark;
end -= mark;
mark = 0;
}
/* Set the new position and mark position */
int count = in.read( buf, pos, buf.length - pos );
if ( count != -1 )
{
end += count;
}
return count;
}
/**
* Indicates whether or not this reader is closed.
*
* @return {@code true} if this reader is closed, {@code false}
* otherwise.
*/
private boolean isClosed()
{
return buf == null;
}
/**
* Reads at most {@code length} characters from this reader and stores them
* at {@code offset} in the character array {@code buffer}. Returns the
* number of characters actually read or -1 if the end of the source reader
* has been reached. If all the buffered characters have been used, a mark
* has not been set and the requested number of characters is larger than
* this readers buffer size, BufferedReader bypasses the buffer and simply
* places the results directly into {@code buffer}.
*
* @param buffer
* the character array to store the characters read.
* @param offset
* the initial position in {@code buffer} to store the bytes read
* from this reader.
* @param length
* the maximum number of characters to read, must be
* non-negative.
* @return number of characters read or -1 if the end of the source reader
* has been reached.
* @throws IndexOutOfBoundsException
* if {@code offset < 0} or {@code length < 0}, or if
* {@code offset + length} is greater than the size of
* {@code buffer}.
* @throws IOException
* if this reader is closed or some other I/O error occurs.
*/
@Override
public int read( char[] buffer, int offset, int length ) throws IOException
{
synchronized ( lock )
{
if ( isClosed() )
{
throw new IOException( "" ); //$NON-NLS-1$
}
if ( offset < 0 || offset > buffer.length - length || length < 0 )
{
throw new IndexOutOfBoundsException();
}
int outstanding = length;
while ( outstanding > 0 )
{
/*
* If there are bytes in the buffer, grab those first.
*/
int available = end - pos;
if ( available > 0 )
{
int count = available >= outstanding ? outstanding : available;
System.arraycopy( buf, pos, buffer, offset, count );
pos += count;
offset += count;
outstanding -= count;
}
/*
* Before attempting to read from the underlying stream, make
* sure we really, really want to. We won't bother if we're
* done, or if we've already got some bytes and reading from the
* underlying stream would block.
*/
if ( outstanding == 0 || ( outstanding < length && !in.ready() ) )
{
break;
}
// assert(pos == end);
/*
* If we're unmarked and the requested size is greater than our
* buffer, read the bytes directly into the caller's buffer. We
* don't read into smaller buffers because that could result in
* a many reads.
*/
if ( ( mark == -1 || ( pos - mark >= markLimit ) )
&& outstanding >= buf.length )
{
int count = in.read( buffer, offset, outstanding );
if ( count > 0 )
{
offset += count;
outstanding -= count;
mark = -1;
}
break; // assume the source stream gave us all that it could
}
if ( fillBuf() == -1 )
{
break; // source is exhausted
}
}
int count = length - outstanding;
return ( count > 0 || count == length ) ? count : -1;
}
}
/**
* Returns the next line of text available from this reader. A line is
* represented by zero or more characters followed by {@code '\n'},
* {@code '\r'}, {@code "\r\n"} or the end of the reader. The string does
* not include the newline sequence.
*
* @return the contents of the line or {@code null} if no characters were
* read before the end of the reader has been reached.
* @throws IOException
* if this reader is closed or some other I/O error occurs.
*/
public String readLine() throws IOException
{
synchronized ( lock )
{
if ( isClosed() )
{
throw new IOException( "File closed, cannot read from it" );
}
/* has the underlying stream been exhausted? */
if ( pos == end && fillBuf() == -1 )
{
return null;
}
for ( int charPos = pos; charPos < end; charPos++ )
{
char ch = buf[charPos];
if ( ch > '\r' )
{
filePos++;
continue;
}
if ( ch == '\n' )
{
String res = new String( buf, pos, charPos - pos );
pos = charPos + 1;
filePos++;
return res;
}
else if ( ch == '\r' )
{
String res = new String( buf, pos, charPos - pos );
filePos++;
pos = charPos + 1;
if ( ( ( pos < end ) || ( fillBuf() != -1 ) )
&& ( buf[pos] == '\n' ) )
{
filePos++;
pos++;
}
return res;
}
}
char eol = '\0';
StringBuilder result = new StringBuilder( 80 );
/* Typical Line Length */
result.append( buf, pos, end - pos );
while ( true )
{
pos = end;
/* Are there buffered characters available? */
if ( eol == '\n' )
{
return result.toString();
}
// attempt to fill buffer
if ( fillBuf() == -1 )
{
// characters or null.
return result.length() > 0 || eol != '\0'
? result.toString()
: null;
}
filePos--;
for ( int charPos = pos; charPos < end; charPos++ )
{
char c = buf[charPos];
filePos++;
if ( eol == '\0' )
{
if ( ( c == '\n' || c == '\r' ) )
{
eol = c;
}
}
else if ( eol == '\r' && c == '\n' )
{
if ( charPos > pos )
{
result.append( buf, pos, charPos - pos - 1 );
}
pos = charPos + 1;
return result.toString();
}
else
{
if ( charPos > pos )
{
result.append( buf, pos, charPos - pos - 1 );
}
pos = charPos;
return result.toString();
}
}
if ( eol == '\0' )
{
result.append( buf, pos, end - pos );
}
else
{
result.append( buf, pos, end - pos - 1 );
}
}
}
}
/**
* @return the filePos
*/
public long getFilePos()
{
return filePos;
}
}
\ No newline at end of file
/*
* 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.mavibot.btree;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.StringReader;
import org.apache.directory.api.i18n.I18n;
import org.apache.directory.api.ldap.model.entry.DefaultEntry;
import org.apache.directory.api.ldap.model.entry.Entry;
import org.apache.directory.api.ldap.model.exception.LdapException;
import org.apache.directory.api.ldap.model.ldif.LdapLdifException;
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.schema.SchemaManager;
import org.apache.directory.api.util.Strings;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* A Ldif Reader that is schema aware
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
public class SchemaAwareLdifReader extends LdifReader
{
private SchemaManager schemaManager;
private static final Logger LOG = LoggerFactory.getLogger( SchemaAwareLdifReader.class );
public SchemaAwareLdifReader( SchemaManager schemaManager ) throws Exception
{
this.schemaManager = schemaManager;
validateDn = false;
}
protected LdifEntry createLdifEntry()
{
Entry entry = new DefaultEntry( schemaManager );
return new LdifEntry( entry );
}
/**
*
* parse a single entry from the given LDIF text.
*
* @param ldif the LDIF string
* @return an LdifEntry
* @throws LdapLdifException
*/
public LdifEntry parseLdifEntry( String ldif ) throws LdapLdifException
{
LOG.debug( "Starts parsing ldif buffer" );
if ( Strings.isEmpty( ldif ) )
{
return null;
}
BufferedReader reader = new BufferedReader( new StringReader( ldif ) );
try
{
this.reader = reader;
// First get the version - if any -
version = parseVersion();
return parseEntry();
}
catch ( LdapLdifException ne )
{
LOG.error( I18n.err( I18n.ERR_12069, ne.getLocalizedMessage() ) );
throw new LdapLdifException( I18n.err( I18n.ERR_12070 ), ne );
}
catch ( LdapException le )
{
throw new LdapLdifException( le.getMessage(), le );
}
finally
{
// Close the reader
try
{
reader.close();
}
catch ( IOException ioe )
{
throw new LdapLdifException( I18n.err( I18n.ERR_12024_CANNOT_CLOSE_FILE ), ioe );
}
}
}
}
/*
* 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.mavibot.btree;
import java.io.File;
import java.io.InputStream;
import org.apache.directory.api.util.FileUtils;
import org.apache.directory.server.config.LdifConfigExtractor;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import static org.junit.Assert.*;
/**
* Tests for MavibotPartitionBuilder.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
public class MavibotPartitionBuilderTest
{
@Rule
public TemporaryFolder folder = new TemporaryFolder();
/** The configuration file */
String configFile;
private File outDir;
private static File workDir = new File( System.getProperty( "java.io.tmpdir" ) + "/server-work" );
@Before
public void init() throws Exception
{
outDir = folder.newFolder( "MavibotPartitionBuilderTest" );
workDir.mkdir();
File configDir = new File( workDir, "config" ); // could be any directory, cause the config is now in a single file
configFile = LdifConfigExtractor.extractSingleFileConfig( configDir, "config.ldif", true );
}
@Test
public void testBulkLoad() throws Exception
{
//File file = new File( outDir, "builder-test.ldif" );
File file = new File( outDir, "30k.ldif" );
//InputStream in = MavibotPartitionBuilder.class.getClassLoader().getResourceAsStream( "builder-test.ldif" );
try ( InputStream in = MavibotPartitionBuilder.class.getClassLoader().getResourceAsStream( "30k.ldif" ) )
{
FileUtils.copyInputStreamToFile( in, file );
}
MavibotPartitionBuilder builder = new MavibotPartitionBuilder( configFile, file.getAbsolutePath(), outDir.getAbsolutePath() );
builder.buildPartition();
//test the trees
RecordManager rm = builder.getRm();
BTree masterTree = rm.getManagedTree( builder.getMasterTableName() );
assertEquals( builder.getTotalEntries(), masterTree.getNbElems() );
}
}
This diff is collapsed.
dn: ou=builder
objectClass: organizationalUnit
objectClass: top
ou: Users
dn: ou=Users,ou=builder
objectClass: organizationalUnit
objectClass: top
ou: Users
dn: uid=hnelson,ou=Users,ou=builder
objectClass: top
objectClass: person
objectClass: inetOrgPerson
objectClass: krb5principal
objectClass: krb5kdcentry
cn: Horatio Nelson
sn: Nelson
uid: hnelson
userPassword: secret
krb5PrincipalName: hnelson@EXAMPLE.COM
krb5KeyVersionNumber: 0
dn: uid=krbtgt,ou=Users,ou=builder
objectClass: top
objectClass: person
objectClass: inetOrgPerson
objectClass: krb5principal
objectClass: krb5kdcentry
cn: KDC Service
sn: Service
uid: krbtgt
userPassword: secret
krb5PrincipalName: krbtgt/EXAMPLE.COM@EXAMPLE.COM
krb5KeyVersionNumber: 0
dn: uid=ldap,ou=Users,ou=builder
objectClass: top
objectClass: person
objectClass: inetOrgPerson
objectClass: krb5principal
objectClass: krb5kdcentry
cn: LDAP
sn: Service
uid: ldap
userPassword: randall
krb5PrincipalName: ldap/localhost@EXAMPLE.COM
krb5KeyVersionNumber: 0
dn: uid=tc01,ou=Users,ou=builder
objectClass: top
objectClass: person
objectClass: inetOrgPerson
objectClass: krb5principal
objectClass: krb5kdcentry
cn: Tomcate
sn: Service
uid: tc01
userPassword: abcd_1234
krb5PrincipalName: tc1/localhost@EXAMPLE.COM
krb5KeyVersionNumber: 0
dn: uid=kadmin,ou=Users,ou=builder
objectClass: top
objectClass: person
objectClass: inetOrgPerson
objectClass: krb5principal
objectClass: krb5kdcentry
cn: Changepassword Service
sn: Service
uid: kadmin
userPassword: secret
krb5PrincipalName: kadmin/changepw@EXAMPLE.COM
krb5KeyVersionNumber: 0
#############################################################################
# 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=OFF, stdout
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
......@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-parent</artifactId>
<version>2.0.0-M15</version>
<version>2.0.0-M24</version>
</parent>
<artifactId>apacheds-core-annotations</artifactId>
......@@ -47,6 +47,11 @@
<groupId>${project.groupId}</groupId>
<artifactId>apacheds-core-api</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>apacheds-core-shared</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
......@@ -71,20 +76,13 @@
<dependency>
<groupId>org.apache.directory.mavibot</groupId>
<artifactId>mavibot</artifactId>
<version>1.0.0-M1</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>apacheds-mavibot-partition</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</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.
......