directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r894381 - in /directory/apacheds/branches/apacheds-schema: core/src/main/java/org/apache/directory/server/core/security/ protocol-changepw/src/main/java/org/apache/directory/server/changepw/ protocol-dns/src/main/java/org/apache/directory/s...
Date Tue, 29 Dec 2009 13:25:32 GMT
Author: elecharny
Date: Tue Dec 29 13:25:31 2009
New Revision: 894381

URL: http://svn.apache.org/viewvc?rev=894381&view=rev
Log:
o Normalized the principal before using it
o Transports are now stored in a Set instead of an Array

Modified:
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java
    directory/apacheds/branches/apacheds-schema/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordServer.java
    directory/apacheds/branches/apacheds-schema/protocol-dns/src/main/java/org/apache/directory/server/dns/DnsServer.java
    directory/apacheds/branches/apacheds-schema/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java
    directory/apacheds/branches/apacheds-schema/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java
    directory/apacheds/branches/apacheds-schema/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java?rev=894381&r1=894380&r2=894381&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java
Tue Dec 29 13:25:31 2009
@@ -79,6 +79,7 @@
     private ServerEntry getTlsEntry() throws Exception
     {
         LdapDN adminDn = new LdapDN( ServerDNConstants.ADMIN_SYSTEM_DN );
+        adminDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
         LdapPrincipal principal = new LdapPrincipal( adminDn, AuthenticationLevel.SIMPLE
);
         CoreSession session = directoryService.getSession( principal );
         return session.lookup( adminDn );

Modified: directory/apacheds/branches/apacheds-schema/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordServer.java?rev=894381&r1=894380&r2=894381&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordServer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordServer.java
Tue Dec 29 13:25:31 2009
@@ -273,7 +273,7 @@
     {
         PrincipalStore store = new DirectoryPrincipalStore( getDirectoryService(), new LdapDN(this.getSearchBaseDn())
 );
         
-        if ( ( transports == null ) || ( transports.length == 0 ) )
+        if ( ( transports == null ) || ( transports.size() == 0 ) )
         {
             // Default to UDP with port 464
             // We have to create a DatagramAcceptor

Modified: directory/apacheds/branches/apacheds-schema/protocol-dns/src/main/java/org/apache/directory/server/dns/DnsServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/protocol-dns/src/main/java/org/apache/directory/server/dns/DnsServer.java?rev=894381&r1=894380&r2=894381&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/protocol-dns/src/main/java/org/apache/directory/server/dns/DnsServer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/protocol-dns/src/main/java/org/apache/directory/server/dns/DnsServer.java
Tue Dec 29 13:25:31 2009
@@ -80,7 +80,7 @@
     {
         RecordStore store = new JndiRecordStoreImpl( getSearchBaseDn(), getSearchBaseDn(),
getDirectoryService() );
 
-        if ( ( transports == null ) || ( transports.length == 0 ) )
+        if ( ( transports == null ) || ( transports.size() == 0 ) )
         {
             // Default to UDP with port 53
             // We have to create a DatagramAcceptor

Modified: directory/apacheds/branches/apacheds-schema/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java?rev=894381&r1=894380&r2=894381&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java
Tue Dec 29 13:25:31 2009
@@ -444,7 +444,7 @@
         // TODO - for now ignoring this catalog crap
         store = new DirectoryPrincipalStore( getDirectoryService(), new LdapDN(this.getSearchBaseDn())
 );
         
-        if ( ( transports == null ) || ( transports.length == 0 ) )
+        if ( ( transports == null ) || ( transports.size() == 0 ) )
         {
             // Default to UDP with port 88
             // We have to create a DatagramAcceptor

Modified: directory/apacheds/branches/apacheds-schema/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java?rev=894381&r1=894380&r2=894381&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java
Tue Dec 29 13:25:31 2009
@@ -20,6 +20,8 @@
 package org.apache.directory.server.ntp;
 
 
+import java.io.IOException;
+
 import org.apache.directory.server.ntp.protocol.NtpProtocolCodecFactory;
 import org.apache.directory.server.ntp.protocol.NtpProtocolHandler;
 import org.apache.directory.server.protocol.shared.AbstractProtocolService;
@@ -35,8 +37,6 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.IOException;
-
 
 /**
  * Contains the configuration parameters for the NTP protocol provider.
@@ -87,7 +87,7 @@
         DefaultIoFilterChainBuilder ntpChain = new DefaultIoFilterChainBuilder();
         ntpChain.addLast( "codec", new ProtocolCodecFilter( NtpProtocolCodecFactory.getInstance()
) );
         
-        if ( ( transports == null ) || ( transports.length == 0 ) )
+        if ( ( transports == null ) || ( transports.size() == 0 ) )
         {
             // Default to UDP with port 123
             // We have to create a DatagramAcceptor

Modified: directory/apacheds/branches/apacheds-schema/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java?rev=894381&r1=894380&r2=894381&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java
(original)
+++ directory/apacheds/branches/apacheds-schema/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java
Tue Dec 29 13:25:31 2009
@@ -19,6 +19,9 @@
 package org.apache.directory.server.protocol.shared;
 
 
+import java.util.HashSet;
+import java.util.Set;
+
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.protocol.shared.transport.Transport;
 import org.apache.mina.transport.socket.DatagramAcceptor;
@@ -48,7 +51,7 @@
     private String serviceName;
     
     /** The service transports. We may have more than one */
-    protected Transport[] transports;
+    protected Set<Transport> transports = new HashSet<Transport>();
     
     /** directory service core where protocol data is backed */
     private DirectoryService directoryService;
@@ -142,7 +145,7 @@
      */
     public Transport[] getTransports()
     {
-        return transports;
+        return transports.toArray( new Transport[]{} );
     }
 
 
@@ -152,17 +155,31 @@
      */
     public void setTransports( Transport... transports )
     {
-        if ( transports != null ) 
+        for ( Transport transport : transports ) 
+        {
+            this.transports.add( transport );
+            
+            if ( transport.getAcceptor() == null )
+            {
+                transport.init();
+            }
+        }
+    }
+    
+    
+    /**
+     * Add underlying transports
+     * @param transport The transports
+     */
+    public void addTransports( Transport... transports )
+    {
+        for ( Transport transport : transports )
         {
-            this.transports = new Transport[ transports.length ];
-            System.arraycopy( transports, 0, this.transports, 0, transports.length );
+            this.transports.add( transport );
             
-            for ( Transport transport:transports )
+            if ( transport.getAcceptor() == null )
             {
-                if ( transport.getAcceptor() == null )
-                {
-                    transport.init();
-                }
+                transport.init();
             }
         }
     }



Mime
View raw message