cgl.fthpis.datastore.jdbc
Class SessionEntityTable

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

public class SessionEntityTable
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 selectByPublisherSQL
           
(package private) static java.lang.String selectPublisherSQL
           
(package private) static java.lang.String selectSQL
           
(package private) static java.lang.String verifyOwnershipSQL
           
 
Constructor Summary
SessionEntityTable()
           
 
Method Summary
static void delete(java.lang.String sessionKey, java.sql.Connection connection)
          Delete row from the SESSION_ENTITY table.
static void insert(SessionEntity session, java.lang.String publisherID, java.sql.Connection connection)
          Insert new row into the SESSION_ENTITY table.
static void main(java.lang.String[] args)
           
static SessionEntity select(java.lang.String sessionKey, java.sql.Connection connection)
          Select one row from the SESSION_ENTITY table.
static java.util.Vector selectByPublisherID(java.lang.String publisherID, java.sql.Connection connection)
          Select all BusinessKeys from the business_entities table for a given 'publisherID' value.
static java.lang.String selectPublisherID(java.lang.String sessionKey, java.sql.Connection connection)
          Return the 'publisherID' for the SessionEntity identified by the businessKey parameter.
static void test(java.sql.Connection connection)
           
static boolean verifyOwnership(java.lang.String sessionKey, java.lang.String publisherID, java.sql.Connection connection)
          Verify that 'publisherID' has the authority to update or delete SessionEntity identified by the businessKey parameter
 
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

deleteSQL

static java.lang.String deleteSQL

selectSQL

static java.lang.String selectSQL

selectByPublisherSQL

static java.lang.String selectByPublisherSQL

verifyOwnershipSQL

static java.lang.String verifyOwnershipSQL

selectPublisherSQL

static java.lang.String selectPublisherSQL
Constructor Detail

SessionEntityTable

public SessionEntityTable()
Method Detail

insert

public static void insert(SessionEntity session,
                          java.lang.String publisherID,
                          java.sql.Connection connection)
                   throws java.sql.SQLException
Insert new row into the SESSION_ENTITY table.

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

delete

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

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

select

public static SessionEntity select(java.lang.String sessionKey,
                                   java.sql.Connection connection)
                            throws java.sql.SQLException
Select one row from the SESSION_ENTITY table.

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

selectByPublisherID

public static java.util.Vector selectByPublisherID(java.lang.String publisherID,
                                                   java.sql.Connection connection)
                                            throws java.sql.SQLException
Select all BusinessKeys from the business_entities table for a given 'publisherID' value.

Parameters:
publisherID - The user id of the SessionEntity owner.
connection - JDBC connection
Returns:
Vector A Vector of BusinessKeys
Throws:
java.sql.SQLException

verifyOwnership

public static boolean verifyOwnership(java.lang.String sessionKey,
                                      java.lang.String publisherID,
                                      java.sql.Connection connection)
                               throws java.sql.SQLException
Verify that 'publisherID' has the authority to update or delete SessionEntity identified by the businessKey parameter

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

selectPublisherID

public static java.lang.String selectPublisherID(java.lang.String sessionKey,
                                                 java.sql.Connection connection)
                                          throws java.sql.SQLException
Return the 'publisherID' for the SessionEntity identified by the businessKey parameter. Retusn null if the business entity key does not represent a valid BuisnessEntity or if no publisherID is specified for that particular SessionEntity.

Parameters:
connection -
Returns:
publisherID or null if no publisherID is available.
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