public class DerbyUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
AUTHOR_SELECT |
static String |
BASELINE_SELECT |
static String |
CHECKSUM_UPDATE |
static String |
CREATE_INTEGRITY_SCM_REGISTRY |
static String |
CREATE_PROJECT_TABLE |
static String |
DELTA_SELECT |
static String |
DERBY_DRIVER |
static String |
DERBY_SYS_HOME_PROPERTY |
static String |
DERBY_URL_PREFIX |
static String |
DIR_SELECT |
static String |
DROP_PROJECT_TABLE |
static String |
DROP_REGISTRY_ENTRY |
static String |
INSERT_MEMBER_RECORD |
static String |
INSERT_REGISTRY_ENTRY |
static String |
PROJECT_SELECT |
static String |
SELECT_MEMBER_1 |
static String |
SELECT_REGISTRY_1 |
static String |
SELECT_REGISTRY_DISTINCT_PROJECTS |
static String |
SELECT_REGISTRY_PROJECT |
static String |
SELECT_REGISTRY_PROJECTS |
static String |
SELECT_REGISTRY_TABLE |
static String |
SUB_PROJECT_SELECT |
| Constructor and Description |
|---|
DerbyUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
cleanupProjectCache(ConnectionPoolDataSource dataSource,
String jobName,
String configurationName)
Maintenance function to limit project cache to the most recent two builds
|
static int |
compareBaseline(String baselineProjectCache,
String projectCacheTable,
boolean skipAuthorInfo,
APISession api)
Compares this version of the project to a previous/new version to determine what are the updates and what was deleted
|
static boolean |
createCMProjectTables(ConnectionPoolDataSource dataSource,
String tableName)
Establishes a fresh set of Integrity SCM cache tables
|
static ConnectionPoolDataSource |
createConnectionPoolDataSource(String derbyHome)
Creates a pooled connection data source for the derby database
|
static boolean |
createRegistry(ConnectionPoolDataSource dataSource)
Creates the Integrity SCM cache registry table
|
static void |
deleteProjectCache(ConnectionPoolDataSource dataSource,
String jobName)
Maintenance function to delete all inactive project cache tables
|
static boolean |
executeStmt(ConnectionPoolDataSource dataSource,
String sql)
Generic SQL statement execution function
|
static String |
fixDescription(String desc)
Attempts to fix known issues with characters that can potentially break the change log xml
|
static List<String> |
getDirList(String projectCacheTable)
Returns a string list of relative paths to all directories in this project
|
static List<String> |
getDistinctJobNames(ConnectionPoolDataSource dataSource)
Maintenance function that returns a list of distinct job names
for additional checking to see which ones are inactive
|
static CM_PROJECT |
getEnum(String name)
Returns the CM_PROJECT column name for the string column name
|
static String |
getProjectCache(ConnectionPoolDataSource dataSource,
String jobName,
String configurationName,
long buildNumber)
Returns the name of the project cache table for the specified job/configuration and build
|
static int |
getRowCount(ResultSet rs)
This function provides a count of the total number of rows in the ResultSet
|
static Hashtable<CM_PROJECT,Object> |
getRowData(ResultSet rs)
Convenience function that converts a result set row into a Hashtable for easy access
|
static String |
getUUIDTableName()
Random unique id generator for cache table names
|
static void |
loadDerbyDriver()
Utility function to load the Java DB Driver
|
static void |
parseProject(IntegrityCMProject siProject,
com.mks.api.response.WorkItemIterator wit)
Parses the output from the si viewproject command to get a list of members
|
static void |
primeAuthorInformation(String projectCacheTable,
APISession api)
Updates the author information for all the members in the project
|
static String |
registerProjectCache(ConnectionPoolDataSource dataSource,
String jobName,
String configurationName,
long buildNumber)
Creates a single Integrity SCM Project/Configuration cache table
|
static void |
updateChecksum(String projectCacheTable,
ConcurrentHashMap<String,String> checksumHash)
Updates the underlying Integrity SCM Project table cache with the new checksum information
|
static List<Hashtable<CM_PROJECT,Object>> |
viewProject(String projectCacheTable)
Project access function that returns the state of the current project
NOTE: For maximum efficiency, this should be called only once and after the compareBasline() has been invoked!
|
static List<Hashtable<CM_PROJECT,Object>> |
viewSubProjects(String projectCacheTable)
Project access function that returns the state of the current project
NOTE: For maximum efficiency, this should be called only once and after the compareBasline() has been invoked!
|
public static final String DERBY_DRIVER
public static final String DERBY_SYS_HOME_PROPERTY
public static final String DERBY_URL_PREFIX
public static final String CREATE_INTEGRITY_SCM_REGISTRY
public static final String SELECT_REGISTRY_1
public static final String SELECT_REGISTRY_TABLE
public static final String INSERT_REGISTRY_ENTRY
public static final String SELECT_REGISTRY_DISTINCT_PROJECTS
public static final String SELECT_REGISTRY_PROJECTS
public static final String SELECT_REGISTRY_PROJECT
public static final String DROP_REGISTRY_ENTRY
public static final String CREATE_PROJECT_TABLE
public static final String DROP_PROJECT_TABLE
public static final String SELECT_MEMBER_1
public static final String INSERT_MEMBER_RECORD
public static final String BASELINE_SELECT
public static final String DELTA_SELECT
public static final String PROJECT_SELECT
public static final String SUB_PROJECT_SELECT
public static final String AUTHOR_SELECT
public static final String DIR_SELECT
public static final String CHECKSUM_UPDATE
public static final CM_PROJECT getEnum(String name)
name - public static final String getUUIDTableName()
public static void loadDerbyDriver()
public static ConnectionPoolDataSource createConnectionPoolDataSource(String derbyHome)
public static boolean executeStmt(ConnectionPoolDataSource dataSource, String sql) throws SQLException
dataSource - A pooled connection data sourcesql - String sql statementSQLExceptionpublic static boolean createRegistry(ConnectionPoolDataSource dataSource)
dataSource - public static String registerProjectCache(ConnectionPoolDataSource dataSource, String jobName, String configurationName, long buildNumber) throws SQLException
dataSource - jobName - configurationName - buildNumber - SQLExceptionpublic static String getProjectCache(ConnectionPoolDataSource dataSource, String jobName, String configurationName, long buildNumber) throws SQLException
dataSource - jobName - configurationName - buildNumber - SQLExceptionpublic static List<String> getDistinctJobNames(ConnectionPoolDataSource dataSource) throws SQLException
dataSource - SQLExceptionpublic static void deleteProjectCache(ConnectionPoolDataSource dataSource, String jobName) throws SQLException
dataSource - jobName - SQLExceptionpublic static void cleanupProjectCache(ConnectionPoolDataSource dataSource, String jobName, String configurationName) throws SQLException
dataSource - jobName - configurationName - SQLExceptionpublic static boolean createCMProjectTables(ConnectionPoolDataSource dataSource, String tableName)
db - Derby database connectionpublic static Hashtable<CM_PROJECT,Object> getRowData(ResultSet rs) throws SQLException, IOException
rs - ResultSet row objectSQLExceptionIOExceptionpublic static int getRowCount(ResultSet rs) throws SQLException
set - SQLExceptionpublic static String fixDescription(String desc)
desc - Input comment string for the revisionpublic static int compareBaseline(String baselineProjectCache, String projectCacheTable, boolean skipAuthorInfo, APISession api) throws SQLException, IOException
baselineProjectCache - The previous baseline (build) for this Integrity CM Projectapi - The current Integrity API Session to obtain the author informationreturn - The total number of changes found in the comparisonSQLExceptionIOExceptionpublic static void parseProject(IntegrityCMProject siProject, com.mks.api.response.WorkItemIterator wit) throws com.mks.api.response.APIException, SQLException
wit - WorkItemIteratorcom.mks.api.response.APIExceptionSQLExceptionpublic static void primeAuthorInformation(String projectCacheTable, APISession api) throws SQLException, IOException
api - SQLExceptionIOExceptionpublic static void updateChecksum(String projectCacheTable, ConcurrentHashMap<String,String> checksumHash) throws SQLException, IOException
checksumHash - Checksum hashtable generated from a checkout operationSQLExceptionIOExceptionpublic static List<Hashtable<CM_PROJECT,Object>> viewProject(String projectCacheTable) throws SQLException, IOException
SQLExceptionIOExceptionpublic static List<Hashtable<CM_PROJECT,Object>> viewSubProjects(String projectCacheTable) throws SQLException, IOException
SQLExceptionIOExceptionpublic static List<String> getDirList(String projectCacheTable) throws SQLException, IOException
SQLExceptionIOExceptionCopyright © 2004-2015 Hudson. All Rights Reserved.