directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1041322 - in /directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store: PrincipalStoreEntry.java PrincipalStoreEntryModifier.java operations/GetPrincipal.java
Date Thu, 02 Dec 2010 10:24:13 GMT
Author: kayyagari
Date: Thu Dec  2 10:24:12 2010
New Revision: 1041322

URL: http://svn.apache.org/viewvc?rev=1041322&view=rev
Log:
o replaced KerberosPrincipal with PrincipalName
o removed jndi classes

Modified:
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntry.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntryModifier.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntry.java?rev=1041322&r1=1041321&r2=1041322&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntry.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntry.java
Thu Dec  2 10:24:12 2010
@@ -22,12 +22,11 @@ package org.apache.directory.server.kerb
 
 import java.util.Map;
 
-import javax.security.auth.kerberos.KerberosPrincipal;
-
 import org.apache.directory.server.kerberos.shared.messages.value.types.SamType;
 import org.apache.directory.shared.kerberos.KerberosTime;
 import org.apache.directory.shared.kerberos.codec.types.EncryptionType;
 import org.apache.directory.shared.kerberos.components.EncryptionKey;
+import org.apache.directory.shared.kerberos.components.PrincipalName;
 
 
 /**
@@ -38,7 +37,7 @@ public class PrincipalStoreEntry
     // principal
     private String distinguishedName;
     private String commonName;
-    private KerberosPrincipal principal;
+    private PrincipalName principal;
     private String realmName;
 
     // uidObject
@@ -61,7 +60,7 @@ public class PrincipalStoreEntry
     private Map<EncryptionType, EncryptionKey> keyMap;
 
 
-    PrincipalStoreEntry( String distinguishedName, String commonName, String userId, KerberosPrincipal
principal,
+    PrincipalStoreEntry( String distinguishedName, String commonName, String userId, PrincipalName
principal,
         int keyVersionNumber, KerberosTime validStart, KerberosTime validEnd, KerberosTime
passwordEnd, int maxLife,
         int maxRenew, int kdcFlags, Map<EncryptionType, EncryptionKey> keyMap, String
realmName, SamType samType,
         boolean disabled, boolean lockedOut, KerberosTime expiration )
@@ -223,7 +222,7 @@ public class PrincipalStoreEntry
      *
      * @return The principal.
      */
-    public KerberosPrincipal getPrincipal()
+    public PrincipalName getPrincipal()
     {
         return principal;
     }

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntryModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntryModifier.java?rev=1041322&r1=1041321&r2=1041322&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntryModifier.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntryModifier.java
Thu Dec  2 10:24:12 2010
@@ -24,14 +24,13 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
-import javax.security.auth.kerberos.KerberosPrincipal;
-
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.kerberos.shared.io.decoder.EncryptionKeyDecoder;
 import org.apache.directory.server.kerberos.shared.messages.value.types.SamType;
 import org.apache.directory.shared.kerberos.KerberosTime;
 import org.apache.directory.shared.kerberos.codec.types.EncryptionType;
 import org.apache.directory.shared.kerberos.components.EncryptionKey;
+import org.apache.directory.shared.kerberos.components.PrincipalName;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.StringValue;
 import org.apache.directory.shared.ldap.entry.Value;
@@ -46,7 +45,7 @@ public class PrincipalStoreEntryModifier
     // principal
     private String distinguishedName;
     private String commonName;
-    private KerberosPrincipal principal;
+    private PrincipalName principal;
     private String realmName;
 
     // uidObject
@@ -221,7 +220,7 @@ public class PrincipalStoreEntryModifier
      *
      * @param principal
      */
-    public void setPrincipal( KerberosPrincipal principal )
+    public void setPrincipal( PrincipalName principal )
     {
         this.principal = principal;
     }

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java?rev=1041322&r1=1041321&r2=1041322&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java
Thu Dec  2 10:24:12 2010
@@ -24,10 +24,6 @@ import java.io.IOException;
 import java.text.ParseException;
 import java.util.Map;
 
-import javax.naming.NamingException;
-import javax.naming.directory.InvalidAttributeValueException;
-import javax.security.auth.kerberos.KerberosPrincipal;
-
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.kerberos.shared.messages.value.types.SamType;
@@ -37,7 +33,9 @@ import org.apache.directory.server.kerbe
 import org.apache.directory.server.protocol.shared.store.DirectoryServiceOperation;
 import org.apache.directory.shared.kerberos.KerberosTime;
 import org.apache.directory.shared.kerberos.codec.types.EncryptionType;
+import org.apache.directory.shared.kerberos.codec.types.PrincipalNameType;
 import org.apache.directory.shared.kerberos.components.EncryptionKey;
+import org.apache.directory.shared.kerberos.components.PrincipalName;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.name.DN;
@@ -53,7 +51,7 @@ public class GetPrincipal implements Dir
     private static final long serialVersionUID = 4598007518413451945L;
 
     /** The name of the principal to get. */
-    private final KerberosPrincipal principal;
+    private final PrincipalName principal;
 
 
     /**
@@ -61,7 +59,7 @@ public class GetPrincipal implements Dir
      * 
      * @param principal The principal to search for in the directory.
      */
-    public GetPrincipal( KerberosPrincipal principal )
+    public GetPrincipal( PrincipalName principal )
     {
         this.principal = principal;
     }
@@ -78,7 +76,7 @@ public class GetPrincipal implements Dir
             return null;
         }
 
-        return getEntry( StoreUtils.findPrincipalEntry( session, base, principal.getName()
) );
+        return getEntry( StoreUtils.findPrincipalEntry( session, base, principal.getNameString()
) );
     }
 
 
@@ -88,7 +86,7 @@ public class GetPrincipal implements Dir
      * @param dn the distinguished name of the Kerberos principal
      * @param attrs the attributes of the Kerberos principal
      * @return the entry for the principal
-     * @throws NamingException if there are any access problems
+     * @throws Exception if there are any access problems
      */
     private PrincipalStoreEntry getEntry( Entry entry ) throws Exception
     {
@@ -97,7 +95,7 @@ public class GetPrincipal implements Dir
         modifier.setDistinguishedName( entry.getDn().getName() );
 
         String principal = entry.get( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT ).getString();
-        modifier.setPrincipal( new KerberosPrincipal( principal ) );
+        modifier.setPrincipal( new PrincipalName( principal, PrincipalNameType.KRB_NT_PRINCIPAL
) );
 
         String keyVersionNumber = entry.get( KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT
).getString();
         modifier.setKeyVersionNumber( Integer.parseInt( keyVersionNumber ) );
@@ -123,7 +121,7 @@ public class GetPrincipal implements Dir
             }
             catch ( ParseException e )
             {
-                throw new InvalidAttributeValueException( "Account expiration attribute "
+                throw new Exception( "Account expiration attribute "
                     + KerberosAttribute.KRB5_ACCOUNT_EXPIRATION_TIME_AT + " contained an
invalid value for generalizedTime: "
                     + val );
             }
@@ -146,7 +144,7 @@ public class GetPrincipal implements Dir
             }
             catch ( IOException ioe )
             {
-                throw new InvalidAttributeValueException( I18n.err( I18n.ERR_623, KerberosAttribute.KRB5_KEY_AT
) );
+                throw new Exception( I18n.err( I18n.ERR_623, KerberosAttribute.KRB5_KEY_AT
) );
             }
         }
 



Mime
View raw message