directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1748572 [8/23] - in /directory/apacheds/branches/apacheds-value: ./ benchmarks/installers-maven-plugin/ benchmarks/installers-maven-plugin/.settings/ benchmarks/installers-maven-plugin/target/ benchmarks/installers-maven-plugin/target/clas...
Date Wed, 15 Jun 2016 12:30:01 GMT
Modified: directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultDnFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultDnFactory.java?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultDnFactory.java (original)
+++ directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultDnFactory.java Wed Jun 15 12:29:57 2016
@@ -70,6 +70,7 @@ public class DefaultDnFactory implements
     /**
      * {@inheritDoc}
      */
+    @Override
     public Dn create( String dn ) throws LdapInvalidDnException
     {
         if ( dn == null )
@@ -134,16 +135,28 @@ public class DefaultDnFactory implements
     /**
      * {@inheritDoc}
      */
+    @Override
     public Dn create( String... upRdns ) throws LdapInvalidDnException
     {
         StringBuilder sb = new StringBuilder();
+        boolean isFirst = true;
+        
         for ( String s : upRdns )
         {
-            sb.append( s ).append( ',' );
+            if ( isFirst )
+            {
+                isFirst = false;
+            }
+            else
+            {
+                sb.append( ',' );
+            }
+            
+            sb.append( s );
         }
 
         String dn = sb.toString();
-        dn = dn.substring( 0, dn.length() - 1 );
+        
         return create( dn );
     }
 

Modified: directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/ReferralManagerImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/ReferralManagerImpl.java?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/ReferralManagerImpl.java (original)
+++ directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/ReferralManagerImpl.java Wed Jun 15 12:29:57 2016
@@ -27,7 +27,7 @@ import javax.naming.directory.SearchCont
 
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.entry.Entry;
-import org.apache.directory.api.ldap.model.entry.StringValue;
+import org.apache.directory.api.ldap.model.entry.Value;
 import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.apache.directory.api.ldap.model.exception.LdapOperationException;
 import org.apache.directory.api.ldap.model.filter.EqualityNode;
@@ -77,7 +77,7 @@ public class ReferralManagerImpl impleme
 
         try
         {
-            referrals = new DnNode<Entry>();
+            referrals = new DnNode<>();
             PartitionNexus nexus = directoryService.getPartitionNexus();
     
             Set<String> suffixes = nexus.listSuffixes();
@@ -98,6 +98,7 @@ public class ReferralManagerImpl impleme
      * No read operation can be done on the referralManager if this
      * method is not called before.
      */
+    @Override
     public void lockRead()
     {
         mutex.readLock().lock();
@@ -109,6 +110,7 @@ public class ReferralManagerImpl impleme
      * No write operation can be done on the referralManager if this
      * method is not called before.
      */
+    @Override
     public void lockWrite()
     {
         mutex.writeLock().lock();
@@ -120,6 +122,7 @@ public class ReferralManagerImpl impleme
      * This method must be called after having read or modified the
      * ReferralManager
      */
+    @Override
     public void unlock()
     {
         if ( mutex.isWriteLockedByCurrentThread() )
@@ -138,6 +141,7 @@ public class ReferralManagerImpl impleme
      */
     // This will suppress PMD.EmptyCatchBlock warnings in this method
     @SuppressWarnings("PMD.EmptyCatchBlock")
+    @Override
     public void addReferral( Entry entry )
     {
         try
@@ -154,10 +158,11 @@ public class ReferralManagerImpl impleme
     /**
      * {@inheritDoc}
      */
+    @Override
     public void init( DirectoryService directoryService, String... suffixes ) throws LdapException
     {
         ExprNode referralFilter = new EqualityNode<String>( objectClassAT,
-            new StringValue( SchemaConstants.REFERRAL_OC ) );
+            new Value( objectClassAT, SchemaConstants.REFERRAL_OC ) );
 
         // Lookup for each entry with the ObjectClass = Referral value
         SearchControls searchControl = new SearchControls();
@@ -214,10 +219,11 @@ public class ReferralManagerImpl impleme
     /**
      * {@inheritDoc}
      */
+    @Override
     public void remove( DirectoryService directoryService, Dn suffix ) throws Exception
     {
         ExprNode referralFilter = new EqualityNode<String>( objectClassAT,
-            new StringValue( SchemaConstants.REFERRAL_OC ) );
+            new Value( objectClassAT, SchemaConstants.REFERRAL_OC ) );
 
         // Lookup for each entry with the ObjectClass = Referral value
         SearchControls searchControl = new SearchControls();
@@ -249,6 +255,7 @@ public class ReferralManagerImpl impleme
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean hasParentReferral( Dn dn )
     {
         DnNode<Entry> referral = referrals.getNode( dn );
@@ -260,6 +267,7 @@ public class ReferralManagerImpl impleme
     /**
      * {@inheritDoc}
      */
+    @Override
     public Entry getParentReferral( Dn dn )
     {
         if ( !hasParentReferral( dn ) )
@@ -274,6 +282,7 @@ public class ReferralManagerImpl impleme
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isReferral( Dn dn )
     {
         Entry parent = referrals.getElement( dn );
@@ -292,6 +301,7 @@ public class ReferralManagerImpl impleme
     /**
      * {@inheritDoc}
      */
+    @Override
     public void removeReferral( Entry entry ) throws LdapException
     {
         referrals.remove( entry.getDn() );

Modified: directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/SchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/SchemaService.java?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/SchemaService.java (original)
+++ directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/SchemaService.java Wed Jun 15 12:29:57 2016
@@ -429,8 +429,6 @@ public final class SchemaService
             addAttribute( attrs, SchemaConstants.ENTRY_DN_AT );
         }
 
-        Entry result = new ClonedServerEntry( attrs );
-
-        return result;
+        return new ClonedServerEntry( attrs );
     }
 }

Modified: directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntryComparator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntryComparator.java?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntryComparator.java (original)
+++ directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntryComparator.java Wed Jun 15 12:29:57 2016
@@ -93,7 +93,7 @@ class SortedEntryComparator implements C
             comparator = schemaManager.lookupComparatorRegistry( mr.getOid() );
         }
         
-        ( ( LdapComparator ) comparator ).setSchemaManager( schemaManager );
+        comparator.setSchemaManager( schemaManager );
     }
 
 
@@ -107,15 +107,15 @@ class SortedEntryComparator implements C
         // as per section 2.2 of the spec null values are considered larger
         if ( at1 == null )
         {
-            return ( reverse ? -1 : 1 );
+            return reverse ? -1 : 1;
         }
         else if ( at2 == null )
         {
-            return ( reverse ? 1 : -1 );
+            return reverse ? 1 : -1;
         }
 
-        Object o1 = null;
-        Object o2 = null;
+        Object o1;
+        Object o2;
 
         if ( multivalued )
         {
@@ -128,13 +128,13 @@ class SortedEntryComparator implements C
         }
         else
         {
-            Value<?> v1 = at1.get();
-            Value<?> v2 = at2.get();
+            Value v1 = at1.get();
+            Value v2 = at2.get();
 
             if ( hr )
             {
-                o1 = v1.getString();
-                o2 = v2.getString();
+                o1 = v1.getValue();
+                o2 = v2.getValue();
             }
             else
             {
@@ -143,23 +143,30 @@ class SortedEntryComparator implements C
             }
         }
 
-        int c = 1;
+        int c;
 
-        if ( reverse )
+        try
         {
-            c = comparator.compare( o2, o1 );
-        }
-        else
-        {
-            c = comparator.compare( o1, o2 );
-        }
+            if ( reverse )
+            {
+                c = comparator.compare( comparator.getNormalizer().normalize( ( String ) o2 ), o1 );
+            }
+            else
+            {
+                c = comparator.compare( comparator.getNormalizer().normalize( ( String ) o1 ), o2 );
+            }
+    
+            if ( c == 0 )
+            {
+                return 1;
+            }
 
-        if ( c == 0 )
+            return c;
+        }
+        catch ( LdapException le )
         {
-            return 1;
+            return 0;
         }
-
-        return c;
     }
 
 
@@ -176,7 +183,7 @@ class SortedEntryComparator implements C
         {
             if ( hr )
             {
-                ts.add( v.getString() );
+                ts.add( v.getNormalized() );
             }
             else
             {

Modified: directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntryCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntryCursor.java?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntryCursor.java (original)
+++ directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntryCursor.java Wed Jun 15 12:29:57 2016
@@ -78,7 +78,7 @@ public class SortedEntryCursor extends A
     @Override
     public boolean available()
     {
-        return ( tuple.getKey() != null );
+        return tuple.getKey() != null;
     }
 
 

Modified: directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntrySerializer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntrySerializer.java?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntrySerializer.java (original)
+++ directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntrySerializer.java Wed Jun 15 12:29:57 2016
@@ -208,9 +208,7 @@ public class SortedEntrySerializer imple
                 LOG.debug( "Serialize " + entry );
             }
 
-            byte[] bytes = baos.toByteArray();
-
-            return bytes;
+            return baos.toByteArray();
         }
         catch ( Exception e )
         {

Modified: directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java (original)
+++ directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java Wed Jun 15 12:29:57 2016
@@ -55,7 +55,6 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.name.Dn;
 import org.apache.directory.api.ldap.model.schema.AttributeType;
 import org.apache.directory.api.ldap.model.schema.AttributeTypeOptions;
-import org.apache.directory.api.ldap.model.schema.Normalizer;
 import org.apache.directory.api.ldap.model.schema.UsageEnum;
 import org.apache.directory.api.ldap.util.tree.DnNode;
 import org.apache.directory.api.util.exception.MultiException;
@@ -101,7 +100,7 @@ public class DefaultPartitionNexus exten
     private static final Logger LOG = LoggerFactory.getLogger( DefaultPartitionNexus.class );
 
     /** the fixed id: 'NEXUS' */
-    private static final String ID = "NEXUS";
+    private static final String NEXUS_ID = "NEXUS";
 
     /** Speedup for logs */
     private static final boolean IS_DEBUG = LOG.isDebugEnabled();
@@ -116,12 +115,12 @@ public class DefaultPartitionNexus exten
     private DirectoryService directoryService;
 
     /** the partitions keyed by normalized suffix strings */
-    private Map<String, Partition> partitions = new HashMap<String, Partition>();
+    private Map<String, Partition> partitions = new HashMap<>();
 
     /** A structure to hold all the partitions */
-    private DnNode<Partition> partitionLookupTree = new DnNode<Partition>();
+    private DnNode<Partition> partitionLookupTree = new DnNode<>();
 
-    private final List<Modification> mods = new ArrayList<Modification>( 2 );
+    private final List<Modification> mods = new ArrayList<>( 2 );
 
     /** The cn=schema Dn */
     private Dn subschemSubentryDn;
@@ -139,7 +138,7 @@ public class DefaultPartitionNexus exten
      */
     public DefaultPartitionNexus( Entry rootDse ) throws Exception
     {
-        id = ID;
+        id = NEXUS_ID;
         suffixDn = null;
 
         // setup that root DSE
@@ -214,14 +213,10 @@ public class DefaultPartitionNexus exten
 
             schemaManager = directoryService.getSchemaManager();
 
-            // Initialize and normalize the localy used DNs
-            Dn adminDn = directoryService.getDnFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN );
-            adminDn.apply( schemaManager );
+            Value attr = rootDse.get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
+            subschemSubentryDn = directoryService.getDnFactory().create( attr.getValue() );
 
-            Value<?> attr = rootDse.get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
-            subschemSubentryDn = directoryService.getDnFactory().create( attr.getString() );
-
-            List<Partition> initializedPartitions = new ArrayList<Partition>();
+            List<Partition> initializedPartitions = new ArrayList<>();
 
             initializedPartitions.add( 0, directoryService.getSystemPartition() );
             addContextPartition( directoryService.getSystemPartition() );
@@ -268,9 +263,10 @@ public class DefaultPartitionNexus exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.partition.PartitionNexus#destroy()
+    /**
+     * {@inheritDoc}
      */
+    @Override
     protected synchronized void doDestroy()
     {
         if ( !initialized )
@@ -280,15 +276,15 @@ public class DefaultPartitionNexus exten
 
         // make sure this loop is not fail fast so all backing stores can
         // have an attempt at closing down and synching their cached entries
-        for ( String suffix : new HashSet<String>( this.partitions.keySet() ) )
+        for ( String suffix : new HashSet<>( this.partitions.keySet() ) )
         {
             try
             {
-                removeContextPartition( directoryService.getDnFactory().create( suffix ) );
+                removeContextPartition( suffix );
             }
             catch ( Exception e )
             {
-                LOG.warn( "Failed to destroy a partition: " + suffix, e );
+                LOG.warn( "Failed to destroy a partition: " + suffixDn, e );
             }
         }
 
@@ -299,6 +295,7 @@ public class DefaultPartitionNexus exten
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setId( String id )
     {
         throw new UnsupportedOperationException( I18n.err( I18n.ERR_264 ) );
@@ -308,15 +305,17 @@ public class DefaultPartitionNexus exten
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setSuffixDn( Dn suffix )
     {
         throw new UnsupportedOperationException();
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.partition.PartitionNexus#sync()
+    /**
+     * {@inheritDoc}
      */
+    @Override
     public void sync() throws Exception
     {
         MultiException error = null;
@@ -355,6 +354,7 @@ public class DefaultPartitionNexus exten
     /**
      * {@inheritDoc}
      */
+    @Override
     public void add( AddOperationContext addContext ) throws LdapException
     {
         Partition partition = getPartition( addContext.getDn() );
@@ -365,6 +365,7 @@ public class DefaultPartitionNexus exten
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean compare( CompareOperationContext compareContext ) throws LdapException
     {
         Attribute attr = compareContext.getOriginalEntry().get( compareContext.getAttributeType() );
@@ -388,14 +389,11 @@ public class DefaultPartitionNexus exten
          * assertion value for comparisons with normalized attribute values.  Loop
          * through all values looking for a match.
          */
-        Normalizer normalizer = compareContext.getAttributeType().getEquality().getNormalizer();
-        Value<?> reqVal = normalizer.normalize( compareContext.getValue() );
+        Value reqVal = compareContext.getValue();
 
-        for ( Value<?> value : attr )
+        for ( Value value : attr )
         {
-            Value<?> attrValObj = normalizer.normalize( value );
-
-            if ( attrValObj.equals( reqVal ) )
+            if ( value.equals( reqVal ) )
             {
                 return true;
             }
@@ -408,18 +406,18 @@ public class DefaultPartitionNexus exten
     /**
      * {@inheritDoc}
      */
+    @Override
     public Entry delete( DeleteOperationContext deleteContext ) throws LdapException
     {
         Partition partition = getPartition( deleteContext.getDn() );
-        Entry deletedEntry = partition.delete( deleteContext );
-
-        return deletedEntry;
+        return partition.delete( deleteContext );
     }
 
 
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean hasEntry( HasEntryOperationContext hasEntryContext ) throws LdapException
     {
         Dn dn = hasEntryContext.getDn();
@@ -443,11 +441,12 @@ public class DefaultPartitionNexus exten
     /**
      * {@inheritDoc}
      */
+    @Override
     public Entry lookup( LookupOperationContext lookupContext ) throws LdapException
     {
         Dn dn = lookupContext.getDn();
 
-        if ( dn.equals( subschemSubentryDn ) )
+        if ( dn.getNormName().equals( subschemSubentryDn.getNormName() ) )
         {
             return new ClonedServerEntry( rootDse.clone() );
         }
@@ -455,9 +454,7 @@ public class DefaultPartitionNexus exten
         // This is for the case we do a lookup on the rootDSE
         if ( dn.isRootDse() )
         {
-            Entry retval = new ClonedServerEntry( rootDse );
-
-            return retval;
+            return new ClonedServerEntry( rootDse );
         }
 
         Partition partition = getPartition( dn );
@@ -465,10 +462,8 @@ public class DefaultPartitionNexus exten
 
         if ( entry == null )
         {
-            LdapNoSuchObjectException e = new LdapNoSuchObjectException( "Attempt to lookup non-existant entry: "
+            throw new LdapNoSuchObjectException( "Attempt to lookup non-existant entry: "
                 + dn.getName() );
-
-            throw e;
         }
 
         return entry;
@@ -478,10 +473,11 @@ public class DefaultPartitionNexus exten
     /**
      * {@inheritDoc}
      */
+    @Override
     public void modify( ModifyOperationContext modifyContext ) throws LdapException
     {
         // Special case : if we don't have any modification to apply, just return
-        if ( modifyContext.getModItems().size() == 0 )
+        if ( modifyContext.getModItems().isEmpty() )
         {
             return;
         }
@@ -500,6 +496,7 @@ public class DefaultPartitionNexus exten
     /**
      * {@inheritDoc}
      */
+    @Override
     public void move( MoveOperationContext moveContext ) throws LdapException
     {
         // Get the current partition
@@ -512,6 +509,7 @@ public class DefaultPartitionNexus exten
     /**
      * {@inheritDoc}
      */
+    @Override
     public void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException
     {
         Partition partition = getPartition( moveAndRenameContext.getDn() );
@@ -522,6 +520,7 @@ public class DefaultPartitionNexus exten
     /**
      * {@inheritDoc}
      */
+    @Override
     public void rename( RenameOperationContext renameContext ) throws LdapException
     {
         Partition partition = getPartition( renameContext.getDn() );
@@ -537,10 +536,9 @@ public class DefaultPartitionNexus exten
         // If nothing is asked for then we just return the entry asis.
         // We let other mechanisms filter out operational attributes.
         // -----------------------------------------------------------
-        if ( ( ids == null ) || ( ids.size() == 0 ) )
+        if ( ( ids == null ) || ( ids.isEmpty() ) )
         {
-            Entry rootDse = getRootDse( null );
-            return new EntryFilteringCursorImpl( new SingletonCursor<Entry>( rootDse ), searchContext,
+            return new EntryFilteringCursorImpl( new SingletonCursor<Entry>( getRootDse( null ) ), searchContext,
                 directoryService.getSchemaManager() );
         }
 
@@ -549,7 +547,7 @@ public class DefaultPartitionNexus exten
         // note if we've seen these special attributes as well.
         // -----------------------------------------------------------
 
-        Set<String> realIds = new HashSet<String>();
+        Set<String> realIds = new HashSet<>();
         boolean allUserAttributes = searchContext.isAllUserAttributes();
         boolean allOperationalAttributes = searchContext.isAllOperationalAttributes();
         boolean noAttribute = searchContext.isNoAttributes();
@@ -577,16 +575,16 @@ public class DefaultPartitionNexus exten
         // return everything
         if ( allUserAttributes && allOperationalAttributes )
         {
-            Entry rootDse = getRootDse( null );
-            return new EntryFilteringCursorImpl( new SingletonCursor<Entry>( rootDse ), searchContext,
+            Entry foundRootDse = getRootDse( null );
+            return new EntryFilteringCursorImpl( new SingletonCursor<Entry>( foundRootDse ), searchContext,
                 directoryService.getSchemaManager() );
         }
 
         Entry serverEntry = new DefaultEntry( schemaManager, Dn.ROOT_DSE );
 
-        Entry rootDse = getRootDse( new GetRootDseOperationContext( searchContext.getSession() ) );
+        Entry foundRootDse = getRootDse( new GetRootDseOperationContext( searchContext.getSession() ) );
 
-        for ( Attribute attribute : rootDse )
+        for ( Attribute attribute : foundRootDse )
         {
             AttributeType type = schemaManager.lookupAttributeTypeRegistry( attribute.getId() );
 
@@ -612,23 +610,27 @@ public class DefaultPartitionNexus exten
     /**
      * {@inheritDoc}
      */
+    @Override
     public EntryFilteringCursor search( SearchOperationContext searchContext ) throws LdapException
     {
-        Dn base = searchContext.getDn();
+        Dn baseDn = searchContext.getDn();
 
         // TODO since we're handling the *, and + in the EntryFilteringCursor
         // we may not need this code: we need see if this is actually the
         // case and remove this code.
-        if ( base.size() == 0 )
+        if ( baseDn.size() == 0 )
         {
             return searchFromRoot( searchContext );
         }
 
         // Not sure we need this code...
-        base.apply( schemaManager );
+        if ( !baseDn.isSchemaAware() )
+        {
+            baseDn = new Dn( schemaManager, baseDn );
+        }
 
         // Normal case : do a search on the specific partition
-        Partition backend = getPartition( base );
+        Partition backend = getPartition( baseDn );
 
         return backend.search( searchContext );
     }
@@ -689,7 +691,7 @@ public class DefaultPartitionNexus exten
         {
             // Loop on all the partitions
             // We will look into all the partitions, thus we create a list of cursors. 
-            List<EntryFilteringCursor> cursors = new ArrayList<EntryFilteringCursor>();
+            List<EntryFilteringCursor> cursors = new ArrayList<>();
 
             for ( Partition partition : partitions.values() )
             {
@@ -712,7 +714,7 @@ public class DefaultPartitionNexus exten
         {
             // This is a SUBLEVEL search. We will do multiple searches and wrap
             // a CursorList into the EntryFilteringCursor
-            List<EntryFilteringCursor> cursors = new ArrayList<EntryFilteringCursor>();
+            List<EntryFilteringCursor> cursors = new ArrayList<>();
 
             for ( Partition partition : partitions.values() )
             {
@@ -741,7 +743,7 @@ public class DefaultPartitionNexus exten
             }
 
             // don't feed the above Cursors' list to a BaseEntryFilteringCursor it is skipping the naming context entry of each partition
-            if ( cursors.size() == 0 )
+            if ( cursors.isEmpty() )
             {
                 // No candidate, return an emtpy cursor
                 return new EntryFilteringCursorImpl( new EmptyCursor<Entry>(), searchContext,
@@ -758,6 +760,7 @@ public class DefaultPartitionNexus exten
     /**
      * {@inheritDoc}
      */
+    @Override
     public void unbind( UnbindOperationContext unbindContext ) throws LdapException
     {
         Dn unbindContextDn = unbindContext.getDn();
@@ -773,6 +776,7 @@ public class DefaultPartitionNexus exten
     /**
      * {@inheritDoc}
      */
+    @Override
     public Entry getRootDse( GetRootDseOperationContext getRootDseContext )
     {
         return rootDse.clone();
@@ -782,17 +786,17 @@ public class DefaultPartitionNexus exten
     /**
      * {@inheritDoc}
      */
-    public Value<?> getRootDseValue( AttributeType attributeType )
+    @Override
+    public Value getRootDseValue( AttributeType attributeType )
     {
-        Value<?> value = rootDse.get( attributeType ).get();
-
-        return value.clone();
+        return rootDse.get( attributeType ).get();
     }
 
 
     /**
      * {@inheritDoc}
      */
+    @Override
     public synchronized void addContextPartition( Partition partition ) throws LdapException
     {
         // Turn on default indices
@@ -840,23 +844,21 @@ public class DefaultPartitionNexus exten
     /**
      * {@inheritDoc}
      */
-    public synchronized void removeContextPartition( Dn partitionDn )
+    @Override
+    public synchronized void removeContextPartition( String partitionDn )
         throws LdapException
     {
-        // Get the Partition name. It's a Dn.
-        String key = partitionDn.getNormName();
-
         // Retrieve this partition from the aprtition's table
-        Partition partition = partitions.get( key );
+        Partition partition = partitions.get( partitionDn );
 
         if ( partition == null )
         {
-            String msg = I18n.err( I18n.ERR_34, key );
+            String msg = I18n.err( I18n.ERR_34, partitionDn );
             LOG.error( msg );
             throw new LdapNoSuchObjectException( msg );
         }
 
-        String partitionSuffix = partition.getSuffixDn().getName();
+        String partitionSuffix = partition.getSuffixDn().getNormName();
 
         // Retrieve the namingContexts from the RootDSE : the partition
         // suffix must be present in those namingContexts
@@ -864,13 +866,26 @@ public class DefaultPartitionNexus exten
 
         if ( namingContexts != null )
         {
-            if ( namingContexts.contains( partitionSuffix ) )
+            Value foundNC = null;
+            
+            for ( Value namingContext : namingContexts )
+            {
+                String normalizedNC = new Dn( schemaManager, namingContext.getValue() ).getNormName();
+                
+                if ( partitionSuffix.equals( normalizedNC ) )
+                {
+                    foundNC = namingContext;
+                    break;
+                }
+            }
+            
+            if ( foundNC != null )
             {
-                namingContexts.remove( partitionSuffix );
+                namingContexts.remove( foundNC );
             }
             else
             {
-                String msg = I18n.err( I18n.ERR_35, key );
+                String msg = I18n.err( I18n.ERR_35, partitionDn );
                 LOG.error( msg );
                 throw new LdapNoSuchObjectException( msg );
             }
@@ -882,7 +897,7 @@ public class DefaultPartitionNexus exten
             partitionLookupTree.remove( partition.getSuffixDn() );
         }
 
-        partitions.remove( key );
+        partitions.remove( partitionDn );
 
         try
         {
@@ -898,13 +913,14 @@ public class DefaultPartitionNexus exten
     /**
      * {@inheritDoc}
      */
+    @Override
     public Partition getPartition( Dn dn ) throws LdapException
     {
-        Partition parent = null;
+        Partition parent;
 
         if ( !dn.isSchemaAware() )
         {
-            dn.apply( schemaManager );
+            dn = new Dn( schemaManager, dn );
         }
 
         synchronized ( partitionLookupTree )
@@ -926,6 +942,7 @@ public class DefaultPartitionNexus exten
     /**
      * {@inheritDoc}
      */
+    @Override
     public Dn getSuffixDn( Dn dn ) throws LdapException
     {
         Partition partition = getPartition( dn );
@@ -936,6 +953,7 @@ public class DefaultPartitionNexus exten
 
     /* (non-Javadoc)
      */
+    @Override
     public Set<String> listSuffixes() throws LdapException
     {
         return Collections.unmodifiableSet( partitions.keySet() );
@@ -945,6 +963,7 @@ public class DefaultPartitionNexus exten
     /**
      * {@inheritDoc}
      */
+    @Override
     public void registerSupportedExtensions( Set<String> extensionOids ) throws LdapException
     {
         Attribute supportedExtension = rootDse.get( SchemaConstants.SUPPORTED_EXTENSION_AT );
@@ -965,9 +984,10 @@ public class DefaultPartitionNexus exten
     /**
      * {@inheritDoc}
      */
+    @Override
     public void registerSupportedSaslMechanisms( Set<String> supportedSaslMechanisms ) throws LdapException
     {
-        Attribute supportedSaslMechanismsAt = null;
+        Attribute supportedSaslMechanismsAt;
 
         supportedSaslMechanismsAt = new DefaultAttribute(
             schemaManager.lookupAttributeTypeRegistry( SchemaConstants.SUPPORTED_SASL_MECHANISMS_AT ) );
@@ -1066,6 +1086,7 @@ public class DefaultPartitionNexus exten
      * @return The Subordinate instance that contains the values.
      * @throws LdapException If we had an issue while processing the request
      */
+    @Override
     public Subordinates getSubordinates( Entry entry ) throws LdapException
     {
         return new Subordinates();

Modified: directory/apacheds/branches/apacheds-value/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/branches/apacheds-value/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Wed Jun 15 12:29:57 2016
@@ -31,7 +31,6 @@ import java.nio.channels.FileLock;
 import java.nio.channels.OverlappingFileLockException;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
@@ -527,7 +526,7 @@ public class DefaultDirectoryService imp
         for ( Method method : methods )
         {
             Class<?>[] param = method.getParameterTypes();
-            boolean hasCorrestSig = false;
+            boolean hasCorrestSig;
 
             // check for the correct signature
             if ( ( param == null ) || ( param.length > 1 ) || ( param.length == 0 ) )
@@ -660,7 +659,7 @@ public class DefaultDirectoryService imp
      */
     public void setInterceptors( List<Interceptor> interceptors )
     {
-        Map<String, Interceptor> interceptorNames = new HashMap<String, Interceptor>();
+        Map<String, Interceptor> interceptorNames = new ConcurrentHashMap<>();
 
         // Check if we don't have duplicate names in the interceptors list
         for ( Interceptor interceptor : interceptors )
@@ -910,7 +909,7 @@ public class DefaultDirectoryService imp
             // can be null when called before starting up
             if ( partitionNexus != null )
             {
-                partitionNexus.removeContextPartition( partition.getSuffixDn() );
+                partitionNexus.removeContextPartition( partition.getSuffixDn().getNormName() );
             }
         }
         catch ( LdapException le )
@@ -995,7 +994,16 @@ public class DefaultDirectoryService imp
 
         BindOperationContext bindContext = new BindOperationContext( null );
         bindContext.setCredentials( credentials );
-        bindContext.setDn( principalDn.apply( schemaManager ) );
+        
+        if ( principalDn.isSchemaAware() )
+        {
+            bindContext.setDn( principalDn );
+        }
+        else
+        {
+            bindContext.setDn( new Dn( schemaManager, principalDn ) );
+        }
+        
         bindContext.setInterceptors( getInterceptors( OperationEnum.BIND ) );
 
         operationManager.bind( bindContext );
@@ -1021,7 +1029,16 @@ public class DefaultDirectoryService imp
 
         BindOperationContext bindContext = new BindOperationContext( null );
         bindContext.setCredentials( credentials );
-        bindContext.setDn( principalDn.apply( schemaManager ) );
+
+        if ( principalDn.isSchemaAware() )
+        {
+            bindContext.setDn( principalDn );
+        }
+        else
+        {
+            bindContext.setDn( new Dn( schemaManager, principalDn ) );
+        }
+
         bindContext.setSaslMechanism( saslMechanism );
         bindContext.setInterceptors( getInterceptors( OperationEnum.BIND ) );
 
@@ -1097,7 +1114,7 @@ public class DefaultDirectoryService imp
             }
             else
             {
-                adminSession.moveAndRename( oldDn, target, new Rdn( newRdn ), delOldRdn );
+                adminSession.moveAndRename( oldDn, target, newRdn, delOldRdn );
             }
         }
     }
@@ -1678,12 +1695,12 @@ public class DefaultDirectoryService imp
     protected void showSecurityWarnings() throws Exception
     {
         // Warn if the default password is not changed.
-        boolean needToChangeAdminPassword = false;
+        boolean needToChangeAdminPassword;
 
         Dn adminDn = getDnFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN );
 
         Entry adminEntry = partitionNexus.lookup( new LookupOperationContext( adminSession, adminDn ) );
-        Value<?> userPassword = adminEntry.get( SchemaConstants.USER_PASSWORD_AT ).get();
+        Value userPassword = adminEntry.get( SchemaConstants.USER_PASSWORD_AT ).get();
         needToChangeAdminPassword = Arrays.equals( PartitionNexus.ADMIN_PASSWORD_BYTES, userPassword.getBytes() );
 
         if ( needToChangeAdminPassword )
@@ -1802,7 +1819,11 @@ public class DefaultDirectoryService imp
         schemaPartition.initialize();
         partitions.add( schemaPartition );
         systemPartition.setCacheService( cacheService );
-        systemPartition.getSuffixDn().apply( schemaManager );
+        
+        if ( !systemPartition.getSuffixDn().isSchemaAware() )
+        {
+            systemPartition.setSuffixDn( new Dn( schemaManager, systemPartition.getSuffixDn() ) );
+        }
 
         adminDn = getDnFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN );
         adminSession = new DefaultCoreSession( new LdapPrincipal( schemaManager, adminDn, AuthenticationLevel.STRONG ),
@@ -1944,8 +1965,7 @@ public class DefaultDirectoryService imp
             entry.setDn( newDn );
 
             // TODO Let's get rid of this Attributes crap
-            Entry serverEntry = new DefaultEntry( schemaManager, entry );
-            return serverEntry;
+            return new DefaultEntry( schemaManager, entry );
         }
         catch ( Exception e )
         {
@@ -2016,16 +2036,16 @@ public class DefaultDirectoryService imp
      */
     public Interceptor getInterceptor( String interceptorName )
     {
-        readLock.lock();
+        //readLock.lock();
 
-        try
-        {
+        //try
+        //{
             return interceptorNames.get( interceptorName );
-        }
-        finally
-        {
-            readLock.unlock();
-        }
+        //}
+        //finally
+        //{
+            //readLock.unlock();
+        //}
     }
 
 

Modified: directory/apacheds/branches/apacheds-value/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java (original)
+++ directory/apacheds/branches/apacheds-value/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java Wed Jun 15 12:29:57 2016
@@ -41,6 +41,7 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.message.ResultCodeEnum;
 import org.apache.directory.api.ldap.model.message.SearchScope;
 import org.apache.directory.api.ldap.model.name.Dn;
+import org.apache.directory.api.ldap.model.name.Rdn;
 import org.apache.directory.api.ldap.model.url.LdapUrl;
 import org.apache.directory.server.core.api.CoreSession;
 import org.apache.directory.server.core.api.DirectoryService;
@@ -219,10 +220,10 @@ public class DefaultOperationManager imp
         try
         {
             // manage each Referral, building the correct URL for each of them
-            for ( Value<?> url : refs )
+            for ( Value url : refs )
             {
                 // we have to replace the parent by the referral
-                LdapUrl ldapUrl = new LdapUrl( url.getString() );
+                LdapUrl ldapUrl = new LdapUrl( url.getValue() );
 
                 // We have a problem with the Dn : we can't use the UpName,
                 // as we may have some spaces around the ',' and '+'.
@@ -259,12 +260,12 @@ public class DefaultOperationManager imp
         List<String> urls = new ArrayList<String>();
 
         // manage each Referral, building the correct URL for each of them
-        for ( Value<?> url : refs )
+        for ( Value url : refs )
         {
             // we have to replace the parent by the referral
             try
             {
-                LdapUrl ldapUrl = new LdapUrl( url.getString() );
+                LdapUrl ldapUrl = new LdapUrl( url.getValue() );
 
                 StringBuilder urlString = new StringBuilder();
 
@@ -309,7 +310,7 @@ public class DefaultOperationManager imp
             catch ( LdapURLEncodingException luee )
             {
                 // The URL is not correct, returns it as is
-                urls.add( url.getString() );
+                urls.add( url.getValue() );
             }
         }
 
@@ -355,7 +356,12 @@ public class DefaultOperationManager imp
 
         // Normalize the addContext Dn
         Dn dn = addContext.getDn();
-        dn.apply( directoryService.getSchemaManager() );
+        
+        if ( !dn.isSchemaAware() )
+        {
+            dn = new Dn( directoryService.getSchemaManager(), dn );
+            addContext.setDn( dn );
+        }
 
         // We have to deal with the referral first
         directoryService.getReferralManager().lockRead();
@@ -435,6 +441,15 @@ public class DefaultOperationManager imp
         // Call the Delete method
         Interceptor head = directoryService.getInterceptor( bindContext.getNextInterceptor() );
 
+        // Normalize the addContext Dn
+        Dn dn = bindContext.getDn();
+        
+        if ( !dn.isSchemaAware() )
+        {
+            dn = new Dn( directoryService.getSchemaManager(), dn );
+            bindContext.setDn( dn );
+        }
+
         lockRead();
 
         try
@@ -476,9 +491,15 @@ public class DefaultOperationManager imp
         }
 
         ensureStarted();
+        
         // Normalize the compareContext Dn
         Dn dn = compareContext.getDn();
-        dn.apply( directoryService.getSchemaManager() );
+
+        if ( !dn.isSchemaAware() )
+        {
+            dn = new Dn( directoryService.getSchemaManager(), dn );
+            compareContext.setDn( dn );
+        }
 
         // We have to deal with the referral first
         directoryService.getReferralManager().lockRead();
@@ -581,7 +602,12 @@ public class DefaultOperationManager imp
 
         // Normalize the deleteContext Dn
         Dn dn = deleteContext.getDn();
-        dn.apply( directoryService.getSchemaManager() );
+
+        if ( !dn.isSchemaAware() )
+        {
+            dn = new Dn( directoryService.getSchemaManager(), dn );
+            deleteContext.setDn( dn );
+        }
 
         // We have to deal with the referral first
         directoryService.getReferralManager().lockRead();
@@ -722,6 +748,15 @@ public class DefaultOperationManager imp
 
         lockRead();
 
+        // Normalize the addContext Dn
+        Dn dn = hasEntryContext.getDn();
+        
+        if ( !dn.isSchemaAware() )
+        {
+            dn = new Dn( directoryService.getSchemaManager(), dn );
+            hasEntryContext.setDn( dn );
+        }
+
         try
         {
             result = head.hasEntry( hasEntryContext );
@@ -768,6 +803,15 @@ public class DefaultOperationManager imp
 
         Entry entry = null;
 
+        // Normalize the modifyContext Dn
+        Dn dn = lookupContext.getDn();
+
+        if ( !dn.isSchemaAware() )
+        {
+            dn = new Dn( directoryService.getSchemaManager(), dn );
+            lookupContext.setDn( dn );
+        }
+
         lockRead();
 
         try
@@ -814,7 +858,12 @@ public class DefaultOperationManager imp
 
         // Normalize the modifyContext Dn
         Dn dn = modifyContext.getDn();
-        dn.apply( directoryService.getSchemaManager() );
+
+        if ( !dn.isSchemaAware() )
+        {
+            dn = new Dn( directoryService.getSchemaManager(), dn );
+            modifyContext.setDn( dn );
+        }
 
         ReferralManager referralManager = directoryService.getReferralManager();
 
@@ -923,11 +972,21 @@ public class DefaultOperationManager imp
 
         // Normalize the moveContext Dn
         Dn dn = moveContext.getDn();
-        dn.apply( directoryService.getSchemaManager() );
+
+        if ( !dn.isSchemaAware() )
+        {
+            dn = new Dn( directoryService.getSchemaManager(), dn );
+            moveContext.setDn( dn );
+        }
 
         // Normalize the moveContext superior Dn
         Dn newSuperiorDn = moveContext.getNewSuperior();
-        newSuperiorDn.apply( directoryService.getSchemaManager() );
+
+        if ( !newSuperiorDn.isSchemaAware() )
+        {
+            newSuperiorDn = new Dn( directoryService.getSchemaManager(), newSuperiorDn );
+            moveContext.setNewSuperior( newSuperiorDn );
+        }
 
         // We have to deal with the referral first
         directoryService.getReferralManager().lockRead();
@@ -1042,7 +1101,12 @@ public class DefaultOperationManager imp
 
         // Normalize the moveAndRenameContext Dn
         Dn dn = moveAndRenameContext.getDn();
-        dn.apply( directoryService.getSchemaManager() );
+
+        if ( !dn.isSchemaAware() )
+        {
+            dn = new Dn( directoryService.getSchemaManager(), dn );
+            moveAndRenameContext.setDn( dn );
+        }
 
         // We have to deal with the referral first
         directoryService.getReferralManager().lockRead();
@@ -1090,7 +1154,12 @@ public class DefaultOperationManager imp
             // Now, check the destination
             // Normalize the moveAndRenameContext Dn
             Dn newSuperiorDn = moveAndRenameContext.getNewSuperiorDn();
-            newSuperiorDn.apply( directoryService.getSchemaManager() );
+
+            if ( !newSuperiorDn.isSchemaAware() )
+            {
+                newSuperiorDn = new Dn( directoryService.getSchemaManager(), newSuperiorDn );
+                moveAndRenameContext.setNewSuperiorDn( newSuperiorDn );
+            }
 
             // If he parent Dn is a referral, or has a referral ancestor, we have to issue a AffectMultipleDsas result
             // as stated by RFC 3296 Section 5.6.2
@@ -1161,13 +1230,26 @@ public class DefaultOperationManager imp
 
         // Normalize the renameContext Dn
         Dn dn = renameContext.getDn();
-        dn.apply( directoryService.getSchemaManager() );
+
+        if ( !dn.isSchemaAware() )
+        {
+            dn = new Dn( directoryService.getSchemaManager(), dn );
+            renameContext.setDn( dn );
+        }
 
         // Inject the newDn into the operation context
         // Inject the new Dn into the context
         if ( !dn.isEmpty() )
         {
             Dn newDn = dn.getParent();
+            Rdn newRdn = renameContext.getNewRdn();
+            
+            if ( !newRdn.isSchemaAware() )
+            {
+                newRdn = new Rdn( directoryService.getSchemaManager(), newRdn );
+                renameContext.setNewRdn( newRdn );
+            }
+            
             newDn = newDn.add( renameContext.getNewRdn() );
             renameContext.setNewDn( newDn );
         }
@@ -1277,7 +1359,11 @@ public class DefaultOperationManager imp
         // Normalize the searchContext Dn
         Dn dn = searchContext.getDn();
 
-        dn.apply( directoryService.getSchemaManager() );
+        if ( !dn.isSchemaAware() )
+        {
+            dn = new Dn( directoryService.getSchemaManager(), dn );
+            searchContext.setDn( dn );
+        }
 
         // We have to deal with the referral first
         directoryService.getReferralManager().lockRead();

Modified: directory/apacheds/branches/apacheds-value/http-integration/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/http-integration/pom.xml?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/http-integration/pom.xml (original)
+++ directory/apacheds/branches/apacheds-value/http-integration/pom.xml Wed Jun 15 12:29:57 2016
@@ -74,19 +74,8 @@
     </dependency>
  
     <dependency>
-      <groupId>org.mortbay.jetty</groupId>
-      <artifactId>jetty</artifactId>
-    </dependency>
-    
-    <dependency>
-      <groupId>org.mortbay.jetty</groupId>
-      <artifactId>servlet-api-2.5</artifactId>
-      <version>6.1.14</version>
-    </dependency>
-    
-    <dependency>
-      <groupId>org.mortbay.jetty</groupId>
-      <artifactId>jetty-util</artifactId>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-webapp</artifactId>
     </dependency>
   </dependencies>
   

Modified: directory/apacheds/branches/apacheds-value/i18n/src/main/java/org/apache/directory/server/i18n/I18n.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/i18n/src/main/java/org/apache/directory/server/i18n/I18n.java?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/i18n/src/main/java/org/apache/directory/server/i18n/I18n.java (original)
+++ directory/apacheds/branches/apacheds-value/i18n/src/main/java/org/apache/directory/server/i18n/I18n.java Wed Jun 15 12:29:57 2016
@@ -829,7 +829,7 @@ public enum I18n
         }
         catch ( Exception e )
         {
-            StringBuffer sb = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
             boolean comma = false;
 
             for ( Object obj : args )
@@ -873,7 +873,7 @@ public enum I18n
             }
             catch ( Exception e )
             {
-                StringBuffer sb = new StringBuffer();
+                StringBuilder sb = new StringBuilder();
                 boolean comma = false;
 
                 for ( Object obj : args )

Modified: directory/apacheds/branches/apacheds-value/installers-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/installers-maven-plugin/pom.xml?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/installers-maven-plugin/pom.xml (original)
+++ directory/apacheds/branches/apacheds-value/installers-maven-plugin/pom.xml Wed Jun 15 12:29:57 2016
@@ -1,167 +0,0 @@
-<?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>
-  <parent>
-    <groupId>org.apache.directory.server</groupId>
-    <artifactId>apacheds-parent</artifactId>
-    <version>2.0.0-M22-SNAPSHOT</version>
-  </parent>
-  
-  <artifactId>apacheds-installers-maven-plugin</artifactId>
-  <name>ApacheDS Installers Maven Plugin</name>
-  <packaging>maven-plugin</packaging>
-
-  <description>A plugin that builds ApacheDS installers</description>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-plugin-api</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-project</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-utils</artifactId>
-    </dependency>
-    
-    <dependency>
-      <groupId>org.apache.ant</groupId>
-      <artifactId>ant</artifactId>
-    </dependency>
-    
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>apacheds-service</artifactId>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <pluginManagement>
-      <plugins>
-        <plugin>
-          <groupId>org.apache.rat</groupId>
-          <artifactId>apache-rat-plugin</artifactId>
-          <configuration>
-            <excludeSubProjects>false</excludeSubProjects>
-            <excludes>
-              <!-- MAVEN_DEFAULT_EXCLUDES -->
-              <exclude>**/target/**/*</exclude>
-              <exclude>**/cobertura.ser</exclude>
-              <!-- ECLIPSE_DEFAULT_EXCLUDES -->
-              <exclude>**/.classpath</exclude>
-              <exclude>**/.project</exclude>
-              <exclude>**/.settings/**/*</exclude>
-              <!-- IDEA_DEFAULT_EXCLUDES -->
-              <exclude>**/*.iml</exclude>
-              <exclude>**/*.ipr</exclude>
-              <exclude>**/*.iws</exclude>
-              <!-- MANIFEST_MF_EXCLUDES -->
-              <exclude>**/MANIFEST.MF</exclude>
-              <!-- Missing license header in dependency reduced pom, see http://jira.codehaus.org/browse/MSHADE-48 -->
-              <exclude>**/dependency-reduced-pom.xml</exclude>
-              <!-- LDIF_FILES_EXCLUDES -->
-              <exclude>**/*.ldif</exclude>
-              <!-- INSTALLERS_FILES_EXCLUDES -->
-              <exclude>src/main/resources/org/apache/directory/server/installers/deb/control</exclude>
-              <exclude>src/main/resources/org/apache/directory/server/installers/macosxpkg/License.rtf</exclude>
-              <exclude>src/main/resources/org/apache/directory/server/installers/solarispkg/pkginfo</exclude>
-              <exclude>src/main/resources/org/apache/directory/server/installers/solarispkg/Prototype</exclude>
-              <!-- BMP_IMAGES_EXCLUDES -->
-              <exclude>**/*.bmp</exclude>
-            </excludes>
-          </configuration>
-         </plugin>
-        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
-        <plugin>
-          <groupId>org.eclipse.m2e</groupId>
-          <artifactId>lifecycle-mapping</artifactId>
-          <version>1.0.0</version>
-          <configuration>
-            <lifecycleMappingMetadata>
-              <pluginExecutions>
-                <pluginExecution>
-                  <pluginExecutionFilter>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-plugin-plugin</artifactId>
-                    <versionRange>[3.4,)</versionRange>
-                    <goals>
-                      <goal>descriptor</goal>
-                    </goals>
-                  </pluginExecutionFilter>
-                  <action>
-                    <ignore />
-                  </action>
-                </pluginExecution>
-              </pluginExecutions>
-            </lifecycleMappingMetadata>
-          </configuration>
-        </plugin>
-      </plugins>
-    </pluginManagement>
-    
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-dependency-plugin</artifactId>
-        <executions>
-          <!-- Unpacks the config file to 'src/main/resources/[...]' -->
-          <execution>
-            <id>unpack-config-file</id>
-            <phase>generate-resources</phase>
-            <goals>
-              <goal>unpack</goal>
-            </goals>
-            <configuration>
-              <artifactItems>
-                <artifactItem>
-                  <groupId>${project.groupId}</groupId>
-                  <artifactId>apacheds-server-config</artifactId>
-                  <version>${project.version}</version>
-                </artifactItem>
-              </artifactItems>
-              <includes>config.ldif</includes>
-              <outputDirectory>src/main/resources/org/apache/directory/server/installers</outputDirectory>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-site-plugin</artifactId>
-        <configuration>
-          <reportPlugins combine.children="append">
-            <plugin>
-              <artifactId>maven-plugin-plugin</artifactId>
-             </plugin>
-          </reportPlugins>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-</project>

Modified: directory/apacheds/branches/apacheds-value/installers-maven-plugin/src/checkstyle/suppressions.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/installers-maven-plugin/src/checkstyle/suppressions.xml?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/installers-maven-plugin/src/checkstyle/suppressions.xml (original)
+++ directory/apacheds/branches/apacheds-value/installers-maven-plugin/src/checkstyle/suppressions.xml Wed Jun 15 12:29:57 2016
@@ -1,28 +0,0 @@
-<?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.
--->
-
-<!DOCTYPE suppressions PUBLIC
-    "-//Puppy Crawl//DTD Suppressions 1.1//EN"
-    "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
-
-<suppressions>
-    <suppress files="org.apache.directory.server.installers.Target" checks="MethodName"/>
-</suppressions>

Modified: directory/apacheds/branches/apacheds-value/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/AbstractMojoCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/AbstractMojoCommand.java?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/AbstractMojoCommand.java (original)
+++ directory/apacheds/branches/apacheds-value/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/AbstractMojoCommand.java Wed Jun 15 12:29:57 2016
@@ -1,374 +0,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. 
- *  
- */
-package org.apache.directory.server.installers;
-
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Properties;
-
-import org.apache.directory.server.InstallationLayout;
-import org.apache.directory.server.core.api.InstanceLayout;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugin.logging.Log;
-
-
-/**
- * A Mojo command pattern abstract class.
- * 
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- */
-public abstract class AbstractMojoCommand<T extends Target>
-{
-    /** The filter properties */
-    protected Properties filterProperties = new Properties( System.getProperties() );
-
-    /** The associated mojo */
-    protected GenerateMojo mojo;
-
-    /** The associated target */
-    protected T target;
-
-    /** The logger */
-    protected Log log;
-
-    /** The log4j.properties file name */
-    protected static final String LOG4J_PROPERTIES_FILE = "log4j.properties";
-
-    /** The config.ldif file */
-    protected static final String CONFIG_LDIF_FILE = "config.ldif";
-
-    /** The wrapper-instance.conf file */
-    protected static final String WRAPPER_INSTANCE_CONF_FILE = "wrapper-instance.conf";
-
-    /** The 'default' name */
-    protected static final String DEFAULT = "default";
-
-    /** The instances directory */
-    protected static final String INSTANCES = "instances";
-
-    /** The instances default directory */
-    protected static final String INSTANCE_DEFAULT_DIR = INSTANCES + "/" + DEFAULT;
-
-    /** The 'apacheds' name */
-    protected static final String APACHEDS = "apacheds";
-
-    /** The apacheds- prefix */
-    protected static final String APACHEDS_DASH = APACHEDS + "-";
-
-    /** The chmod command */
-    protected static final String CHMOD = "chmod";
-
-    /** The rights for a command */
-    protected static final String RWX_RX_RX = "755";
-
-    /** The os.name property key */
-    protected static final String OS_NAME = "os.name";
-
-    /** The local path where the installers are created */
-    protected static final String INSTALLERS_PATH = "/org/apache/directory/server/installers/";
-
-    /** The commented wrapper java command */
-    protected static final String WRAPPER_JAVA_COMMAND = "# wrapper.java.command=<path-to-java-executable>";
-
-    /** The property keys we are using */
-    protected static final String ARCH_PROP = "arch";
-    protected static final String INSTALLATION_DIRECTORY_PROP = "installation.directory";
-    protected static final String INSTANCES_DIRECTORY_PROP = "instances.directory";
-    protected static final String DOUBLE_QUOTE_PROP = "double.quote";
-    protected static final String USER_PROP = "user";
-    protected static final String GROUP_PROP = "group";
-    protected static final String WRAPPER_JAVA_COMMAND_PROP = "wrapper.java.command";
-    protected static final String FINAL_NAME_PROP = "finalName";
-    protected static final String VERSION_PROP = "version";
-
-
-    /**
-     * Creates a new instance of AbstractMojoCommand.
-     *
-     * @param mojo the associated mojo
-     * @param target the associated target
-     */
-    public AbstractMojoCommand( GenerateMojo mojo, T target )
-    {
-        this.mojo = mojo;
-        this.target = target;
-
-        log = mojo.getLog();
-
-        /*
-        this.initializeFilterProperties();
-
-        Properties properties = mojo.getProject().getProperties();
-
-        for ( Object key : properties.keySet() )
-        {
-            log.info( "Using property [" + key + ", " + properties.getProperty( ( String ) key ) + "]" );
-        }
-        */
-    }
-
-
-    /**
-     * Executes the command.
-     *
-     * @throws MojoExecutionException
-     * @throws MojoFailureException
-     */
-    public abstract void execute() throws MojoExecutionException, MojoFailureException;
-
-
-    /**
-     * Gets the filter properties.
-     *
-     * @return the filter properties
-     */
-    public Properties getFilterProperties()
-    {
-        return filterProperties;
-    }
-
-
-    /**
-     * Initializes filter properties.
-     */
-    protected void initializeFilterProperties()
-    {
-        filterProperties.putAll( mojo.getProject().getProperties() );
-    }
-
-
-    /**
-     * Gets the installation directory file.
-     *
-     * @return the installation directory file
-     */
-    public abstract File getInstallationDirectory();
-
-
-    /**
-     * Get the instance directory file.
-     *
-     * @return the instance directory file
-     */
-    public abstract File getInstanceDirectory();
-
-
-    /**
-     * Gets the directory associated with the target.
-     *
-     * @return the directory associated with the target
-     */
-    protected File getTargetDirectory()
-    {
-        return new File( mojo.getOutputDirectory(), target.getId() );
-    }
-
-
-    /**
-     * Creates both installation and instance layouts.
-     * 
-     * @throws MojoFailureException
-     * @throws IOException
-     */
-    public void createLayouts() throws MojoFailureException, IOException
-    {
-        createLayouts( true );
-    }
-
-
-    /**
-     * Creates both installation and instance layouts.
-     *
-     * @param includeWrapperDependencies
-     *      <code>true</code> if wrapper dependencies are included,
-     *      <code>false</code> if wrapper dependencies are excluded
-     *      
-     * @throws MojoFailureException
-     * @throws IOException
-     */
-    public void createLayouts( boolean includeWrapperDependencies ) throws MojoFailureException, IOException
-    {
-        log.info( "Creating the installation layout" );
-        createInstallationLayout( includeWrapperDependencies );
-
-        log.info( "Creating the instance layout" );
-        createInstanceLayout();
-    }
-
-
-    /**
-     * Creates the installation layout.
-     *      
-     * @throws MojoFailureException
-     * @throws IOException
-     */
-    protected void createInstallationLayout() throws MojoFailureException,
-        IOException
-    {
-        createInstallationLayout( true );
-    }
-
-
-    /**
-     * Creates the installation layout.
-     *
-     * @param includeWrapperDependencies
-     *      <code>true</code> if wrapper dependencies are included,
-     *      <code>false</code> if wrapper dependencies are excluded
-     *      
-     * @throws MojoFailureException
-     * @throws IOException
-     */
-    protected void createInstallationLayout( boolean includeWrapperDependencies ) throws MojoFailureException,
-        IOException
-    {
-        // Getting the installation layout and creating directories
-        InstallationLayout installationLayout = getInstallationLayout();
-
-        /*
-        log.info( "Create installation layout directories : " );
-
-        for ( File file : installationLayout.getRequiredDirectories() )
-        {
-            log.info( "    File " + file.getAbsolutePath() );
-        }
-
-        log.info( "Filter properties : " );
-
-        Properties properties = filterProperties;
-
-        for ( Object key : properties.keySet() )
-        {
-            log.info( "    property : [ " + key + ", '" + properties.get( ( String ) key ) + "']" );
-        }
-        */
-
-        // Create the installation layout directories
-        installationLayout.mkdirs();
-
-        // Copying dependencies artifacts to the lib folder of the installation layout
-        MojoHelperUtils.copyDependencies( mojo, installationLayout, includeWrapperDependencies );
-
-        // Copying the LICENSE and NOTICE files
-        MojoHelperUtils.copyBinaryFile( mojo, INSTALLERS_PATH + "LICENSE",
-            getClass().getResourceAsStream( INSTALLERS_PATH + "LICENSE" ),
-            new File( installationLayout.getInstallationDirectory(), "LICENSE" ) );
-        MojoHelperUtils.copyBinaryFile( mojo, INSTALLERS_PATH + "NOTICE",
-            getClass().getResourceAsStream( INSTALLERS_PATH + "NOTICE" ),
-            new File( installationLayout.getInstallationDirectory(), "NOTICE" ) );
-
-        // Copying the 'apacheds' shell script (only for Linux, Solaris or Mac OS X)
-        if ( target.isOsNameLinux() || target.isOsNameSolaris() || target.isOsNameMacOSX() )
-        {
-            MojoHelperUtils.copyAsciiFile( mojo, filterProperties, INSTALLERS_PATH + APACHEDS,
-                getClass().getResourceAsStream( INSTALLERS_PATH + APACHEDS ),
-                new File( installationLayout.getBinDirectory(), APACHEDS ), true );
-
-            MojoHelperUtils.exec( new String[]
-                { CHMOD, RWX_RX_RX, APACHEDS }, installationLayout.getBinDirectory(), false );
-        }
-
-        // Copying the wrappers files (native wrapper executable and library [.jnilib, .so, .dll])
-        copyWrapperFiles( mojo );
-
-        // Copying the wrapper configuration file
-        MojoHelperUtils.copyAsciiFile( mojo, filterProperties,
-            INSTALLERS_PATH + "wrapper-installation.conf",
-            getClass().getResourceAsStream( INSTALLERS_PATH + "wrapper-installation.conf" ),
-            new File( installationLayout.getConfDirectory(), "wrapper.conf" ), true );
-
-    }
-
-
-    public abstract void copyWrapperFiles( GenerateMojo mojo ) throws MojoFailureException;
-
-
-    /**
-     * Creates the instance layout.
-     *
-     * @throws IOException
-     */
-    protected void createInstanceLayout() throws IOException
-    {
-        // Getting the instance layout and creating directories
-        InstanceLayout instanceLayout = getInstanceLayout();
-
-        /*
-        log.info( "Create instance layout directories : " );
-
-        for ( File file : instanceLayout.getRequiredDirectories() )
-        {
-            log.info( "    File " + file.getAbsolutePath() );
-        }
-
-        log.info( "Filter properties : " );
-
-        Properties properties = filterProperties;
-
-        for ( Object key : properties.keySet() )
-        {
-            log.info( "    property : [ " + key + "," + properties.get( ( String ) key ) + "]" );
-        }
-        */
-
-        instanceLayout.mkdirs();
-
-        // Copying the log4j.properties file
-        MojoHelperUtils.copyAsciiFile( mojo, filterProperties, INSTALLERS_PATH + LOG4J_PROPERTIES_FILE,
-            getClass().getResourceAsStream( INSTALLERS_PATH + LOG4J_PROPERTIES_FILE ),
-            new File( instanceLayout.getConfDirectory(), LOG4J_PROPERTIES_FILE ), true );
-
-        // Copying the wrapper configuration file
-        MojoHelperUtils.copyAsciiFile( mojo, filterProperties, INSTALLERS_PATH + WRAPPER_INSTANCE_CONF_FILE,
-            getClass().getResourceAsStream( INSTALLERS_PATH + WRAPPER_INSTANCE_CONF_FILE ),
-            new File( instanceLayout.getConfDirectory(), WRAPPER_INSTANCE_CONF_FILE ), true );
-
-        // Copying ApacheDS LDIF configuration file
-        MojoHelperUtils.copyAsciiFile( mojo, filterProperties, INSTALLERS_PATH + CONFIG_LDIF_FILE,
-            getClass().getResourceAsStream( INSTALLERS_PATH + CONFIG_LDIF_FILE ),
-            new File( instanceLayout.getConfDirectory(), CONFIG_LDIF_FILE ), false );
-    }
-
-
-    /**
-     * Gets the installation layout.
-     *
-     * @return the installation layout
-     */
-    protected InstallationLayout getInstallationLayout()
-    {
-        return new InstallationLayout( getInstallationDirectory() );
-    }
-
-
-    /**
-     * Gets the instance layout.
-     *
-     * @return the instance layout
-     */
-    protected InstanceLayout getInstanceLayout()
-    {
-        File instanceDirectory = getInstanceDirectory();
-
-        return new InstanceLayout( instanceDirectory );
-    }
-}

Modified: directory/apacheds/branches/apacheds-value/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/GenerateMojo.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/GenerateMojo.java?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/GenerateMojo.java (original)
+++ directory/apacheds/branches/apacheds-value/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/GenerateMojo.java Wed Jun 15 12:29:57 2016
@@ -1,355 +0,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. 
- *  
- */
-package org.apache.directory.server.installers;
-
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.directory.server.installers.archive.ArchiveInstallerCommand;
-import org.apache.directory.server.installers.archive.ArchiveTarget;
-import org.apache.directory.server.installers.bin.BinInstallerCommand;
-import org.apache.directory.server.installers.bin.BinTarget;
-import org.apache.directory.server.installers.deb.DebInstallerCommand;
-import org.apache.directory.server.installers.deb.DebTarget;
-import org.apache.directory.server.installers.macosxpkg.MacOsXPkgInstallerCommand;
-import org.apache.directory.server.installers.macosxpkg.MacOsXPkgTarget;
-import org.apache.directory.server.installers.nsis.NsisInstallerCommand;
-import org.apache.directory.server.installers.nsis.NsisTarget;
-import org.apache.directory.server.installers.rpm.RpmInstallerCommand;
-import org.apache.directory.server.installers.rpm.RpmTarget;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.util.FileUtils;
-
-
-/**
- * Maven 2 mojo creating the platform specific installation layout images.
- * 
- * @goal generate
- * @description Creates platform specific installation layout images.
- * @phase package
- * @requiresDependencyResolution runtime
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- */
-public class GenerateMojo extends AbstractMojo
-{
-    /**
-     * The target directory into which the mojo creates os and platform 
-     * specific images.
-     * 
-     * @parameter default-value="${project.build.directory}/installers"
-     */
-    private File outputDirectory;
-
-    /**
-     * The associated maven project.
-     * 
-     * @parameter expression="${project}" default-value="${project}"
-     * @required
-     */
-    private MavenProject project;
-
-    /**
-     * The RPM installer targets.
-     * 
-     * @parameter
-     */
-    private RpmTarget[] rpmTargets;
-
-    /**
-     * The Mac OS X installer targets.
-     * 
-     * @parameter
-     */
-    private MacOsXPkgTarget[] macOsXPkgTargets;
-
-    /**
-     * The NSIS installer targets.
-     * 
-     * @parameter
-     */
-    private NsisTarget[] nsisTargets;
-
-    /**
-     * The Debian installer targets.
-     * 
-     * @parameter
-     */
-    private DebTarget[] debTargets;
-
-    /**
-     * The Binary installer targets.
-     * 
-     * @parameter
-     */
-    private BinTarget[] binTargets;
-
-    /**
-     * The Archive installers targets.
-     * 
-     * @parameter
-     */
-    private ArchiveTarget[] archiveTargets;
-
-    /**
-     * The exclusions.
-     * 
-     * @parameter
-     */
-    private Set<String> excludes;
-
-    /**
-     *  The dpkg utility executable.
-     *  
-     *  @parameter
-     *      expression="${installers.dpkg}"
-     *      default-value="/usr/bin/dpkg"
-     */
-    private File dpkgUtility;
-
-    /**
-     *  The PackageMaker utility executable.
-     *  
-     *  @parameter
-     *      expression="${installers.packageMaker}"
-     *      default-value="/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"
-     */
-    private File packageMakerUtility;
-
-    /**
-     *  The makensis utility executable.
-     *  
-     *  @parameter
-     *      expression="${installers.makensis}"
-     *      default-value="/usr/bin/makensis"
-     */
-    private File makensisUtility;
-
-    /**
-     *  The rpmbuild utility executable.
-     *  
-     *  @parameter
-     *      expression="${installers.rpmbuild}"
-     *      default-value="/usr/bin/rpmbuild"
-     */
-    private File rpmbuildUtility;
-
-    /** The list containing all the targets */
-    private List<Target> allTargets = new ArrayList<Target>();
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void execute() throws MojoExecutionException, MojoFailureException
-    {
-        // Collecting all targets 
-        collectAllTargets();
-
-        // Returning if there is no target to build 
-        if ( allTargets.isEmpty() )
-        {
-            getLog().info( "No installers to generate." );
-
-            return;
-        }
-
-        getLog().info( "-------------------------------------------------------" );
-
-        // Creating the output directory
-        getLog().info( "Creating the putput directory : " + outputDirectory.getAbsolutePath() );
-        FileUtils.mkdir( outputDirectory.getAbsolutePath() );
-
-        // Generating installers for all targets
-        for ( Target target : allTargets )
-        {
-            getLog().info( "Executing target '" + target.getId() + "'" );
-            getLog().info( "--------------------" );
-            getLog().info( "OS Name: " + target.getOsName() );
-            getLog().info( "OS Arch: " + target.getOsArch() );
-            getLog().info( "--------------------" );
-
-            // Archive target
-            if ( target instanceof ArchiveTarget )
-            {
-                ArchiveInstallerCommand archiveCmd = new ArchiveInstallerCommand( this, ( ArchiveTarget ) target );
-                archiveCmd.execute();
-            }
-
-            // Bin target
-            if ( target instanceof BinTarget )
-            {
-                BinInstallerCommand binCmd = new BinInstallerCommand( this, ( BinTarget ) target );
-                binCmd.execute();
-            }
-
-            // Deb target
-            if ( target instanceof DebTarget )
-            {
-                DebInstallerCommand debCmd = new DebInstallerCommand( this, ( DebTarget ) target );
-                debCmd.execute();
-            }
-
-            // Mac OS X PKG target
-            if ( target instanceof MacOsXPkgTarget )
-            {
-                MacOsXPkgInstallerCommand pkgCmd = new MacOsXPkgInstallerCommand( this, ( MacOsXPkgTarget ) target );
-                pkgCmd.execute();
-            }
-
-            // NSIS target
-            if ( target instanceof NsisTarget )
-            {
-                NsisInstallerCommand nsisCmd = new NsisInstallerCommand( this, ( NsisTarget ) target );
-                nsisCmd.execute();
-            }
-
-            // RPM target
-            if ( target instanceof RpmTarget )
-            {
-                RpmInstallerCommand rpmCmd = new RpmInstallerCommand( this, ( RpmTarget ) target );
-                rpmCmd.execute();
-            }
-
-            getLog().info( "-------------------------------------------------------" );
-        }
-    }
-
-
-    /**
-     * Collects all targets. A target is a plugin configuration element
-     * where we declare a tuple with the target's ID, the target
-     * name, architecture, os name and archive typelike in :
-     * <pre>
-     * &lt;nsisTargets&gt;
-     *   &lt;nsisTarget&gt;
-     *     &lt;id&gt;apacheds-win32&lt;/id&gt;
-     *     &lt;finalName&gt;apacheds-${project.version}.exe&lt;/finalName&gt;
-     *   &lt;/nsisTarget&gt;
-     * &lt;/nsisTargets&gt;
-     * </pre>
-     * We have targets for windows, RPM, Deb, macOSX, binary and archive,
-     * and we may have more than one, depending on the compression scheme (zip, 
-     * gz, bz2).
-     */
-    private void collectAllTargets()
-    {
-        addAllTargets( allTargets, nsisTargets ); // For Windows
-        addAllTargets( allTargets, rpmTargets ); // For RPM base linux
-        addAllTargets( allTargets, debTargets ); // For Debian based Linux
-        addAllTargets( allTargets, macOsXPkgTargets ); // For Mac OSX
-        addAllTargets( allTargets, binTargets ); // Pure linux 
-        addAllTargets( allTargets, archiveTargets ); // tar
-    }
-
-
-    /**
-     * Adds an array of targets to the given list.
-     *
-     * @param list the list of targets
-     * @param array an array of targets
-     */
-    private void addAllTargets( List<Target> list, Target[] array )
-    {
-        if ( ( list != null ) && ( array != null ) )
-        {
-            list.addAll( Arrays.asList( array ) );
-        }
-    }
-
-
-    /**
-     * Gets the output directory.
-     *
-     * @return the output directory
-     */
-    public File getOutputDirectory()
-    {
-        return outputDirectory;
-    }
-
-
-    /**
-     * Gets the associated Maven project.
-     *
-     * @return the associated Maven project
-     */
-    public MavenProject getProject()
-    {
-        return project;
-    }
-
-
-    /**
-     * Gets the excluded artifacts.
-     *
-     * @return the excluded artifacts
-     */
-    public Set<String> getExcludes()
-    {
-        return excludes;
-    }
-
-
-    /**
-     * Gets the dpkg utility.
-     *
-     * @return the dpkg utility
-     */
-    public File getDpkgUtility()
-    {
-        return dpkgUtility;
-    }
-
-
-    /**
-     * Gets the dpkg utility.
-     *
-     * @return the dpkg utility
-     */
-    public File getPackageMakerUtility()
-    {
-        return packageMakerUtility;
-    }
-
-
-    /**
-     * Gets the makensis utility.
-     *
-     * @return
-     *      the dpkg utility
-     */
-    public File getMakensisUtility()
-    {
-        return makensisUtility;
-    }
-
-
-    public File getRpmbuildUtility()
-    {
-        return rpmbuildUtility;
-    }
-}

Modified: directory/apacheds/branches/apacheds-value/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/LinuxInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/LinuxInstallerCommand.java?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/LinuxInstallerCommand.java (original)
+++ directory/apacheds/branches/apacheds-value/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/LinuxInstallerCommand.java Wed Jun 15 12:29:57 2016
@@ -1,105 +0,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.
- *
- */
-
-package org.apache.directory.server.installers;
-
-
-import java.io.File;
-import java.io.IOException;
-
-import org.apache.maven.plugin.MojoFailureException;
-
-
-/**
- * A Deb package for the Debian platform.
- * 
- * To create a Deb package we use the dpkg utility that is bundled in the 
- * Debian operating system.
- *
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- */
-public abstract class LinuxInstallerCommand<T extends Target> extends AbstractMojoCommand<T>
-{
-    /** Some file postfix */
-    protected static final String TAR = "tar";
-
-    /** The etc/init.d script file */
-    protected static final String ETC_INITD_SCRIPT = "etc-initd-script";
-
-    /** The /opt/apacheds- root directory */
-    protected static final String OPT_APACHEDS_DIR = "/opt/apacheds-";
-
-    /** The /var/lib/apacheds- root directory */
-    protected static final String VAR_LIB_APACHEDS_DIR = "/var/lib/apacheds-";
-
-    /** The default instance name property */
-    protected static final String DEFAULT_INSTANCE_NAME_PROP = "default.instance.name";
-
-
-    protected LinuxInstallerCommand( GenerateMojo mojo, T target )
-    {
-        super( mojo, target );
-    }
-
-
-    /**
-     * Copies wrapper files to the installation layout.
-     *
-     * @param mojo The maven plugin Mojo
-     * @throws MojoFailureException If the copy failed
-     */
-    public void copyWrapperFiles( GenerateMojo mojo ) throws MojoFailureException
-    {
-        try
-        {
-            if ( target.isOsArchI386() || target.isOsArchx86() )
-            {
-                mojo.getLog().info( "Copying wrapper files for " + target.getOsArch() );
-                MojoHelperUtils.copyBinaryFile( mojo, INSTALLERS_PATH + "wrapper/bin/wrapper-linux-x86-32",
-                    getClass().getResourceAsStream( INSTALLERS_PATH + "wrapper/bin/wrapper-linux-x86-32" ),
-                    new File( getInstallationLayout().getBinDirectory(), "wrapper" ) );
-                MojoHelperUtils.copyBinaryFile( mojo, INSTALLERS_PATH + "wrapper/lib/libwrapper-linux-x86-32.so",
-                    getClass().getResourceAsStream(
-                        INSTALLERS_PATH + "wrapper/lib/libwrapper-linux-x86-32.so" ),
-                    new File( getInstallationLayout().getLibDirectory(), "libwrapper.so" ) );
-            }
-            // Linux x86_64 & amd64
-            else if ( ( target.isOsArchX86_64() || target.isOsArchAmd64() ) )
-            {
-                mojo.getLog().info( "Copying wrapper files for " + target.getOsArch() );
-                MojoHelperUtils.copyBinaryFile( mojo, INSTALLERS_PATH + "wrapper/bin/wrapper-linux-x86-64",
-                    getClass().getResourceAsStream(
-                        INSTALLERS_PATH + "wrapper/bin/wrapper-linux-x86-64" ),
-                    new File( getInstallationLayout().getBinDirectory(), "wrapper" ) );
-                MojoHelperUtils.copyBinaryFile( mojo, INSTALLERS_PATH + "wrapper/lib/libwrapper-linux-x86-64.so",
-                    getClass().getResourceAsStream( INSTALLERS_PATH + "wrapper/lib/libwrapper-linux-x86-64.so" ),
-                    new File( getInstallationLayout().getLibDirectory(), "libwrapper.so" ) );
-            }
-            else
-            {
-                mojo.getLog().info( "No wrapper files to copy for " + target.getOsArch() );
-            }
-        }
-        catch ( IOException e )
-        {
-            throw new MojoFailureException( "Failed to copy Tanuki binary files to lib and bin directories" );
-        }
-    }
-}




Mime
View raw message