directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r158650 - in directory/protocol-providers/changepw/trunk: project.xml src/java/org/apache/changepw/protocol/ChangePasswordProtocolHandler.java src/java/org/apache/changepw/protocol/ChangePasswordProtocolProvider.java src/java/org/apache/changepw/service/ChangePasswordServiceImpl.java
Date Tue, 22 Mar 2005 19:57:50 GMT
Author: erodriguez
Date: Tue Mar 22 11:57:49 2005
New Revision: 158650

URL: http://svn.apache.org/viewcvs?view=rev&rev=158650
Log:
o  Updated POM with new MINA groupId.
o  Updated protocol handling to use new store command pattern.


Modified:
    directory/protocol-providers/changepw/trunk/project.xml
    directory/protocol-providers/changepw/trunk/src/java/org/apache/changepw/protocol/ChangePasswordProtocolHandler.java
    directory/protocol-providers/changepw/trunk/src/java/org/apache/changepw/protocol/ChangePasswordProtocolProvider.java
    directory/protocol-providers/changepw/trunk/src/java/org/apache/changepw/service/ChangePasswordServiceImpl.java

Modified: directory/protocol-providers/changepw/trunk/project.xml
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/changepw/trunk/project.xml?view=diff&r1=158649&r2=158650
==============================================================================
--- directory/protocol-providers/changepw/trunk/project.xml (original)
+++ directory/protocol-providers/changepw/trunk/project.xml Tue Mar 22 11:57:49 2005
@@ -92,7 +92,7 @@
       <version>0.4-SNAPSHOT</version>
     </dependency>
     <dependency>
-      <groupId>directory</groupId>
+      <groupId>directory-network</groupId>
       <artifactId>mina</artifactId>
       <version>0.7-SNAPSHOT</version>
     </dependency>

Modified: directory/protocol-providers/changepw/trunk/src/java/org/apache/changepw/protocol/ChangePasswordProtocolHandler.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/changepw/trunk/src/java/org/apache/changepw/protocol/ChangePasswordProtocolHandler.java?view=diff&r1=158649&r2=158650
==============================================================================
--- directory/protocol-providers/changepw/trunk/src/java/org/apache/changepw/protocol/ChangePasswordProtocolHandler.java
(original)
+++ directory/protocol-providers/changepw/trunk/src/java/org/apache/changepw/protocol/ChangePasswordProtocolHandler.java
Tue Mar 22 11:57:49 2005
@@ -22,7 +22,6 @@
 import org.apache.changepw.messages.ChangePasswordRequest;
 import org.apache.changepw.service.ChangePasswordServiceImpl;
 import org.apache.kerberos.service.KdcConfiguration;
-import org.apache.kerberos.store.PasswordStore;
 import org.apache.kerberos.store.PrincipalStore;
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.protocol.ProtocolHandler;
@@ -33,15 +32,12 @@
 {
 	private KdcConfiguration config;
 	private PrincipalStore store;
-	private PasswordStore change;
 	
 	
-	public ChangePasswordProtocolHandler( KdcConfiguration config, PrincipalStore store,
-	        PasswordStore change )
+	public ChangePasswordProtocolHandler( KdcConfiguration config, PrincipalStore store )
     {
 		this.config = config;
 		this.store  = store;
-		this.change = change;
 	}
 	
 	
@@ -72,7 +68,7 @@
     {
         System.out.println( session.getRemoteAddress() + " RCVD: " + message );
         
-        ChangePasswordService changepwService = new ChangePasswordServiceImpl( config, store,
change );
+        ChangePasswordService changepwService = new ChangePasswordServiceImpl( config, store
);
         
         try
 		{

Modified: directory/protocol-providers/changepw/trunk/src/java/org/apache/changepw/protocol/ChangePasswordProtocolProvider.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/changepw/trunk/src/java/org/apache/changepw/protocol/ChangePasswordProtocolProvider.java?view=diff&r1=158649&r2=158650
==============================================================================
--- directory/protocol-providers/changepw/trunk/src/java/org/apache/changepw/protocol/ChangePasswordProtocolProvider.java
(original)
+++ directory/protocol-providers/changepw/trunk/src/java/org/apache/changepw/protocol/ChangePasswordProtocolProvider.java
Tue Mar 22 11:57:49 2005
@@ -18,7 +18,6 @@
 package org.apache.changepw.protocol;
 
 import org.apache.kerberos.service.KdcConfiguration;
-import org.apache.kerberos.store.PasswordStore;
 import org.apache.kerberos.store.PrincipalStore;
 import org.apache.mina.protocol.ProtocolCodecFactory;
 import org.apache.mina.protocol.ProtocolDecoder;
@@ -49,10 +48,9 @@
     };
     
     
-	public ChangePasswordProtocolProvider( KdcConfiguration config, PrincipalStore store,
-	        PasswordStore change )
+	public ChangePasswordProtocolProvider( KdcConfiguration config, PrincipalStore store )
     {
-		HANDLER = new ChangePasswordProtocolHandler( config, store, change );
+		HANDLER = new ChangePasswordProtocolHandler( config, store );
 	}
 	
 	

Modified: directory/protocol-providers/changepw/trunk/src/java/org/apache/changepw/service/ChangePasswordServiceImpl.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/changepw/trunk/src/java/org/apache/changepw/service/ChangePasswordServiceImpl.java?view=diff&r1=158649&r2=158650
==============================================================================
--- directory/protocol-providers/changepw/trunk/src/java/org/apache/changepw/service/ChangePasswordServiceImpl.java
(original)
+++ directory/protocol-providers/changepw/trunk/src/java/org/apache/changepw/service/ChangePasswordServiceImpl.java
Tue Mar 22 11:57:49 2005
@@ -52,8 +52,8 @@
 import org.apache.kerberos.messages.value.HostAddress;
 import org.apache.kerberos.service.KdcConfiguration;
 import org.apache.kerberos.service.KerberosService;
-import org.apache.kerberos.store.PasswordStore;
 import org.apache.kerberos.store.PrincipalStore;
+import org.apache.kerberos.store.operations.ChangePassword;
 
 
 /**
@@ -62,14 +62,14 @@
 public class ChangePasswordServiceImpl extends KerberosService implements ChangePasswordService
 {
     private KdcConfiguration config;
-    private PasswordStore change;
+    private PrincipalStore store;
     
-	public ChangePasswordServiceImpl( KdcConfiguration config, PrincipalStore store, PasswordStore
change )
+	public ChangePasswordServiceImpl( KdcConfiguration config, PrincipalStore store )
     {
 		super( config, store );
 
 		this.config = config;
-		this.change = change;
+		this.store = store;
 	}
 	
 	public ChangePasswordReply getReplyFor( ChangePasswordRequest request )
@@ -140,8 +140,15 @@
 		System.out.println( "Got client password " + password );
 		
 		// store password in database
-		String principalName = change.changePassword( clientPrincipal, newKey.getEncoded() );
-		System.out.println( "Successfully modified principal named " + principalName );
+		try
+		{
+			String principalName = (String)store.execute( new ChangePassword( clientPrincipal, newKey
) );
+			System.out.println( "Successfully modified principal " + principalName );
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace();
+		}
 		
 		// begin building reply
 		



Mime
View raw message