directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1134212 - in /directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core: LdapPrincipal.java interceptor/context/BindOperationContext.java
Date Fri, 10 Jun 2011 07:06:59 GMT
Author: elecharny
Date: Fri Jun 10 07:06:59 2011
New Revision: 1134212

URL: http://svn.apache.org/viewvc?rev=1134212&view=rev
Log:
Forgot to commit two files (injection of IoSession into LdapPrincipal and BindContext)

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapPrincipal.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/BindOperationContext.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapPrincipal.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapPrincipal.java?rev=1134212&r1=1134211&r2=1134212&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapPrincipal.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapPrincipal.java
Fri Jun 10 07:06:59 2011
@@ -20,6 +20,7 @@
 package org.apache.directory.server.core;
 
 
+import java.net.SocketAddress;
 import java.security.Principal;
 
 import org.apache.directory.server.i18n.I18n;
@@ -27,7 +28,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
-import org.apache.directory.shared.util.Strings;
 
 
 /**
@@ -53,6 +53,9 @@ public final class LdapPrincipal impleme
     
     /** The SchemaManager */
     private SchemaManager schemaManager;
+    
+    private SocketAddress clientAddress;
+    private SocketAddress serverAddress;
 
 
     /**
@@ -210,11 +213,72 @@ public final class LdapPrincipal impleme
 
 
     /**
+     * @return the clientAddress
+     */
+    public SocketAddress getClientAddress()
+    {
+        return clientAddress;
+    }
+
+
+    /**
+     * @param clientAddress the clientAddress to set
+     */
+    public void setClientAddress( SocketAddress clientAddress )
+    {
+        this.clientAddress = clientAddress;
+    }
+
+
+    /**
+     * @return the serverAddress
+     */
+    public SocketAddress getServerAddress()
+    {
+        return serverAddress;
+    }
+
+
+    /**
+     * @param serverAddress the serverAddress to set
+     */
+    public void setServerAddress( SocketAddress serverAddress )
+    {
+        this.serverAddress = serverAddress;
+    }
+
+
+    /**
      * Returns string representation of the normalized distinguished name
      * of this principal.
      */
     public String toString()
     {
-        return (dn.isSchemaAware() ? "(n)" : "" ) + "['" + dn.getName() + "', '" + Strings.utf8ToString(userPassword)
+"']'";
+        StringBuilder sb = new StringBuilder();
+        
+        if ( dn.isSchemaAware() )
+        {
+            sb.append( "(n)" );
+        }
+
+        sb.append( "['" );
+        sb.append( dn.getName() );
+        sb.append( "'" );
+        
+        if ( clientAddress != null )
+        {
+            sb.append( ", client@" );
+            sb.append( clientAddress );
+        }
+        
+        if ( serverAddress != null )
+        {
+            sb.append( ", server@" );
+            sb.append( serverAddress );
+        }
+        
+        sb.append( "]" );
+        
+        return sb.toString();
     }
 }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/BindOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/BindOperationContext.java?rev=1134212&r1=1134211&r2=1134212&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/BindOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/BindOperationContext.java
Fri Jun 10 07:06:59 2011
@@ -28,6 +28,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.exception.LdapAuthenticationException;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
 import org.apache.directory.shared.util.Strings;
+import org.apache.mina.core.session.IoSession;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -56,6 +57,9 @@ public class BindOperationContext extend
     private boolean collateralOperation;
     
     private ReferralHandlingMode referralHandlingMode;
+    
+    /** The IoSession if any */
+    private IoSession ioSession;
 
     
     /**
@@ -246,4 +250,22 @@ public class BindOperationContext extend
     {
         throw new NotImplementedException( I18n.err( I18n.ERR_323 ) );
     }
+
+
+    /**
+     * @return the ioSession
+     */
+    public IoSession getIoSession()
+    {
+        return ioSession;
+    }
+
+
+    /**
+     * @param ioSession the ioSession to set
+     */
+    public void setIoSession( IoSession ioSession )
+    {
+        this.ioSession = ioSession;
+    }
 }



Mime
View raw message