directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: rev 56093 - incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/kdc/replay
Date Sun, 31 Oct 2004 00:22:35 GMT
Author: erodriguez
Date: Sat Oct 30 17:22:35 2004
New Revision: 56093

Modified:
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/kdc/replay/InMemoryReplayCache.java
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/kdc/replay/ReplayCache.java
Log:
Replacing Realm and PrincipalName with JAAS KerberosPrincipal.

Modified: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/kdc/replay/InMemoryReplayCache.java
==============================================================================
--- incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/kdc/replay/InMemoryReplayCache.java
(original)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/kdc/replay/InMemoryReplayCache.java
Sat Oct 30 17:22:35 2004
@@ -20,14 +20,16 @@
 
 import java.util.*;
 
+import javax.security.auth.kerberos.*;
+
 public class InMemoryReplayCache implements ReplayCache {
 	
 	private static final long TWO_WEEKS = 1000 * 60 * 60 * 24 * 14;
 
     private List list = new ArrayList();
 
-    public synchronized boolean isReplay(KerberosTime clientTime, PrincipalName clientName,
Realm clientRealm) {
-        ReplayCacheEntry testEntry = new ReplayCacheEntry(clientTime, clientName, clientRealm);
+    public synchronized boolean isReplay(KerberosTime clientTime, KerberosPrincipal clientPrincipal)
{
+        ReplayCacheEntry testEntry = new ReplayCacheEntry(clientTime, clientPrincipal);
         Iterator it = list.iterator();
         while (it.hasNext()) {
             ReplayCacheEntry entry = (ReplayCacheEntry)it.next();
@@ -37,8 +39,8 @@
         return false;
     }
 
-    public synchronized void save(KerberosTime clientTime, PrincipalName clientName, Realm
clientRealm) {
-        list.add(new ReplayCacheEntry(clientTime, clientName, clientRealm));
+    public synchronized void save(KerberosTime clientTime, KerberosPrincipal clientPrincipal)
{
+        list.add(new ReplayCacheEntry(clientTime, clientPrincipal));
         purgeExpired();
     }
     
@@ -61,19 +63,16 @@
     private class ReplayCacheEntry {
 
     	private KerberosTime      _clientTime;
-    	private PrincipalName     _clientName;
-    	private Realm             _clientRealm;
+    	private KerberosPrincipal _clientPrincipal;
     	
-    	public ReplayCacheEntry(KerberosTime time, PrincipalName name, Realm realm) {
-    		_clientTime  = time;
-    		_clientName  = name;
-    		_clientRealm = realm;
+    	public ReplayCacheEntry(KerberosTime time, KerberosPrincipal principal) {
+    		_clientTime      = time;
+    		_clientPrincipal = principal;
     	}
     	
         public boolean equals(ReplayCacheEntry other) {
             return _clientTime.equals(other._clientTime) && 
-    				_clientName.equals(other._clientName) &&
-            		_clientRealm.equals(other._clientRealm);
+    				_clientPrincipal.equals(other._clientPrincipal);
         }
         
         public boolean olderThan(KerberosTime time) {

Modified: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/kdc/replay/ReplayCache.java
==============================================================================
--- incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/kdc/replay/ReplayCache.java
(original)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/kdc/replay/ReplayCache.java
Sat Oct 30 17:22:35 2004
@@ -18,10 +18,12 @@
 
 import org.apache.kerberos.messages.value.*;
 
+import javax.security.auth.kerberos.*;
+
 public interface ReplayCache {
 
-    boolean isReplay(KerberosTime clientTime, PrincipalName clientName, Realm clientRealm);
+    boolean isReplay(KerberosTime clientTime, KerberosPrincipal clientPrincipal);
     
-    void save(KerberosTime clientTime, PrincipalName clientName, Realm clientRealm);
+    void save(KerberosTime clientTime, KerberosPrincipal clientPrincipal);
 }
 

Mime
View raw message