directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vte...@apache.org
Subject svn commit: r291815 - in /directory/authx/trunk: core/src/java/org/apache/authx/authentication/ core/src/java/org/apache/authx/authentication/realm/ jdbc/src/java/org/apache/authx/authentication/realm/ jdbc/src/test/org/apache/authx/authentication/realm/
Date Tue, 27 Sep 2005 04:10:57 GMT
Author: vtence
Date: Mon Sep 26 21:10:48 2005
New Revision: 291815

URL: http://svn.apache.org/viewcvs?rev=291815&view=rev
Log:
Got rid of Credential interface. Credential objects not longer need to implement this interface.

Removed:
    directory/authx/trunk/core/src/java/org/apache/authx/authentication/Credential.java
Modified:
    directory/authx/trunk/core/src/java/org/apache/authx/authentication/CredentialSet.java
    directory/authx/trunk/core/src/java/org/apache/authx/authentication/realm/PasswordCredential.java
    directory/authx/trunk/core/src/java/org/apache/authx/authentication/realm/SameCredentialsBuilder.java
    directory/authx/trunk/core/src/java/org/apache/authx/authentication/realm/Selector.java
    directory/authx/trunk/core/src/java/org/apache/authx/authentication/realm/UsernameCredential.java
    directory/authx/trunk/jdbc/src/java/org/apache/authx/authentication/realm/EqExpression.java
    directory/authx/trunk/jdbc/src/java/org/apache/authx/authentication/realm/JDBCSelector.java
    directory/authx/trunk/jdbc/src/java/org/apache/authx/authentication/realm/ReflectionPersister.java
    directory/authx/trunk/jdbc/src/java/org/apache/authx/authentication/realm/SQLExpressionBuilder.java
    directory/authx/trunk/jdbc/src/test/org/apache/authx/authentication/realm/Creds.java
    directory/authx/trunk/jdbc/src/test/org/apache/authx/authentication/realm/MemoryDatabase.java

Modified: directory/authx/trunk/core/src/java/org/apache/authx/authentication/CredentialSet.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/java/org/apache/authx/authentication/CredentialSet.java?rev=291815&r1=291814&r2=291815&view=diff
==============================================================================
--- directory/authx/trunk/core/src/java/org/apache/authx/authentication/CredentialSet.java
(original)
+++ directory/authx/trunk/core/src/java/org/apache/authx/authentication/CredentialSet.java
Mon Sep 26 21:10:48 2005
@@ -23,7 +23,7 @@
 import java.util.Set;
 
 /**
- * A <code>CredentialSet</code> is a grouping of related {@link Credential}
+ * A <code>CredentialSet</code> is a grouping of related credential
  * objects that provides a proof of identity. It serves both identification and
  * authentication purposes.
  * <p>
@@ -84,7 +84,7 @@
      *
      * @param c the class of credential to be returned.
      * @return a new CredentialSet containing all
-     *         of the Credential objects of the given type.
+     *         of the credential objects of the given type.
      */
     public CredentialSet getCredentials( Class c )
     {
@@ -113,8 +113,7 @@
         if ( creds.isEmpty() ) throw new IllegalArgumentException( "No such credential: "
+ c.getName() );
         if ( creds.size() > 1 ) throw new IllegalArgumentException( "Multiple matching
credentials: " + c.getName() );
 
-        Object credential = creds.m_credentials.iterator().next();
-        return credential;
+        return creds.m_credentials.iterator().next();
     }
 
     public boolean contains( Object credential )

Modified: directory/authx/trunk/core/src/java/org/apache/authx/authentication/realm/PasswordCredential.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/java/org/apache/authx/authentication/realm/PasswordCredential.java?rev=291815&r1=291814&r2=291815&view=diff
==============================================================================
--- directory/authx/trunk/core/src/java/org/apache/authx/authentication/realm/PasswordCredential.java
(original)
+++ directory/authx/trunk/core/src/java/org/apache/authx/authentication/realm/PasswordCredential.java
Mon Sep 26 21:10:48 2005
@@ -16,12 +16,12 @@
  */
 package org.apache.authx.authentication.realm;
 
-import org.apache.authx.authentication.Credential;
+import java.io.Serializable;
 
 /**
  * @author <a href="mailto:vtence@apache.org">Vincent Tence</a>
  */
-public class PasswordCredential implements Credential
+public class PasswordCredential implements Serializable
 {
     private String m_password;
 

Modified: directory/authx/trunk/core/src/java/org/apache/authx/authentication/realm/SameCredentialsBuilder.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/java/org/apache/authx/authentication/realm/SameCredentialsBuilder.java?rev=291815&r1=291814&r2=291815&view=diff
==============================================================================
--- directory/authx/trunk/core/src/java/org/apache/authx/authentication/realm/SameCredentialsBuilder.java
(original)
+++ directory/authx/trunk/core/src/java/org/apache/authx/authentication/realm/SameCredentialsBuilder.java
Mon Sep 26 21:10:48 2005
@@ -17,7 +17,6 @@
 package org.apache.authx.authentication.realm;
 
 import org.apache.authx.authentication.CredentialSet;
-import org.apache.authx.authentication.Credential;
 
 import java.util.Iterator;
 
@@ -34,7 +33,7 @@
     {
         for ( Iterator it = m_credentials.elements().iterator(); it.hasNext(); )
         {
-            Credential credential = (Credential) it.next();
+            Object credential = it.next();
             selector.eq( credential.getClass(), credential );
         }
     }

Modified: directory/authx/trunk/core/src/java/org/apache/authx/authentication/realm/Selector.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/java/org/apache/authx/authentication/realm/Selector.java?rev=291815&r1=291814&r2=291815&view=diff
==============================================================================
--- directory/authx/trunk/core/src/java/org/apache/authx/authentication/realm/Selector.java
(original)
+++ directory/authx/trunk/core/src/java/org/apache/authx/authentication/realm/Selector.java
Mon Sep 26 21:10:48 2005
@@ -16,9 +16,7 @@
  */
 package org.apache.authx.authentication.realm;
 
-import org.apache.authx.authentication.Credential;
-
 public interface Selector
 {
-    Selector eq( Object key, Credential c );
+    Selector eq( Object key, Object c );
 }

Modified: directory/authx/trunk/core/src/java/org/apache/authx/authentication/realm/UsernameCredential.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/java/org/apache/authx/authentication/realm/UsernameCredential.java?rev=291815&r1=291814&r2=291815&view=diff
==============================================================================
--- directory/authx/trunk/core/src/java/org/apache/authx/authentication/realm/UsernameCredential.java
(original)
+++ directory/authx/trunk/core/src/java/org/apache/authx/authentication/realm/UsernameCredential.java
Mon Sep 26 21:10:48 2005
@@ -16,12 +16,12 @@
  */
 package org.apache.authx.authentication.realm;
 
-import org.apache.authx.authentication.Credential;
+import java.io.Serializable;
 
 /**
  * @author <a href="mailto:vtence@apache.org">Vincent Tence</a>
  */
-public class UsernameCredential implements Credential
+public class UsernameCredential implements Serializable
 {
     private String m_username;
 

Modified: directory/authx/trunk/jdbc/src/java/org/apache/authx/authentication/realm/EqExpression.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/jdbc/src/java/org/apache/authx/authentication/realm/EqExpression.java?rev=291815&r1=291814&r2=291815&view=diff
==============================================================================
--- directory/authx/trunk/jdbc/src/java/org/apache/authx/authentication/realm/EqExpression.java
(original)
+++ directory/authx/trunk/jdbc/src/java/org/apache/authx/authentication/realm/EqExpression.java
Mon Sep 26 21:10:48 2005
@@ -16,14 +16,12 @@
  */
 package org.apache.authx.authentication.realm;
 
-import org.apache.authx.authentication.Credential;
-
 public class EqExpression implements SQLExpression
 {
     private final Column m_column;
-    private final Credential m_credential;
+    private final Object m_credential;
 
-    public EqExpression( Column column, Credential c )
+    public EqExpression( Column column, Object c )
     {
         m_column = column;
         m_credential = c;

Modified: directory/authx/trunk/jdbc/src/java/org/apache/authx/authentication/realm/JDBCSelector.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/jdbc/src/java/org/apache/authx/authentication/realm/JDBCSelector.java?rev=291815&r1=291814&r2=291815&view=diff
==============================================================================
--- directory/authx/trunk/jdbc/src/java/org/apache/authx/authentication/realm/JDBCSelector.java
(original)
+++ directory/authx/trunk/jdbc/src/java/org/apache/authx/authentication/realm/JDBCSelector.java
Mon Sep 26 21:10:48 2005
@@ -16,8 +16,6 @@
  */
 package org.apache.authx.authentication.realm;
 
-import org.apache.authx.authentication.Credential;
-
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
@@ -39,7 +37,7 @@
         m_builder = new SQLExpressionBuilder( table );
     }
 
-    public Selector eq( Object key, Credential c )
+    public Selector eq( Object key, Object c )
     {
         addExpression( m_builder.eq( key, c ) );
         return this;

Modified: directory/authx/trunk/jdbc/src/java/org/apache/authx/authentication/realm/ReflectionPersister.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/jdbc/src/java/org/apache/authx/authentication/realm/ReflectionPersister.java?rev=291815&r1=291814&r2=291815&view=diff
==============================================================================
--- directory/authx/trunk/jdbc/src/java/org/apache/authx/authentication/realm/ReflectionPersister.java
(original)
+++ directory/authx/trunk/jdbc/src/java/org/apache/authx/authentication/realm/ReflectionPersister.java
Mon Sep 26 21:10:48 2005
@@ -16,8 +16,6 @@
  */
 package org.apache.authx.authentication.realm;
 
-import org.apache.authx.authentication.Credential;
-
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
 import java.sql.ResultSet;
@@ -55,12 +53,12 @@
 
     public Object getProperty( ResultSet rs, String columnName ) throws SQLException
     {
-        Credential c;
+        Object c;
         try
         {
             Constructor constructor = getPersistentType().getConstructor( new Class[] { m_sqlType.getJavaType()
} );
             Object value = m_sqlType.getValue( rs, columnName );
-            c = ((Credential) constructor.newInstance( new Object[] { value } ));
+            c = constructor.newInstance( new Object[] { value } );
         }
         catch ( Exception e )
         {

Modified: directory/authx/trunk/jdbc/src/java/org/apache/authx/authentication/realm/SQLExpressionBuilder.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/jdbc/src/java/org/apache/authx/authentication/realm/SQLExpressionBuilder.java?rev=291815&r1=291814&r2=291815&view=diff
==============================================================================
--- directory/authx/trunk/jdbc/src/java/org/apache/authx/authentication/realm/SQLExpressionBuilder.java
(original)
+++ directory/authx/trunk/jdbc/src/java/org/apache/authx/authentication/realm/SQLExpressionBuilder.java
Mon Sep 26 21:10:48 2005
@@ -16,8 +16,6 @@
  */
 package org.apache.authx.authentication.realm;
 
-import org.apache.authx.authentication.Credential;
-
 public class SQLExpressionBuilder
 {
     private final Table m_table;
@@ -27,7 +25,7 @@
         m_table = table;
     }
 
-    public SQLExpression eq( Object key, Credential c )
+    public SQLExpression eq( Object key, Object c )
     {
         return new EqExpression( m_table.getColumn( key ), c );
     }

Modified: directory/authx/trunk/jdbc/src/test/org/apache/authx/authentication/realm/Creds.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/jdbc/src/test/org/apache/authx/authentication/realm/Creds.java?rev=291815&r1=291814&r2=291815&view=diff
==============================================================================
--- directory/authx/trunk/jdbc/src/test/org/apache/authx/authentication/realm/Creds.java (original)
+++ directory/authx/trunk/jdbc/src/test/org/apache/authx/authentication/realm/Creds.java Mon
Sep 26 21:10:48 2005
@@ -17,7 +17,6 @@
 package org.apache.authx.authentication.realm;
 
 import org.apache.authx.authentication.CredentialSet;
-import org.apache.authx.authentication.Credential;
 
 public class Creds
 {
@@ -47,7 +46,7 @@
         return creds;
     }
 
-    public static class EyeColorCredential implements Credential
+    public static class EyeColorCredential
     {
         private String m_color;
 

Modified: directory/authx/trunk/jdbc/src/test/org/apache/authx/authentication/realm/MemoryDatabase.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/jdbc/src/test/org/apache/authx/authentication/realm/MemoryDatabase.java?rev=291815&r1=291814&r2=291815&view=diff
==============================================================================
--- directory/authx/trunk/jdbc/src/test/org/apache/authx/authentication/realm/MemoryDatabase.java
(original)
+++ directory/authx/trunk/jdbc/src/test/org/apache/authx/authentication/realm/MemoryDatabase.java
Mon Sep 26 21:10:48 2005
@@ -16,7 +16,6 @@
  */
 package org.apache.authx.authentication.realm;
 
-import org.apache.authx.authentication.Credential;
 import org.apache.authx.authentication.CredentialSet;
 import org.hsqldb.DatabaseManager;
 import org.hsqldb.jdbc.jdbcDataSource;
@@ -89,14 +88,14 @@
         statement.append( table.getName() ).append( "(" );
         for ( Iterator it = creds.elements().iterator(); it.hasNext(); )
         {
-            Credential credential = ( Credential ) it.next();
+            Object credential = it.next();
             statement.append( table.getColumnName( credential.getClass() ) );
             if ( it.hasNext() ) statement.append( "," );
         }
         statement.append( ") values( " );
         for ( Iterator it = creds.elements().iterator(); it.hasNext(); )
         {
-            Credential credential = ( Credential ) it.next();
+            Object credential = it.next();
             table.getColumn( credential.getClass() ).setProperty( statement, credential );
             if ( it.hasNext() ) statement.append( "," );
         }



Mime
View raw message