directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r414283 - in /directory/branches/apacheds/noback-experiment: protocol-ldap/src/main/java/org/apache/directory/server/ldap/ protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/ protocol-ldap/src/main/java/org/apache/directory/se...
Date Wed, 14 Jun 2006 15:08:23 GMT
Author: akarasulu
Date: Wed Jun 14 08:08:21 2006
New Revision: 414283

URL: http://svn.apache.org/viewvc?rev=414283&view=rev
Log:
removed ability to do any operations against the backend database

Removed:
    directory/branches/apacheds/noback-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/ExtendedOperationHandler.java
    directory/branches/apacheds/noback-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/
    directory/branches/apacheds/noback-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/AddHandler.java
    directory/branches/apacheds/noback-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/CompareHandler.java
    directory/branches/apacheds/noback-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/DeleteHandler.java
    directory/branches/apacheds/noback-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ExtendedHandler.java
    directory/branches/apacheds/noback-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyDnHandler.java
    directory/branches/apacheds/noback-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyHandler.java
    directory/branches/apacheds/noback-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/PersistentSearchListener.java
    directory/branches/apacheds/noback-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java
    directory/branches/apacheds/noback-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/
    directory/branches/apacheds/noback-experiment/protocol-ldap/src/test/java/org/
    directory/branches/apacheds/noback-experiment/server-ssl/src/test/java/org/apache/directory/server/ssl/LdapsTest.java
Modified:
    directory/branches/apacheds/noback-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolProvider.java
    directory/branches/apacheds/noback-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java
    directory/branches/apacheds/noback-experiment/server-installers/pom.xml
    directory/branches/apacheds/noback-experiment/server-installers/src/main/installers/server.xml
    directory/branches/apacheds/noback-experiment/server-jndi/src/main/java/org/apache/directory/server/configuration/ServerStartupConfiguration.java
    directory/branches/apacheds/noback-experiment/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java

Modified: directory/branches/apacheds/noback-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolProvider.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/noback-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolProvider.java?rev=414283&r1=414282&r2=414283&view=diff
==============================================================================
--- directory/branches/apacheds/noback-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolProvider.java (original)
+++ directory/branches/apacheds/noback-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolProvider.java Wed Jun 14 08:08:21 2006
@@ -19,70 +19,40 @@
 
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.Set;
 
 import javax.naming.Context;
 
 import org.apache.mina.filter.codec.asn1.Asn1CodecDecoder;
 import org.apache.mina.filter.codec.asn1.Asn1CodecEncoder;
 import org.apache.directory.server.ldap.support.AbandonHandler;
-import org.apache.directory.server.ldap.support.AddHandler;
 import org.apache.directory.server.ldap.support.BindHandler;
-import org.apache.directory.server.ldap.support.CompareHandler;
-import org.apache.directory.server.ldap.support.DeleteHandler;
-import org.apache.directory.server.ldap.support.ExtendedHandler;
-import org.apache.directory.server.ldap.support.ModifyDnHandler;
-import org.apache.directory.server.ldap.support.ModifyHandler;
 import org.apache.directory.server.ldap.support.SearchHandler;
 import org.apache.directory.server.ldap.support.UnbindHandler;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.message.AbandonRequest;
 import org.apache.directory.shared.ldap.message.AbandonRequestImpl;
-import org.apache.directory.shared.ldap.message.AddRequest;
-import org.apache.directory.shared.ldap.message.AddRequestImpl;
 import org.apache.directory.shared.ldap.message.BindRequest;
 import org.apache.directory.shared.ldap.message.BindRequestImpl;
-import org.apache.directory.shared.ldap.message.CompareRequest;
-import org.apache.directory.shared.ldap.message.CompareRequestImpl;
-import org.apache.directory.shared.ldap.message.Control;
-import org.apache.directory.shared.ldap.message.DeleteRequest;
-import org.apache.directory.shared.ldap.message.DeleteRequestImpl;
-import org.apache.directory.shared.ldap.message.EntryChangeControl;
-import org.apache.directory.shared.ldap.message.ExtendedRequest;
-import org.apache.directory.shared.ldap.message.ExtendedRequestImpl;
-import org.apache.directory.shared.ldap.message.ManageDsaITControl;
 import org.apache.directory.shared.ldap.message.MessageDecoder;
 import org.apache.directory.shared.ldap.message.MessageEncoder;
-import org.apache.directory.shared.ldap.message.ModifyDnRequest;
-import org.apache.directory.shared.ldap.message.ModifyDnRequestImpl;
-import org.apache.directory.shared.ldap.message.ModifyRequest;
-import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
-import org.apache.directory.shared.ldap.message.PersistentSearchControl;
-import org.apache.directory.shared.ldap.message.Request;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.message.ResultResponse;
-import org.apache.directory.shared.ldap.message.ResultResponseRequest;
 import org.apache.directory.shared.ldap.message.SearchRequest;
 import org.apache.directory.shared.ldap.message.SearchRequestImpl;
 import org.apache.directory.shared.ldap.message.UnbindRequest;
 import org.apache.directory.shared.ldap.message.UnbindRequestImpl;
-import org.apache.directory.shared.ldap.message.extended.NoticeOfDisconnect;
 import org.apache.mina.common.IoFilterChain;
 import org.apache.mina.common.IoHandler;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.filter.LoggingFilter;
-import org.apache.mina.filter.SSLFilter;
 import org.apache.mina.filter.codec.ProtocolCodecFactory;
 import org.apache.mina.filter.codec.ProtocolCodecFilter;
 import org.apache.mina.filter.codec.ProtocolDecoder;
 import org.apache.mina.filter.codec.ProtocolEncoder;
 import org.apache.mina.handler.demux.DemuxingIoHandler;
 import org.apache.mina.handler.demux.MessageHandler;
-import org.apache.mina.util.SessionLog;
 
 
 /**
@@ -98,47 +68,16 @@
     public static final String SERVICE_NAME = "ldap";
     /** a map of the default request object class name to the handler class name */
     private static final Map DEFAULT_HANDLERS;
-    /** a set of supported controls */
-    private static final Set SUPPORTED_CONTROLS;
 
     static
     {
         HashMap map = new HashMap();
-
-        /*
-         * Note:
-         *
-         * By mapping the implementation class in addition to the interface
-         * for the request type to the handler Class we're bypassing the need
-         * to iterate through Interface[] looking for handlers.  For the default
-         * cases here the name of the request object's class will look up
-         * immediately.
-         */
-
         map.put( AbandonRequest.class.getName(), AbandonHandler.class );
         map.put( AbandonRequestImpl.class.getName(), AbandonHandler.class );
 
-        map.put( AddRequest.class.getName(), AddHandler.class );
-        map.put( AddRequestImpl.class.getName(), AddHandler.class );
-
         map.put( BindRequest.class.getName(), BindHandler.class );
         map.put( BindRequestImpl.class.getName(), BindHandler.class );
 
-        map.put( CompareRequest.class.getName(), CompareHandler.class );
-        map.put( CompareRequestImpl.class.getName(), CompareHandler.class );
-
-        map.put( DeleteRequest.class.getName(), DeleteHandler.class );
-        map.put( DeleteRequestImpl.class.getName(), DeleteHandler.class );
-
-        map.put( ExtendedRequest.class.getName(), ExtendedHandler.class );
-        map.put( ExtendedRequestImpl.class.getName(), ExtendedHandler.class );
-
-        map.put( ModifyRequest.class.getName(), ModifyHandler.class );
-        map.put( ModifyRequestImpl.class.getName(), ModifyHandler.class );
-
-        map.put( ModifyDnRequest.class.getName(), ModifyDnHandler.class );
-        map.put( ModifyDnRequestImpl.class.getName(), ModifyDnHandler.class );
-
         map.put( SearchRequest.class.getName(), SearchHandler.class );
         map.put( SearchRequestImpl.class.getName(), SearchHandler.class );
 
@@ -146,12 +85,6 @@
         map.put( UnbindRequestImpl.class.getName(), UnbindHandler.class );
 
         DEFAULT_HANDLERS = Collections.unmodifiableMap( map );
-
-        HashSet set = new HashSet();
-        set.add( PersistentSearchControl.CONTROL_OID );
-        set.add( EntryChangeControl.CONTROL_OID );
-        set.add( ManageDsaITControl.CONTROL_OID );
-        SUPPORTED_CONTROLS = Collections.unmodifiableSet( set );
     }
 
     /** the underlying provider codec factory */
@@ -165,6 +98,7 @@
     // C O N S T R U C T O R S
     // ------------------------------------------------------------------------
 
+
     /**
      * Creates a MINA LDAP protocol provider.
      *
@@ -288,53 +222,6 @@
 
 
     /**
-     * Registeres the specified {@link ExtendedOperationHandler} to this
-     * protocol provider to provide a specific LDAP extended operation.
-     */
-    public void addExtendedOperationHandler( ExtendedOperationHandler eoh )
-    {
-        ExtendedHandler eh = ( ExtendedHandler ) handler.getMessageHandler( ExtendedRequest.class );
-        eh.addHandler( eoh );
-        eh = ( ExtendedHandler ) handler.getMessageHandler( ExtendedRequestImpl.class );
-        eh.addHandler( eoh );
-    }
-
-
-    /**
-     * Deregisteres an {@link ExtendedOperationHandler} with the specified <tt>oid</tt>
-     * from this protocol provider.
-     */
-    public void removeExtendedOperationHandler( String oid )
-    {
-        ExtendedHandler eh = ( ExtendedHandler ) handler.getMessageHandler( ExtendedRequest.class );
-        eh.removeHandler( oid );
-        eh = ( ExtendedHandler ) handler.getMessageHandler( ExtendedRequestImpl.class );
-        eh.removeHandler( oid );
-    }
-
-
-    /**
-     * Returns an {@link ExtendedOperationHandler} with the specified <tt>oid</tt>
-     * which is registered to this protocol provider.
-     */
-    public ExtendedOperationHandler getExtendedOperationHandler( String oid )
-    {
-        ExtendedHandler eh = ( ExtendedHandler ) handler.getMessageHandler( ExtendedRequest.class );
-        return eh.getHandler( oid );
-    }
-
-
-    /**
-     * Returns a {@link Map} of all registered OID-{@link ExtendedOperationHandler}
-     * pairs.
-     */
-    public Map getExtendedOperationHandlerMap()
-    {
-        ExtendedHandler eh = ( ExtendedHandler ) handler.getMessageHandler( ExtendedRequest.class );
-        return eh.getHandlerMap();
-    }
-
-    /**
      * A snickers based BER Decoder factory.
      */
     private static final class ProtocolCodecFactoryImpl implements ProtocolCodecFactory
@@ -384,61 +271,7 @@
 
         public void messageReceived( IoSession session, Object message ) throws Exception
         {
-            // Translate SSLFilter messages into LDAP extended request
-            // defined in RFC #2830, 'Lightweight Directory Access Protocol (v3):
-            // Extension for Transport Layer Security'.
-            // 
-            // The RFC specifies the payload should be empty, but we use
-            // it to notify the TLS state changes.  This hack should be
-            // OK from the viewpoint of security because StartTLS
-            // handler should react to only SESSION_UNSECURED message
-            // and degrade authentication level to 'anonymous' as specified
-            // in the RFC, and this is no threat.
-
-            if ( message == SSLFilter.SESSION_SECURED )
-            {
-                ExtendedRequest req = new ExtendedRequestImpl( 0 );
-                req.setOid( "1.3.6.1.4.1.1466.20037" );
-                req.setPayload( "SECURED".getBytes( "ISO-8859-1" ) );
-                message = req;
-            }
-            else if ( message == SSLFilter.SESSION_UNSECURED )
-            {
-                ExtendedRequest req = new ExtendedRequestImpl( 0 );
-                req.setOid( "1.3.6.1.4.1.1466.20037" );
-                req.setPayload( "UNSECURED".getBytes( "ISO-8859-1" ) );
-                message = req;
-            }
-
-            if ( ( ( Request ) message ).getControls().size() > 0 && message instanceof ResultResponseRequest )
-            {
-                ResultResponseRequest req = ( ResultResponseRequest ) message;
-                Iterator controls = req.getControls().values().iterator();
-                while ( controls.hasNext() )
-                {
-                    Control control = ( Control ) controls.next();
-                    if ( control.isCritical() && !SUPPORTED_CONTROLS.contains( control.getID() ) )
-                    {
-                        ResultResponse resp = req.getResultResponse();
-                        resp.getLdapResult().setErrorMessage( "Unsupport critical control: " + control.getID() );
-                        resp.getLdapResult().setResultCode( ResultCodeEnum.UNAVAILABLECRITICALEXTENSION );
-                        session.write( resp );
-                        return;
-                    }
-                }
-            }
-
             super.messageReceived( session, message );
-        }
-
-
-        public void exceptionCaught( IoSession session, Throwable cause )
-        {
-            SessionLog.warn( session,
-                "Unexpected exception forcing session to close: sending disconnect notice to client.", cause );
-            session.write( NoticeOfDisconnect.PROTOCOLERROR );
-            SessionRegistry.getSingleton().remove( session );
-            session.close();
         }
     }
 }

Modified: directory/branches/apacheds/noback-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/noback-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java?rev=414283&r1=414282&r2=414283&view=diff
==============================================================================
--- directory/branches/apacheds/noback-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java (original)
+++ directory/branches/apacheds/noback-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java Wed Jun 14 08:08:21 2006
@@ -16,50 +16,19 @@
 package org.apache.directory.server.ldap.support;
 
 
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-
-import javax.naming.Context;
-import javax.naming.InvalidNameException;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.ReferralException;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.BasicAttributes;
-import javax.naming.directory.SearchControls;
-import javax.naming.ldap.LdapContext;
 
-import org.apache.directory.server.core.configuration.Configuration;
-import org.apache.directory.server.core.configuration.StartupConfiguration;
-import org.apache.directory.server.core.jndi.ServerLdapContext;
-import org.apache.directory.server.ldap.SessionRegistry;
-import org.apache.directory.shared.ldap.codec.util.LdapResultEnum;
-import org.apache.directory.shared.ldap.exception.LdapException;
-import org.apache.directory.shared.ldap.exception.OperationAbandonedException;
-import org.apache.directory.shared.ldap.filter.PresenceNode;
-import org.apache.directory.shared.ldap.message.AbandonListener;
-import org.apache.directory.shared.ldap.message.LdapResult;
-import org.apache.directory.shared.ldap.message.ManageDsaITControl;
-import org.apache.directory.shared.ldap.message.PersistentSearchControl;
-import org.apache.directory.shared.ldap.message.ReferralImpl;
-import org.apache.directory.shared.ldap.message.Response;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.message.ScopeEnum;
 import org.apache.directory.shared.ldap.message.SearchRequest;
 import org.apache.directory.shared.ldap.message.SearchResponseDone;
 import org.apache.directory.shared.ldap.message.SearchResponseEntry;
 import org.apache.directory.shared.ldap.message.SearchResponseEntryImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.util.ArrayUtils;
-import org.apache.directory.shared.ldap.util.ExceptionUtils;
+
 import org.apache.mina.common.IoSession;
 import org.apache.mina.handler.demux.MessageHandler;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 
 /**
  * A handler for processing search requests.
@@ -69,57 +38,17 @@
  */
 public class SearchHandler implements MessageHandler
 {
-    private static final Logger log = LoggerFactory.getLogger( SearchHandler.class );
-    private static final String DEREFALIASES_KEY = "java.naming.ldap.derefAliases";
     private Attributes entry;
     private LdapDN entryDn;
 
+    
     public SearchHandler()
     {
         entry = new BasicAttributes( "objectClass", "top", true );
         entryDn = new LdapDN();
     }
     
-    /**
-     * Builds the JNDI search controls for a SearchRequest.
-     *  
-     * @param req the search request.
-     * @param ids the ids to return
-     * @return the SearchControls to use with the ApacheDS server side JNDI provider
-     */
-    private static SearchControls getSearchControls( SearchRequest req, String[] ids )
-    {
-        // prepare all the search controls
-        SearchControls controls = new SearchControls();
-        controls.setCountLimit( req.getSizeLimit() );
-        controls.setTimeLimit( req.getTimeLimit() );
-        controls.setSearchScope( req.getScope().getValue() );
-        controls.setReturningObjFlag( req.getTypesOnly() );
-        controls.setReturningAttributes( ids );
-        controls.setDerefLinkFlag( true );
-        return controls;
-    }
-
-
-    /**
-     * Determines if a search request is on the RootDSE of the server.
-     * 
-     * @param req the request issued
-     * @return true if the search is on the RootDSE false otherwise
-     */
-    private static boolean isRootDSESearch( SearchRequest req )
-    {
-        boolean isBaseIsRoot = req.getBase().isEmpty();
-        boolean isBaseScope = req.getScope() == ScopeEnum.BASEOBJECT;
-        boolean isRootDSEFilter = false;
-        if ( req.getFilter() instanceof PresenceNode )
-        {
-            isRootDSEFilter = ( ( PresenceNode ) req.getFilter() ).getAttribute().equalsIgnoreCase( "objectClass" );
-        }
-        return isBaseIsRoot && isBaseScope && isRootDSEFilter;
-    }
-
-
+    
     /**
      * Main message handing method for search requests.
      */
@@ -134,278 +63,5 @@
         SearchResponseDone respDone = ( SearchResponseDone ) ( ( SearchRequest) request ).getResultResponse();
         respDone.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
         session.write( respDone );
-        
-        if ( true ) return;
-        
-        // ================================================
-        
-    	if ( log.isDebugEnabled() )
-    	{
-    		log.debug( "Message received : " + request.toString() );
-    	}
-
-    	ServerLdapContext ctx;
-        SearchRequest req = ( SearchRequest ) request;
-        NamingEnumeration list = null;
-        String[] ids = null;
-        Collection retAttrs = new HashSet();
-        retAttrs.addAll( req.getAttributes() );
-
-        // add the search request to the registry of outstanding requests for this session
-        SessionRegistry.getSingleton().addOutstandingRequest( session, req );
-
-        // check the attributes to see if a referral's ref attribute is included
-        if ( retAttrs.size() > 0 && !retAttrs.contains( "ref" ) )
-        {
-            retAttrs.add( "ref" );
-            ids = ( String[] ) retAttrs.toArray( ArrayUtils.EMPTY_STRING_ARRAY );
-        }
-        else if ( retAttrs.size() > 0 )
-        {
-            ids = ( String[] ) retAttrs.toArray( ArrayUtils.EMPTY_STRING_ARRAY );
-        }
-        SearchControls controls = getSearchControls( req, ids );
-
-        try
-        {
-            // ===============================================================
-            // Find session context
-            // ===============================================================
-
-            boolean isRootDSESearch = isRootDSESearch( req );
-            // bypass checks to disallow anonymous binds for search on RootDSE with base obj scope
-            if ( isRootDSESearch )
-            {
-                LdapContext unknown = SessionRegistry.getSingleton().getLdapContextOnRootDSEAccess( session, null );
-                if ( !( unknown instanceof ServerLdapContext ) )
-                {
-                    ctx = ( ServerLdapContext ) unknown.lookup( "" );
-                }
-                else
-                {
-                    ctx = ( ServerLdapContext ) unknown;
-                }
-            }
-            // all those search operations are subject to anonymous bind checks when anonymous binda are disallowed
-            else
-            {
-                LdapContext unknown = SessionRegistry.getSingleton().getLdapContext( session, null, true );
-                if ( !( unknown instanceof ServerLdapContext ) )
-                {
-                    ctx = ( ServerLdapContext ) unknown.lookup( "" );
-                }
-                else
-                {
-                    ctx = ( ServerLdapContext ) unknown;
-                }
-            }
-            ctx.addToEnvironment( DEREFALIASES_KEY, req.getDerefAliases().getName() );
-            if ( req.getControls().containsKey( ManageDsaITControl.CONTROL_OID ) )
-            {
-                ctx.addToEnvironment( Context.REFERRAL, "ignore" );
-            }
-            else
-            {
-                ctx.addToEnvironment( Context.REFERRAL, "throw-finding-base" );
-            }
-
-            // ===============================================================
-            // Handle annonymous binds
-            // ===============================================================
-
-            StartupConfiguration cfg = ( StartupConfiguration ) Configuration.toConfiguration( ctx.getEnvironment() );
-            boolean allowAnonymousBinds = cfg.isAllowAnonymousAccess();
-            boolean isAnonymousUser = ( ( ServerLdapContext ) ctx ).getPrincipal().getName().trim().equals( "" );
-
-            if ( isAnonymousUser && !allowAnonymousBinds && !isRootDSESearch )
-            {
-                LdapResult result = req.getResultResponse().getLdapResult();
-                result.setResultCode( ResultCodeEnum.INSUFFICIENTACCESSRIGHTS );
-                String msg = "Bind failure: Anonymous binds have been disabled!";
-                result.setErrorMessage( msg );
-                session.write( req.getResultResponse() );
-                return;
-            }
-
-            // ===============================================================
-            // Handle psearch differently
-            // ===============================================================
-
-            PersistentSearchControl psearchControl = ( PersistentSearchControl ) req.getControls().get(
-                PersistentSearchControl.CONTROL_OID );
-            if ( psearchControl != null )
-            {
-                // there are no limits for psearch processing
-                controls.setCountLimit( 0 );
-                controls.setTimeLimit( 0 );
-
-                if ( !psearchControl.isChangesOnly() )
-                {
-                    list = ( ( ServerLdapContext ) ctx ).search( req.getBase(), req.getFilter(),
-                        controls );
-                    if ( list instanceof AbandonListener )
-                    {
-                        req.addAbandonListener( ( AbandonListener ) list );
-                    }
-                    if ( list.hasMore() )
-                    {
-                        Iterator it = new SearchResponseIterator( req, ctx, list, controls.getSearchScope(), session );
-                        while ( it.hasNext() )
-                        {
-                            Response resp = ( Response ) it.next();
-                            if ( resp instanceof SearchResponseDone )
-                            {
-                                // ok if normal search beforehand failed somehow quickly abandon psearch
-                                ResultCodeEnum rcode = ( ( SearchResponseDone ) resp ).getLdapResult().getResultCode();
-                                if ( rcode.getValue() != LdapResultEnum.SUCCESS )
-                                {
-                                    session.write( resp );
-                                    return;
-                                }
-                                // if search was fine then we returned all entries so now
-                                // instead of returning the DONE response we break from the
-                                // loop and user the notification listener to send back 
-                                // notificationss to the client in never ending search
-                                else
-                                    break;
-                            }
-                            else
-                            {
-                                session.write( resp );
-                            }
-                        }
-                    }
-                }
-
-                // now we process entries for ever as they change 
-                PersistentSearchListener handler = new PersistentSearchListener( ctx, session, req );
-                StringBuffer buf = new StringBuffer();
-                req.getFilter().printToBuffer( buf );
-                ctx.addNamingListener( req.getBase(), buf.toString(), controls, handler );
-                SessionRegistry.getSingleton().addOutstandingRequest( session, req );
-                return;
-            }
-
-            // ===============================================================
-            // Handle regular search requests from here down
-            // ===============================================================
-
-            /*
-             * Iterate through all search results building and sending back responses 
-             * for each search result returned.  
-             */
-            list = ( ( ServerLdapContext ) ctx ).search( req.getBase(), req.getFilter(), controls );
-            if ( list instanceof AbandonListener )
-            {
-                req.addAbandonListener( ( AbandonListener ) list );
-            }
-
-            if ( list.hasMore() )
-            {
-                Iterator it = new SearchResponseIterator( req, ctx, list, controls.getSearchScope(), session );
-                while ( it.hasNext() )
-                {
-                    session.write( it.next() );
-                }
-
-                return;
-            }
-            else
-            {
-                list.close();
-                req.getResultResponse().getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
-                Iterator it = Collections.singleton( req.getResultResponse() ).iterator();
-                while ( it.hasNext() )
-                {
-                    session.write( it.next() );
-                }
-                return;
-            }
-        }
-        catch ( ReferralException e )
-        {
-            LdapResult result = req.getResultResponse().getLdapResult();
-            ReferralImpl refs = new ReferralImpl();
-            result.setReferral( refs );
-            result.setResultCode( ResultCodeEnum.REFERRAL );
-            result.setErrorMessage( "Encountered referral attempting to handle add request." );
-            /* coming up null causing a NPE */
-            // result.setMatchedDn( e.getResolvedName().toString() );
-            do
-            {
-                refs.addLdapUrl( ( String ) e.getReferralInfo() );
-            }
-            while ( e.skipReferral() );
-            session.write( req.getResultResponse() );
-            SessionRegistry.getSingleton().removeOutstandingRequest( session, req.getMessageId() );
-            return;
-        }
-        catch ( NamingException e )
-        {
-            /*
-             * From RFC 2251 Section 4.11:
-             * 
-             * In the event that a server receives an Abandon Request on a Search  
-             * operation in the midst of transmitting responses to the Search, that
-             * server MUST cease transmitting entry responses to the abandoned
-             * request immediately, and MUST NOT send the SearchResultDone. Of
-             * course, the server MUST ensure that only properly encoded LDAPMessage
-             * PDUs are transmitted. 
-             * 
-             * SO DON'T SEND BACK ANYTHING!!!!!
-             */
-            if ( e instanceof OperationAbandonedException )
-            {
-                return;
-            }
-
-            String msg = "failed on search operation";
-            if ( log.isDebugEnabled() )
-            {
-                msg += ":\n" + req + ":\n" + ExceptionUtils.getStackTrace( e );
-            }
-
-            ResultCodeEnum code = null;
-            if ( e instanceof LdapException )
-            {
-                code = ( ( LdapException ) e ).getResultCode();
-            }
-            else
-            {
-                code = ResultCodeEnum.getBestEstimate( e, req.getType() );
-            }
-
-            LdapResult result = req.getResultResponse().getLdapResult();
-            result.setResultCode( code );
-            result.setErrorMessage( msg );
-
-            if ( ( e.getResolvedName() != null )
-                && ( ( code == ResultCodeEnum.NOSUCHOBJECT ) || ( code == ResultCodeEnum.ALIASPROBLEM )
-                    || ( code == ResultCodeEnum.INVALIDDNSYNTAX ) || ( code == ResultCodeEnum.ALIASDEREFERENCINGPROBLEM ) ) )
-            {
-                result.setMatchedDn( (LdapDN)e.getResolvedName() );
-            }
-
-            Iterator it = Collections.singleton( req.getResultResponse() ).iterator();
-            while ( it.hasNext() )
-            {
-                session.write( it.next() );
-            }
-            SessionRegistry.getSingleton().removeOutstandingRequest( session, req.getMessageId() );
-        }
-        finally
-        {
-            if ( list != null )
-            {
-                try
-                {
-                    list.close();
-                }
-                catch ( NamingException e )
-                {
-                    log.error( "failed on list.close()", e );
-                }
-            }
-        }
     }
 }

Modified: directory/branches/apacheds/noback-experiment/server-installers/pom.xml
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/noback-experiment/server-installers/pom.xml?rev=414283&r1=414282&r2=414283&view=diff
==============================================================================
--- directory/branches/apacheds/noback-experiment/server-installers/pom.xml (original)
+++ directory/branches/apacheds/noback-experiment/server-installers/pom.xml Wed Jun 14 08:08:21 2006
@@ -128,52 +128,9 @@
               <installationBundleId>Binaries</installationBundleId>
             </packagedFile>
           </packagedFiles>
-<!--
-          <svnBaseUrl>
-            http://svn.apache.org/repos/asf/directory/branches/apacheds/1.0
-          </svnBaseUrl>
-          <packageSources>true</packageSources>
-          <packageDocs>true</packageDocs>
--->
           <applicationClass>
             org.apache.ldap.server.Service
           </applicationClass>
-          <rpmTargets>
-            <rpmTarget>
-              <packagedFiles>
-                <packagedFile>
-                  <source>rpm-apacheds-tools.sh</source>
-                  <destinationPath>bin/apacheds-tools.sh</destinationPath>
-                  <installationBundleId>Binaries</installationBundleId>
-                  <executable>true</executable>
-                  <filtered>true</filtered>
-                </packagedFile>
-              </packagedFiles>
-              <id>linux-jsvc-rpm</id>
-              <rpmSpecificationFile>src/main/installers/rpm-apacheds.spec</rpmSpecificationFile>
-              <finalName>
-                apacheds-${pom.version}-linux-i386.rpm
-              </finalName>
-              <osName>Linux</osName>
-              <osFamily>unix</osFamily>
-              <osArch>i386</osArch>
-              <daemonFramework>jsvc</daemonFramework>
-            </rpmTarget>
-          </rpmTargets>
-          <innoTargets>
-            <innoTarget>
-              <id>windows-xp-procrun</id>
-              <innoConfigurationFile>src/main/installers/inno-apacheds.iss</innoConfigurationFile>
-              <finalName>
-                apacheds-${pom.version}-win32-setup
-              </finalName>
-              <osName>Windows XP</osName>
-              <osFamily>windows</osFamily>
-              <osVersion>5.1</osVersion>
-              <osArch>x86</osArch>
-              <daemonFramework>procrun</daemonFramework>
-            </innoTarget>
-          </innoTargets>
           <izPackTargets>
             <izPackTarget>
               <packagedFiles>
@@ -218,135 +175,6 @@
               <osName>Linux</osName>
               <osFamily>unix</osFamily>
               <osArch>i386</osArch>
-              <daemonFramework>jsvc</daemonFramework>
-            </izPackTarget>
-            <izPackTarget>
-              <packagedFiles>
-                <packagedFile>
-                  <source>izpack-apacheds-tools.sh</source>
-                  <destinationPath>bin/apacheds-tools.sh</destinationPath>
-                  <installationBundleId>Binaries</installationBundleId>
-                  <executable>true</executable>
-                  <filtered>true</filtered>
-                </packagedFile>
-                <packagedFile>
-                  <source>src/main/installers/stop.png</source>
-                  <destinationPath>stop.png</destinationPath>
-                  <installationBundleId>Binaries</installationBundleId>
-                </packagedFile>
-                <packagedFile>
-                  <source>src/main/installers/debug.png</source>
-                  <destinationPath>debug.png</destinationPath>
-                  <installationBundleId>Binaries</installationBundleId>
-                </packagedFile>
-                <packagedFile>
-                  <source>src/main/installers/start.png</source>
-                  <destinationPath>start.png</destinationPath>
-                  <installationBundleId>Binaries</installationBundleId>
-                </packagedFile>
-                <packagedFile>
-                  <source>src/main/installers/docs.png</source>
-                  <destinationPath>docs/docs.png</destinationPath>
-                  <installationBundleId>Binaries</installationBundleId>
-                </packagedFile>
-              </packagedFiles>
-              <finalName>
-                apacheds-${pom.version}-solaris-sparc-setup.jar
-              </finalName>
-              <id>solaris-jsvc-sparc</id>
-              <izPackInstallFile>src/main/installers/izpack-unix.xml</izPackInstallFile>
-              <izPackShortcutsUnixFile>
-                src/main/installers/unix_shortcuts.xml
-              </izPackShortcutsUnixFile>
-              <osName>sunos</osName>
-              <osFamily>unix</osFamily>
-              <osArch>sparc</osArch>
-              <daemonFramework>jsvc</daemonFramework>
-            </izPackTarget>
-            <izPackTarget>
-              <packagedFiles>
-                <packagedFile>
-                  <source>src/main/installers/stop.png</source>
-                  <destinationPath>stop.png</destinationPath>
-                  <installationBundleId>Binaries</installationBundleId>
-                </packagedFile>
-                <packagedFile>
-                  <source>src/main/installers/debug.png</source>
-                  <destinationPath>debug.png</destinationPath>
-                  <installationBundleId>Binaries</installationBundleId>
-                </packagedFile>
-                <packagedFile>
-                  <source>src/main/installers/start.png</source>
-                  <destinationPath>start.png</destinationPath>
-                  <installationBundleId>Binaries</installationBundleId>
-                </packagedFile>
-                <packagedFile>
-                  <source>src/main/installers/docs.png</source>
-                  <destinationPath>docs/docs.png</destinationPath>
-                  <installationBundleId>Binaries</installationBundleId>
-                </packagedFile>
-                <packagedFile>
-                  <source>izpack-apacheds-tools.sh</source>
-                  <destinationPath>bin/apacheds-tools.sh</destinationPath>
-                  <installationBundleId>Binaries</installationBundleId>
-                  <executable>true</executable>
-                  <filtered>true</filtered>
-                </packagedFile>
-              </packagedFiles>
-              <id>solaris-jsvc-i386</id>
-              <izPackInstallFile>src/main/installers/izpack-unix.xml</izPackInstallFile>
-              <izPackShortcutsUnixFile>
-                src/main/installers/unix_shortcuts.xml
-              </izPackShortcutsUnixFile>
-              <finalName>
-                apacheds-${pom.version}-solaris-i386-setup.jar
-              </finalName>
-              <osName>sunos</osName>
-              <osFamily>unix</osFamily>
-              <osArch>i386</osArch>
-              <daemonFramework>jsvc</daemonFramework>
-            </izPackTarget>
-            <izPackTarget>
-              <packagedFiles>
-                <packagedFile>
-                  <source>src/main/installers/stop.png</source>
-                  <destinationPath>stop.png</destinationPath>
-                  <installationBundleId>Binaries</installationBundleId>
-                </packagedFile>
-                <packagedFile>
-                  <source>src/main/installers/debug.png</source>
-                  <destinationPath>debug.png</destinationPath>
-                  <installationBundleId>Binaries</installationBundleId>
-                </packagedFile>
-                <packagedFile>
-                  <source>src/main/installers/start.png</source>
-                  <destinationPath>start.png</destinationPath>
-                  <installationBundleId>Binaries</installationBundleId>
-                </packagedFile>
-                <packagedFile>
-                  <source>src/main/installers/docs.png</source>
-                  <destinationPath>docs/docs.png</destinationPath>
-                  <installationBundleId>Binaries</installationBundleId>
-                </packagedFile>
-                <packagedFile>
-                  <source>izpack-apacheds-tools.sh</source>
-                  <destinationPath>bin/apacheds-tools.sh</destinationPath>
-                  <installationBundleId>Binaries</installationBundleId>
-                  <executable>true</executable>
-                  <filtered>true</filtered>
-                </packagedFile>
-              </packagedFiles>
-              <id>macosx-jsvc</id>
-              <izPackInstallFile>src/main/installers/izpack-mac.xml</izPackInstallFile>
-              <izPackShortcutsUnixFile>
-                src/main/installers/unix_shortcuts.xml
-              </izPackShortcutsUnixFile>
-              <finalName>
-                apacheds-${pom.version}-macosx-ppc-setup.jar
-              </finalName>
-              <osName>macosx</osName>
-              <osFamily>unix</osFamily>
-              <osArch>ppc</osArch>
               <daemonFramework>jsvc</daemonFramework>
             </izPackTarget>
           </izPackTargets>

Modified: directory/branches/apacheds/noback-experiment/server-installers/src/main/installers/server.xml
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/noback-experiment/server-installers/src/main/installers/server.xml?rev=414283&r1=414282&r2=414283&view=diff
==============================================================================
--- directory/branches/apacheds/noback-experiment/server-installers/src/main/installers/server.xml (original)
+++ directory/branches/apacheds/noback-experiment/server-installers/src/main/installers/server.xml Wed Jun 14 08:08:21 2006
@@ -82,8 +82,6 @@
     
     <property name="extendedOperationHandlers">
       <list>
-        <bean class="org.apache.directory.server.ldap.support.extended.GracefulShutdownHandler"/>
-        <bean class="org.apache.directory.server.ldap.support.extended.LaunchDiagnosticUiHandler"/>
       </list>
     </property>
 

Modified: directory/branches/apacheds/noback-experiment/server-jndi/src/main/java/org/apache/directory/server/configuration/ServerStartupConfiguration.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/noback-experiment/server-jndi/src/main/java/org/apache/directory/server/configuration/ServerStartupConfiguration.java?rev=414283&r1=414282&r2=414283&view=diff
==============================================================================
--- directory/branches/apacheds/noback-experiment/server-jndi/src/main/java/org/apache/directory/server/configuration/ServerStartupConfiguration.java (original)
+++ directory/branches/apacheds/noback-experiment/server-jndi/src/main/java/org/apache/directory/server/configuration/ServerStartupConfiguration.java Wed Jun 14 08:08:21 2006
@@ -21,14 +21,12 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 import java.io.File;
 
 import org.apache.directory.server.core.configuration.ConfigurationException;
 import org.apache.directory.server.core.configuration.ConfigurationUtil;
 import org.apache.directory.server.core.configuration.StartupConfiguration;
-import org.apache.directory.server.ldap.ExtendedOperationHandler;
 import org.apache.directory.server.protocol.shared.store.LdifLoadFilter;
 
 
@@ -248,17 +246,6 @@
 
     protected void setExtendedOperationHandlers( Collection handlers )
     {
-        for ( Iterator i = handlers.iterator(); i.hasNext(); )
-        {
-            if ( !( i.next() instanceof ExtendedOperationHandler ) )
-            {
-                throw new IllegalArgumentException(
-                    "The specified handler collection contains an element which is not an ExtendedOperationHandler." );
-            }
-        }
-
-        this.extendedOperationHandlers.clear();
-        this.extendedOperationHandlers.addAll( handlers );
     }
 
 

Modified: directory/branches/apacheds/noback-experiment/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/noback-experiment/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java?rev=414283&r1=414282&r2=414283&view=diff
==============================================================================
--- directory/branches/apacheds/noback-experiment/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java (original)
+++ directory/branches/apacheds/noback-experiment/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java Wed Jun 14 08:08:21 2006
@@ -17,39 +17,19 @@
 package org.apache.directory.server.jndi;
 
 
-import java.io.File;
-import java.io.FileFilter;
 import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
 import java.net.InetSocketAddress;
 import java.util.ArrayList;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
 
-import javax.naming.Context;
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttributes;
-import javax.naming.directory.DirContext;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.directory.server.changepw.ChangePasswordConfiguration;
-import org.apache.directory.server.changepw.ChangePasswordServer;
+
 import org.apache.directory.server.configuration.ServerStartupConfiguration;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.jndi.CoreContextFactory;
-import org.apache.directory.server.core.partition.DirectoryPartitionNexus;
-import org.apache.directory.server.kerberos.kdc.KdcConfiguration;
-import org.apache.directory.server.kerberos.kdc.KerberosServer;
-import org.apache.directory.server.kerberos.shared.store.JndiPrincipalStoreImpl;
-import org.apache.directory.server.kerberos.shared.store.PrincipalStore;
-import org.apache.directory.server.ldap.ExtendedOperationHandler;
 import org.apache.directory.server.ldap.LdapProtocolProvider;
-import org.apache.directory.server.ntp.NtpConfiguration;
-import org.apache.directory.server.ntp.NtpServer;
-import org.apache.directory.server.protocol.shared.LoadStrategy;
-import org.apache.directory.server.protocol.shared.store.LdifFileLoader;
 import org.apache.directory.shared.ldap.exception.LdapConfigurationException;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.message.extended.NoticeOfDisconnect;
@@ -63,6 +43,7 @@
 import org.apache.mina.transport.socket.nio.DatagramAcceptor;
 import org.apache.mina.transport.socket.nio.SocketAcceptor;
 import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -78,7 +59,6 @@
 public class ServerContextFactory extends CoreContextFactory
 {
     private static final Logger log = LoggerFactory.getLogger( ServerContextFactory.class.getName() );
-    private static final String LDIF_FILES_DN = "ou=loadedLdifFiles,ou=configuration,ou=system";
 
     protected static final IoAcceptor tcpAcceptor = new SocketAcceptor();
     protected static final IoAcceptor udpAcceptor = new DatagramAcceptor();
@@ -91,19 +71,10 @@
     }
 
     private static boolean ldapStarted;
-    private static boolean ldapsStarted;
-    private static KerberosServer tcpKdcServer;
-    private static KerberosServer udpKdcServer;
-    private static ChangePasswordServer tcpChangePasswordServer;
-    private static ChangePasswordServer udpChangePasswordServer;
-    private static NtpServer tcpNtpServer;
-    private static NtpServer udpNtpServer;
-    private DirectoryService directoryService;
 
 
     public void beforeStartup( DirectoryService service )
     {
-        this.directoryService = service;
     }
 
 
@@ -117,72 +88,6 @@
             stopLDAP0( cfg.getLdapPort() );
             ldapStarted = false;
         }
-
-        if ( ldapsStarted )
-        {
-            stopLDAP0( cfg.getLdapsPort() );
-            ldapsStarted = false;
-        }
-
-        if ( tcpKdcServer != null )
-        {
-            tcpKdcServer.destroy();
-            if ( log.isInfoEnabled() )
-            {
-                log.info( "Unbind of KRB5 Service (TCP) complete: " + tcpKdcServer );
-            }
-            tcpKdcServer = null;
-        }
-
-        if ( udpKdcServer != null )
-        {
-            udpKdcServer.destroy();
-            if ( log.isInfoEnabled() )
-            {
-                log.info( "Unbind of KRB5 Service (UDP) complete: " + udpKdcServer );
-            }
-            udpKdcServer = null;
-        }
-
-        if ( tcpChangePasswordServer != null )
-        {
-            tcpChangePasswordServer.destroy();
-            if ( log.isInfoEnabled() )
-            {
-                log.info( "Unbind of Change Password Service (TCP) complete: " + tcpChangePasswordServer );
-            }
-            tcpChangePasswordServer = null;
-        }
-
-        if ( udpChangePasswordServer != null )
-        {
-            udpChangePasswordServer.destroy();
-            if ( log.isInfoEnabled() )
-            {
-                log.info( "Unbind of Change Password Service (UDP) complete: " + udpChangePasswordServer );
-            }
-            udpChangePasswordServer = null;
-        }
-
-        if ( tcpNtpServer != null )
-        {
-            tcpNtpServer.destroy();
-            if ( log.isInfoEnabled() )
-            {
-                log.info( "Unbind of NTP Service (TCP) complete: " + tcpNtpServer );
-            }
-            tcpNtpServer = null;
-        }
-
-        if ( udpNtpServer != null )
-        {
-            udpNtpServer.destroy();
-            if ( log.isInfoEnabled() )
-            {
-                log.info( "Unbind of NTP Service complete: " + udpNtpServer );
-            }
-            udpNtpServer = null;
-        }
     }
 
 
@@ -192,182 +97,9 @@
             .getStartupConfiguration();
         Hashtable env = service.getConfiguration().getEnvironment();
 
-        loadLdifs( service );
-
         if ( cfg.isEnableNetworking() )
         {
             startLDAP( cfg, env );
-            startLDAPS( cfg, env );
-            startKerberos( cfg, env );
-            startChangePassword( cfg, env );
-            startNTP( cfg, env );
-        }
-    }
-
-
-    private void ensureLdifFileBase( DirContext root )
-    {
-        Attributes entry = new BasicAttributes( "ou", "loadedLdifFiles", true );
-        entry.put( "objectClass", "top" );
-        entry.get( "objectClass" ).add( "organizationalUnit" );
-        try
-        {
-            root.createSubcontext( LDIF_FILES_DN, entry );
-            log.info( "Creating " + LDIF_FILES_DN );
-        }
-        catch ( NamingException e )
-        {
-            log.info( LDIF_FILES_DN + " exists" );
-        }
-    }
-
-    private final static String WINDOWSFILE_ATTR = "windowsFilePath";
-    private final static String UNIXFILE_ATTR = "unixFilePath";
-    private final static String WINDOWSFILE_OC = "windowsFile";
-    private final static String UNIXFILE_OC = "unixFile";
-
-
-    private void addFileEntry( DirContext root, File ldif ) throws NamingException
-    {
-        String rdnAttr = File.separatorChar == '\\' ? WINDOWSFILE_ATTR : UNIXFILE_ATTR;
-        String oc = File.separatorChar == '\\' ? WINDOWSFILE_OC : UNIXFILE_OC;
-        StringBuffer buf = new StringBuffer();
-        buf.append( rdnAttr );
-        buf.append( "=" );
-        buf.append( getCanonical( ldif ) );
-        buf.append( "," );
-        buf.append( LDIF_FILES_DN );
-
-        Attributes entry = new BasicAttributes( rdnAttr, getCanonical( ldif ), true );
-        entry.put( "objectClass", "top" );
-        entry.get( "objectClass" ).add( oc );
-        root.createSubcontext( buf.toString(), entry );
-    }
-
-
-    private Attributes getLdifFileEntry( DirContext root, File ldif )
-    {
-        String rdnAttr = File.separatorChar == '\\' ? WINDOWSFILE_ATTR : UNIXFILE_ATTR;
-        StringBuffer buf = new StringBuffer();
-        buf.append( rdnAttr );
-        buf.append( "=" );
-        buf.append( getCanonical( ldif ) );
-        buf.append( "," );
-        buf.append( LDIF_FILES_DN );
-
-        try
-        {
-            return root.getAttributes( buf.toString(), new String[]
-                { "createTimestamp" } );
-        }
-        catch ( NamingException e )
-        {
-            return null;
-        }
-    }
-
-
-    private String getCanonical( File file )
-    {
-        String canonical = null;
-        try
-        {
-            canonical = file.getCanonicalPath();
-        }
-        catch ( IOException e )
-        {
-            log.error( "could not get canonical path", e );
-            return null;
-        }
-
-        return StringUtils.replace( canonical, "\\", "\\\\" );
-    }
-
-
-    private void loadLdifs( DirectoryService service ) throws NamingException
-    {
-        ServerStartupConfiguration cfg = ( ServerStartupConfiguration ) service.getConfiguration()
-            .getStartupConfiguration();
-
-        // log and bail if property not set
-        if ( cfg.getLdifDirectory() == null )
-        {
-            log.info( "LDIF load directory not specified.  No LDIF files will be loaded." );
-            return;
-        }
-
-        // log and bail if LDIF directory does not exists
-        if ( !cfg.getLdifDirectory().exists() )
-        {
-            log.warn( "LDIF load directory '" + getCanonical( cfg.getLdifDirectory() )
-                + "' does not exist.  No LDIF files will be loaded." );
-            return;
-        }
-
-        // get an initial context to the rootDSE for creating the LDIF entries
-        Hashtable env = ( Hashtable ) service.getConfiguration().getEnvironment().clone();
-        env.put( Context.PROVIDER_URL, "" );
-        DirContext root = ( DirContext ) this.getInitialContext( env );
-
-        // make sure the configuration area for loaded ldif files is present
-        ensureLdifFileBase( root );
-
-        // if ldif directory is a file try to load it
-        if ( !cfg.getLdifDirectory().isDirectory() )
-        {
-            log.info( "LDIF load directory '" + getCanonical( cfg.getLdifDirectory() )
-                + "' is a file.  Will attempt to load as LDIF." );
-            Attributes fileEntry = getLdifFileEntry( root, cfg.getLdifDirectory() );
-            if ( fileEntry != null )
-            {
-                String time = ( String ) fileEntry.get( "createTimestamp" ).get();
-                log.info( "Load of LDIF file '" + getCanonical( cfg.getLdifDirectory() )
-                    + "' skipped.  It has already been loaded on " + time + "." );
-                return;
-            }
-            LdifFileLoader loader = new LdifFileLoader( root, cfg.getLdifDirectory(), cfg.getLdifFilters() );
-            loader.execute();
-
-            addFileEntry( root, cfg.getLdifDirectory() );
-            return;
-        }
-
-        // get all the ldif files within the directory (should be sorted alphabetically)
-        File[] ldifFiles = cfg.getLdifDirectory().listFiles( new FileFilter()
-        {
-            public boolean accept( File pathname )
-            {
-                boolean isLdif = pathname.getName().toLowerCase().endsWith( ".ldif" );
-                return pathname.isFile() && pathname.canRead() && isLdif;
-            }
-        } );
-
-        // log and bail if we could not find any LDIF files
-        if ( ldifFiles == null || ldifFiles.length == 0 )
-        {
-            log.warn( "LDIF load directory '" + getCanonical( cfg.getLdifDirectory() )
-                + "' does not contain any LDIF files.  No LDIF files will be loaded." );
-            return;
-        }
-
-        // load all the ldif files and load each one that is loaded
-        for ( int ii = 0; ii < ldifFiles.length; ii++ )
-        {
-            Attributes fileEntry = getLdifFileEntry( root, ldifFiles[ii] );
-            if ( fileEntry != null )
-            {
-                String time = ( String ) fileEntry.get( "createTimestamp" ).get();
-                log.info( "Load of LDIF file '" + getCanonical( ldifFiles[ii] )
-                    + "' skipped.  It has already been loaded on " + time + "." );
-                continue;
-            }
-            LdifFileLoader loader = new LdifFileLoader( root, ldifFiles[ii], cfg.getLdifFilters() );
-            int count = loader.execute();
-            log.info( "Loaded " + count + " entries from LDIF file '" + getCanonical( ldifFiles[ii] ) + "'" );
-            if ( fileEntry == null )
-            {
-                addFileEntry( root, ldifFiles[ii] );
-            }
         }
     }
 
@@ -390,65 +122,12 @@
     }
 
 
-    /**
-     * Starts up the LDAPS protocol provider to service LDAPS requests
-     *
-     * @throws NamingException if there are problems starting the LDAPS provider
-     */
-    private void startLDAPS( ServerStartupConfiguration cfg, Hashtable env ) throws NamingException
-    {
-        // Skip if disabled
-        if ( !cfg.isEnableLdaps() )
-        {
-            return;
-        }
-
-        // We use the reflection API in case this is not running on JDK 1.5+.
-        IoFilterChainBuilder chain;
-        try
-        {
-            chain = ( IoFilterChainBuilder ) Class.forName( "org.apache.directory.server.ssl.LdapsInitializer", true,
-                ServerContextFactory.class.getClassLoader() ).getMethod( "init", new Class[]
-                { ServerStartupConfiguration.class } ).invoke( null, new Object[]
-                { cfg } );
-        }
-        catch ( InvocationTargetException e )
-        {
-            if ( e.getCause() instanceof NamingException )
-            {
-                throw ( NamingException ) e.getCause();
-            }
-            else
-            {
-                throw ( NamingException ) new NamingException( "Failed to load LDAPS initializer." ).initCause( e
-                    .getCause() );
-            }
-        }
-        catch ( Exception e )
-        {
-            throw ( NamingException ) new NamingException( "Failed to load LDAPS initializer." ).initCause( e );
-        }
-
-        startLDAP0( cfg, env, cfg.getLdapsPort(), chain );
-    }
-
-
     private void startLDAP0( ServerStartupConfiguration cfg, Hashtable env, int port,
         IoFilterChainBuilder chainBuilder ) throws LdapNamingException, LdapConfigurationException
     {
         // Register all extended operation handlers.
         LdapProtocolProvider protocolProvider = new LdapProtocolProvider( ( Hashtable ) env.clone() );
 
-        for ( Iterator i = cfg.getExtendedOperationHandlers().iterator(); i.hasNext(); )
-        {
-            ExtendedOperationHandler h = ( ExtendedOperationHandler ) i.next();
-            protocolProvider.addExtendedOperationHandler( h );
-            log.info( "Added Extended Request Handler: " + h.getOid() );
-            h.setLdapProvider( protocolProvider );
-            DirectoryPartitionNexus nexus = directoryService.getConfiguration().getPartitionNexus();
-            nexus.registerSupportedExtensions( h.getExtensionOids() );
-        }
-
         try
         {
             // Disable the disconnection of the clients on unbind
@@ -471,63 +150,6 @@
             lce.setRootCause( e );
             log.error( msg, e );
             throw lce;
-        }
-    }
-
-
-    private void startKerberos( ServerStartupConfiguration cfg, Hashtable env )
-    {
-        if ( cfg.isEnableKerberos() )
-        {
-            try
-            {
-                KdcConfiguration kdcConfiguration = new KdcConfiguration( env, LoadStrategy.PROPS );
-                PrincipalStore kdcStore = new JndiPrincipalStoreImpl( kdcConfiguration, this );
-                tcpKdcServer = new KerberosServer( kdcConfiguration, tcpAcceptor, kdcStore );
-                udpKdcServer = new KerberosServer( kdcConfiguration, udpAcceptor, kdcStore );
-            }
-            catch ( Throwable t )
-            {
-                log.error( "Failed to start the Kerberos service", t );
-            }
-        }
-    }
-
-
-    private void startChangePassword( ServerStartupConfiguration cfg, Hashtable env )
-    {
-        if ( cfg.isEnableChangePassword() )
-        {
-            try
-            {
-                ChangePasswordConfiguration changePasswordConfiguration = new ChangePasswordConfiguration( env,
-                    LoadStrategy.PROPS );
-                PrincipalStore store = new JndiPrincipalStoreImpl( changePasswordConfiguration, this );
-                tcpChangePasswordServer = new ChangePasswordServer( changePasswordConfiguration, tcpAcceptor, store );
-                udpChangePasswordServer = new ChangePasswordServer( changePasswordConfiguration, udpAcceptor, store );
-            }
-            catch ( Throwable t )
-            {
-                log.error( "Failed to start the Change Password service", t );
-            }
-        }
-    }
-
-
-    private void startNTP( ServerStartupConfiguration cfg, Hashtable env )
-    {
-        if ( cfg.isEnableNtp() )
-        {
-            try
-            {
-                NtpConfiguration ntpConfig = new NtpConfiguration( env, LoadStrategy.PROPS );
-                tcpNtpServer = new NtpServer( ntpConfig, tcpAcceptor );
-                udpNtpServer = new NtpServer( ntpConfig, udpAcceptor );
-            }
-            catch ( Throwable t )
-            {
-                log.error( "Failed to start the NTP service", t );
-            }
         }
     }
 



Mime
View raw message