public class DerbyUtils extends Object
| Constructor and Description | 
|---|
| DerbyUtils() | 
| Modifier and Type | Method and Description | 
|---|---|
| static void | cleanupProjectCache(ConnectionPoolDataSource dataSource,
                   String jobName,
                   long buildNumber)Maintenance function to limit project cache to the most recent builds | 
| static int | compareBaseline(String serverConfigId,
               String baselineProjectCache,
               String projectCacheTable,
               Map<IntegrityCMMember.CPInfo,List<IntegrityCMMember.CPMember>> membersInCP,
               boolean skipAuthorInfo,
               boolean CPMode)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 Set<String> | doCPCacheOperations(String cpCacheTable,
                   String cp,
                   String cpState,
                   String operation)Cache the list of CPs (all states except "closed"). | 
| 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 String | getAuthorFromRevisionInfo(String serverConfigId,
                         String configPath,
                         String memberID,
                         String memberRev)Performs a revision info on this Integrity Source File | 
| static String | getCachedTableFromRegistry(String tableName,
                          ConnectionPoolDataSource dataSource,
                          String jobName,
                          String configurationName,
                          long buildNumber)Returns the name of the project cache table for the specified job/configuration and build | 
| static boolean | getCPCacheTable(ConnectionPoolDataSource dataSource,
               String cpCacheTableName)Create or return existing CP cache table | 
| 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 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 | primeAuthorInformation(String serverConfigId,
                      String projectCacheTable)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 SELECT_REGISTRY_TABLE_DROP
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 SELECT_CP_1
public static final String CREATE_PROJECT_CP_TABLE
public static final String INSERT_CP_RECORD
public static final String CP_SELECT
public static final String DELETE_CP_RECORD
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 String CP_MEMBER_SELECT
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 getCachedTableFromRegistry(String tableName, 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, long buildNumber) throws SQLException
dataSource - jobName - buildNumber - SQLExceptionpublic static boolean createCMProjectTables(ConnectionPoolDataSource dataSource, String tableName)
db - Derby database connectionpublic static boolean getCPCacheTable(ConnectionPoolDataSource dataSource, String cpCacheTableName)
i - configurationName - 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 serverConfigId, String baselineProjectCache, String projectCacheTable, Map<IntegrityCMMember.CPInfo,List<IntegrityCMMember.CPMember>> membersInCP, boolean skipAuthorInfo, boolean CPMode) throws SQLException, IOException
baselineProjectCache - The previous baseline (build) for this Integrity CM Projectreturn - The total number of changes found in the comparisonSQLExceptionIOExceptionpublic static void primeAuthorInformation(String serverConfigId, String projectCacheTable) throws SQLException, IOException
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
SQLExceptionIOExceptionpublic static Set<String> doCPCacheOperations(String cpCacheTable, String cp, String cpState, String operation) throws SQLException
cpCacheTable - cp - cpState - operation - SQLExceptionpublic static String getAuthorFromRevisionInfo(String serverConfigId, String configPath, String memberID, String memberRev) throws hudson.AbortException
configPath - Full project configuration pathmemberID - Member ID for this filememberRev - Member Revision for this filehudson.AbortExceptionAPICommandExceptionCopyright © 2016–2024. All rights reserved.