directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: rev 57011 - incubator/directory/kerberos/trunk/kerberos/src/java/org/apache/kerberos/changepw
Date Tue, 09 Nov 2004 10:31:42 GMT
Author: erodriguez
Date: Tue Nov  9 02:31:41 2004
New Revision: 57011

Modified:
   incubator/directory/kerberos/trunk/kerberos/src/java/org/apache/kerberos/changepw/ChangePasswordDispatcher.java
Log:
Caught simple bug where changepw error service was not initialized.

Modified: incubator/directory/kerberos/trunk/kerberos/src/java/org/apache/kerberos/changepw/ChangePasswordDispatcher.java
==============================================================================
--- incubator/directory/kerberos/trunk/kerberos/src/java/org/apache/kerberos/changepw/ChangePasswordDispatcher.java
(original)
+++ incubator/directory/kerberos/trunk/kerberos/src/java/org/apache/kerberos/changepw/ChangePasswordDispatcher.java
Tue Nov  9 02:31:41 2004
@@ -16,61 +16,69 @@
  */
 package org.apache.kerberos.changepw;
 
-import org.apache.kerberos.changepw.io.*;
-import org.apache.kerberos.changepw.messages.*;
-import org.apache.kerberos.changepw.store.*;
-import org.apache.kerberos.crypto.*;
-import org.apache.kerberos.kdc.*;
-import org.apache.kerberos.kdc.store.*;
+import org.apache.kerberos.changepw.io.ChangePasswordErrorEncoder;
+import org.apache.kerberos.changepw.io.ChangePasswordReplyEncoder;
+import org.apache.kerberos.changepw.io.ChangePasswordRequestDecoder;
+import org.apache.kerberos.changepw.messages.ChangePasswordError;
+import org.apache.kerberos.changepw.messages.ChangePasswordReply;
+import org.apache.kerberos.changepw.messages.ChangePasswordRequest;
+import org.apache.kerberos.changepw.store.PasswordStore;
+import org.apache.kerberos.crypto.CryptoService;
+import org.apache.kerberos.kdc.KdcConfiguration;
+import org.apache.kerberos.kdc.KerberosException;
+import org.apache.kerberos.kdc.store.BootstrapStore;
+import org.apache.kerberos.kdc.store.PrincipalStore;
 
-import java.io.*;
+import java.io.IOException;
 
-public class ChangePasswordDispatcher {
+public class ChangePasswordDispatcher
+{
+	private PrincipalStore   bootstrap;
+	private CryptoService    cryptoService;
+	private KdcConfiguration config;
+	private PasswordStore    store;
 	
-	private PrincipalStore   _bootstrap;
-	private CryptoService    _cryptoService;
-	private KdcConfiguration _config;
-	private PasswordStore    _store;
+	private ChangePasswordService      changepwService;
+	private ChangePasswordErrorService errorService;
 	
-	private ChangePasswordService      _changepwService;
-	private ChangePasswordErrorService _errorService;
-	
-	public ChangePasswordDispatcher(KdcConfiguration config, BootstrapStore bootstrap, PasswordStore
store) {
-		
-		_config    = config;
-		_bootstrap = bootstrap;
-		_store     = store;
+	public ChangePasswordDispatcher(KdcConfiguration config, BootstrapStore bootstrap, PasswordStore
store)
+    {
+		this.config    = config;
+		this.bootstrap = bootstrap;
+		this.store     = store;
 		
-		_cryptoService   = new CryptoService(_config);
-		_changepwService = new ChangePasswordService(_store, _bootstrap, _cryptoService, _config);
+		cryptoService   = new CryptoService();
+        errorService    = new ChangePasswordErrorService(this.config);
+		changepwService = new ChangePasswordService(this.store, this.bootstrap, cryptoService,
this.config);
 	}
 	
-	public byte[] dispatch(byte[] requestBytes) throws IOException {
-		
+	public byte[] dispatch(byte[] requestBytes) throws IOException
+    {
 		byte[] reply = null;
 		
-		try {
+		try
+        {
 			ChangePasswordRequestDecoder decoder = new ChangePasswordRequestDecoder();
 			ChangePasswordRequest changepwRequest = decoder.decode(requestBytes);
 			
-			ChangePasswordReply changepwReply = _changepwService.getReplyFor(changepwRequest);
+			ChangePasswordReply changepwReply = changepwService.getReplyFor(changepwRequest);
 			
 			ChangePasswordReplyEncoder encoder = new ChangePasswordReplyEncoder();
 			reply = encoder.encode(changepwReply);
-			
-		} catch (KerberosException ke) {
-			
+		}
+        catch (KerberosException ke)
+        {
 			System.out.println("Returning error message:  " + ke.getMessage());
-			ChangePasswordError errorMessage = _errorService.getReplyFor(ke);
+			ChangePasswordError errorMessage = errorService.getReplyFor(ke);
 			ChangePasswordErrorEncoder errorEncoder = new ChangePasswordErrorEncoder();
 			reply = errorEncoder.encode(errorMessage);
-			
-		} catch (IOException ioe) {
-			
+		}
+        catch (IOException ioe)
+        {
 			System.out.println("Returning error message:  " + ioe.getMessage());
 			ioe.printStackTrace();
 			ChangePasswordError errorMessage =
-				_errorService.getReplyFor(ChangePasswordException.KRB5_KPASSWD_MALFORMED);
+				errorService.getReplyFor(ChangePasswordException.KRB5_KPASSWD_MALFORMED);
 			ChangePasswordErrorEncoder errorEncoder = new ChangePasswordErrorEncoder();
 			reply = errorEncoder.encode(errorMessage);
 		}

Mime
View raw message