cgl.fthpis.datastore.jdbc
Class AuthTokenTable

java.lang.Object
  extended bycgl.fthpis.datastore.jdbc.AuthTokenTable

public class AuthTokenTable
extends java.lang.Object

Author:
Mehmet S. Aktas (maktas@indiana.edu)

Field Summary
(package private) static java.lang.String deleteSQL
           
(package private) static java.lang.String insertSQL
           
(package private) static java.lang.String invalidateSQL
           
(package private) static java.lang.String selectAllTokenStateSQL
           
(package private) static java.lang.String selectLastUsedSQL
           
(package private) static java.lang.String selectPublisherSQL
           
(package private) static java.lang.String selectTokenStateSQL
           
(package private) static java.lang.String touchSQL
           
 
Constructor Summary
AuthTokenTable()
           
 
Method Summary
static void delete(java.lang.String authToken, java.sql.Connection connection)
          Delete row from the AUTH_TOKEN table.
static void insert(java.lang.String authToken, Publisher publisher, java.sql.Connection connection)
          Insert new row into the AUTH_TOKEN table.
static void invalidate(java.lang.String authToken, java.sql.Connection connection)
          Update the AUTH_TOKEN table's LAST_USED property for a particular authToken.
static void main(java.lang.String[] args)
           
static java.util.Vector selectALLAuthToken(java.lang.String token, java.sql.Connection connection)
          Select one row from the AUTH_TOKEN table.
static AutharizationToken selectAuthToken(java.lang.String token, java.sql.Connection connection)
          Select one row from the AUTH_TOKEN table.
static long selectLastUsed(java.lang.String authToken, java.sql.Connection connection)
          Update the PUBLISHER table for a particular PublisherID.
static Publisher selectPublisher(java.lang.String authToken, java.sql.Connection connection)
          Select one row from the AUTH_TOKEN table.
static long selectTokenState(java.lang.String authToken, java.sql.Connection connection)
          Query the token's state.
static void test(java.sql.Connection connection)
           
static void touch(java.lang.String authToken, java.sql.Connection connection)
          Update the PUBLISHER table for a particular PublisherID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

insertSQL

static java.lang.String insertSQL

selectPublisherSQL

static java.lang.String selectPublisherSQL

deleteSQL

static java.lang.String deleteSQL

touchSQL

static java.lang.String touchSQL

selectLastUsedSQL

static java.lang.String selectLastUsedSQL

invalidateSQL

static java.lang.String invalidateSQL

selectTokenStateSQL

static java.lang.String selectTokenStateSQL

selectAllTokenStateSQL

static java.lang.String selectAllTokenStateSQL
Constructor Detail

AuthTokenTable

public AuthTokenTable()
Method Detail

insert

public static void insert(java.lang.String authToken,
                          Publisher publisher,
                          java.sql.Connection connection)
                   throws java.sql.SQLException
Insert new row into the AUTH_TOKEN table.

Parameters:
authToken -
publisher -
connection - JDBC connection
Throws:
java.sql.SQLException

selectALLAuthToken

public static java.util.Vector selectALLAuthToken(java.lang.String token,
                                                  java.sql.Connection connection)
                                           throws java.sql.SQLException
Select one row from the AUTH_TOKEN table.

Parameters:
connection - JDBC connection
Returns:
Publisher The publisher's info
Throws:
java.sql.SQLException

selectAuthToken

public static AutharizationToken selectAuthToken(java.lang.String token,
                                                 java.sql.Connection connection)
                                          throws java.sql.SQLException
Select one row from the AUTH_TOKEN table.

Parameters:
connection - JDBC connection
Returns:
Publisher The publisher's info
Throws:
java.sql.SQLException

selectPublisher

public static Publisher selectPublisher(java.lang.String authToken,
                                        java.sql.Connection connection)
                                 throws java.sql.SQLException
Select one row from the AUTH_TOKEN table.

Parameters:
authToken -
connection - JDBC connection
Returns:
Publisher The publisher's info
Throws:
java.sql.SQLException

delete

public static void delete(java.lang.String authToken,
                          java.sql.Connection connection)
                   throws java.sql.SQLException
Delete row from the AUTH_TOKEN table.

Parameters:
authToken -
connection -
Throws:
java.sql.SQLException

touch

public static void touch(java.lang.String authToken,
                         java.sql.Connection connection)
                  throws java.sql.SQLException
Update the PUBLISHER table for a particular PublisherID.

Parameters:
connection - JDBC connection
Throws:
java.sql.SQLException

selectLastUsed

public static long selectLastUsed(java.lang.String authToken,
                                  java.sql.Connection connection)
                           throws java.sql.SQLException
Update the PUBLISHER table for a particular PublisherID.

Parameters:
connection - JDBC connection
Throws:
java.sql.SQLException

invalidate

public static void invalidate(java.lang.String authToken,
                              java.sql.Connection connection)
                       throws java.sql.SQLException
Update the AUTH_TOKEN table's LAST_USED property for a particular authToken.

Parameters:
connection - JDBC connection
Throws:
java.sql.SQLException

selectTokenState

public static long selectTokenState(java.lang.String authToken,
                                    java.sql.Connection connection)
                             throws java.sql.SQLException
Query the token's state. This is used to determine if the authToken has been discarded, for example.

Parameters:
authToken -
connection -
Throws:
java.sql.SQLException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

test

public static void test(java.sql.Connection connection)
                 throws java.lang.Exception
Throws:
java.lang.Exception