juddi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Cutright" <Andy.Cutri...@borland.com>
Subject RE: [juddi-Developers] discard_authToken && TOKEN_STATE
Date Thu, 28 Aug 2003 09:41:27 GMT
proposed diffs.. i've run my tests, the proxy tests and the JAXR tests
from the ant targets. they completed successfully, whatever that means
:)

this fix brings makes my current, small test suite valid. all uddi4j
tests are known to work and be valid. 

cheers,
andy 

Index: AuthTokenTable.java
===================================================================
RCS file:
/cvsroot/juddi/juddi/src/java/org/juddi/datastore/jdbc/AuthTokenTable.ja
va,v
retrieving revision 1.5
diff -r1.5 AuthTokenTable.java
38a39
>   static String selectTokenStateSQL = null;
96a98,105
> 
>     // build selectTokenStateSQL
>     sql = new StringBuffer(200);
>     sql.append("SELECT ");
>     sql.append("TOKEN_STATE ");
>     sql.append("FROM AUTH_TOKEN ");
>     sql.append("WHERE AUTH_TOKEN=?");
>     selectTokenStateSQL = sql.toString();
341a351,392
>   /**
>    * Query the token's state. This is used to determine if the
authToken
>    * has been discarded, for example.
>    *
>    * @param authToken
>    * @param connection
>    * @throws SQLException
>    */
>   public static long selectTokenState(String authToken, Connection
connection)
>       throws SQLException
>   {
>     PreparedStatement statement = null;
>     ResultSet resultSet = null;
>     long tokenState = -1;
> 
>     try
>     {
>       // create a statement to query with
>       statement = connection.prepareStatement(selectTokenStateSQL);
>       statement.setString(1,authToken);
> 
>       log.debug("SQL Statement: [" + selectTokenStateSQL + "],
parameter authToken: [" + authToken + "]");
> 
>       resultSet = statement.executeQuery();
>       if (resultSet.next())
>       {
>         tokenState = resultSet.getLong("TOKEN_STATE");
>       }
>     }
>     catch(SQLException sqlex)
>     {
>       log.error(sqlex.getMessage());
>       throw sqlex;
>     }
>     finally
>     {
>       try { statement.close(); } catch (Exception e) { /* ignored */ }
>     }
> 
>     return tokenState;
>   }
> 
354c405
<     
---
> 
Index: JDBCDataStore.java
===================================================================
RCS file:
/cvsroot/juddi/juddi/src/java/org/juddi/datastore/jdbc/JDBCDataStore.jav
a,v
retrieving revision 1.7
diff -r1.7 JDBCDataStore.java
190c190
<    * is thrown if the publisherID specified is null, blank or does not

---
>    * is thrown if the publisherID specified is null, blank or does not
307a308,312
>         long tokenState = AuthTokenTable.selectTokenState(token,
connection);
>         if (tokenState <= 0) {
>           return expired = true;
>         }
> 
1852c1857
<   
---
> 
1930c1935
<     
---
> 

> -----Original Message-----
> From: Steve Viens [mailto:steve@viens.net] 
> Sent: Thursday, August 28, 2003 4:55 AM
> To: juddi-developers@lists.sourceforge.net
> Subject: RE: [juddi-Developers] discard_authToken && TOKEN_STATE
> 
> 
> Yeah, a TOKEN_STATE of 0 is supposed to indicate that an AuthToken has
> expired.  
> 
> The getPublisher(authInfo,dataStore) method of Abstract function class
> is supposed to throw the AuthTokenExpired or exception when
> DataStore.isAuthTokenExpired returns false.
> 
> Steve


Mime
View raw message