public abstract class UpgTemplate extends java.lang.Object implements UpgConstants
ConfigDB
and
RestoreFromBackup
.
Extensions of this class for ConfigDB should be named "UpgCdb" + ConfigDB methodName + ConfigDB methodPlace (or null) + table name (uppercase) (or null).
Extensions of this class for RestoreFromBackup should be named "UpgRes" + RestoreFromBackup methodName + RestoreFromBackup methodPlace (or null) + table name (uppercase) (or null).
For example, if this will be called from ConfigDB, method rebuildTable
, place 01
,
table Item
, then the name of this class would be:
UpgCdbRebuildTable01ITEM
.
The subdirectory containing these extensions is determined as follows.
Find the name of the maxvar MAXUPG from the database that you are converting from.
Use the first part of the varvalue up to but not including any space or hyphen character.
For example, if the varvalue equals V411-06 3/23/2001
, then the name
of the subdirectory would be psdi.configure.V411
.
psdi.upgrade.Upgrade#upgradeCallout
,
ConfigDB.upgradeCallout(java.lang.String, java.lang.String, java.lang.String)
,
RestoreFromBackup.upgradeCallout(java.lang.String, java.lang.String, java.lang.String)
Modifier and Type | Field and Description |
---|---|
java.lang.String |
sNo
The value indicating No for YORN attributes.
|
java.lang.String |
sYes
The value indicating Yes for YORN attributes.
|
DB2, doNotUpdateACTION, doNotUpdateALNDOMAIN, doNotUpdateAPPLICATIONAUTH, doNotUpdateAUTOKEY, doNotUpdateCONDITION, doNotUpdateCONTRACTPROPERTY, doNotUpdateCONTRACTTYPE, doNotUpdateCROSSOVERDOMAIN, doNotUpdateDOCTYPES, doNotUpdateLANGUAGE, doNotUpdateMAXAPPS, doNotUpdateMAXCONDDETAIL, doNotUpdateMAXCONTROLVALUE, doNotUpdateMAXDOMAIN, doNotUpdateMAXLOGAPPENDER, doNotUpdateMAXLOGGER, doNotUpdateMAXMENU, doNotUpdateMAXMESSAGES, doNotUpdateMAXMODULES, doNotUpdateMAXPROP, doNotUpdateMAXPROPVALUE, doNotUpdateMAXROLE, doNotUpdateMAXSEQUENCE, doNotUpdateMAXSERSECURITY, doNotUpdateMAXSERVICE, doNotUpdateMAXTABLEDOMAIN, doNotUpdateMAXVARS, doNotUpdateMAXVARTYPE, doNotUpdateMXCOLLAB, doNotUpdateMXCOLLABREF, doNotUpdateNUMERICDOMAIN, doNotUpdateNUMRANGEDOMAIN, doNotUpdatePORTLET, doNotUpdatePRICALC, doNotUpdateSECURITYRESTRICT, doNotUpdateSIGOPTION, doNotUpdateSYNONYMDOMAIN, doNotUpdateTAXTYPE, doNotUpdateWORKPRIORITY, doNotUpdateWORKTYPE, doNotUpdateWPEDITSETTING, messageCache, NEWONLY, OLDANDNEW, OLDONLY, ORACLE, SQLINET, SQLMICROSOFT, SQLSERVER, SYSDATATABLES, SYSTEMTABLES, UNKNOWN
Constructor and Description |
---|
UpgTemplate(CommonShell shell) |
Modifier and Type | Method and Description |
---|---|
java.util.ArrayList |
buildRenameColumnStatement(java.lang.String tableName,
java.lang.String oldColumnName,
java.lang.String newColumnName)
Generate a series of sql statements to rename a column within a table.
|
void |
doSql(java.util.AbstractList list)
Loops through an array and calls
doSql for each element. |
void |
doSql(java.lang.String sql)
Looks at params to determine whether the execute only, log only, or both execute and log.
|
void |
doSqlProcedure(java.lang.String storedProcedure,
java.util.LinkedHashMap<java.lang.Object,java.lang.Integer> parameters)
Execute a stored procedure from the database
|
java.sql.Connection |
getDbConnection() |
int |
getDbIn() |
java.lang.String |
getDisplayMessage(java.lang.String errorkey)
Call
getDisplayMessage with null second param. |
java.lang.String |
getDisplayMessage(java.lang.String errorkey,
java.lang.Object[] params)
Error group is assumed to be "configdb".
|
java.lang.String |
getDisplayMessage(java.lang.String errorgroup,
java.lang.String errorkey,
java.lang.Object[] params)
Get Message from XLIFF Hashmap, using group and key.
|
java.io.PrintStream |
getLogStream() |
java.lang.String |
getSchemaOwner() |
Util |
getUtil() |
boolean |
isExecutingSql() |
boolean |
isLoggingSql() |
abstract boolean |
process()
This method must be overridden by the instance of UpgTemplate to perform
whatever special processing is required for the upgrade.
|
void |
showMsg(java.lang.String str)
Display a one-line "info" message to the console and to the logfile.
|
void |
showMXException(MXApplicationException e)
Display a message to the console and to the logfile, including errorGroup and errorKey.
|
void |
showMXException(MXApplicationException e,
boolean infoOnly,
boolean hideErrorKey)
Display a message to the console and to the logfile, including errorGroup and errorKey.
|
void |
updateStatistics(java.util.ArrayList tables,
java.util.TreeMap indexes)
Executes "analyze table/compute statistics" (for Oracle)
or "update statistics" (for SqlServer) for the specified tables/indexes; For use
by app callouts
|
public java.lang.String sYes
public java.lang.String sNo
public UpgTemplate(CommonShell shell) throws java.lang.Exception
java.lang.Exception
public abstract boolean process() throws java.lang.Exception
java.lang.Exception
public void doSql(java.util.AbstractList list) throws java.lang.Exception
doSql
for each element.list
- Any instance or extension of AbstractList, including ArrayList, etc.java.lang.Exception
doSql(String)
public void doSql(java.lang.String sql) throws java.lang.Exception
sql
- The Sql statementjava.lang.Exception
public java.util.ArrayList buildRenameColumnStatement(java.lang.String tableName, java.lang.String oldColumnName, java.lang.String newColumnName)
tableName
- Name of the tableoldColumnName
- Original/Current name of the columnnewColumnName
- New name of the columnpublic void showMXException(MXApplicationException e, boolean infoOnly, boolean hideErrorKey)
e
- The MXApplicationException; must have error group "configdb".infoOnly
- True if this is an Info message, False is this is an Error (or Warning) message.hideErrorKey
- True to hide the errorGroup and errorKey.
This would be True for messages such as the header of the Unlcvt output.getDisplayMessage(java.lang.String, java.lang.Object[])
public java.lang.String getDisplayMessage(java.lang.String errorkey, java.lang.Object[] params)
errorkey
- params
- public java.lang.String getDisplayMessage(java.lang.String errorgroup, java.lang.String errorkey, java.lang.Object[] params)
errorgroup
- errorkey
- params
- public java.lang.String getDisplayMessage(java.lang.String errorkey)
getDisplayMessage
with null second param.
Error group is assumed to be "configdb".errorkey
- public void showMXException(MXApplicationException e)
e
- The MXApplicationException; must have error group "configdb".public final void showMsg(java.lang.String str)
str
- The one-line message to be displayed.public final int getDbIn()
public final java.sql.Connection getDbConnection()
public final java.io.PrintStream getLogStream()
public final Util getUtil()
public final java.lang.String getSchemaOwner()
public final boolean isLoggingSql()
public final boolean isExecutingSql()
public void updateStatistics(java.util.ArrayList tables, java.util.TreeMap indexes) throws MXException, java.rmi.RemoteException
tables
- TreeMap of object metata, for Oracle. (Not used for SqlServer.)indexes
- TreeMap of index metadata for SqlServer. (Not used for Oracle.)MXException
java.rmi.RemoteException
Util.nativeIndexExists(java.lang.String, java.lang.String)
public void doSqlProcedure(java.lang.String storedProcedure, java.util.LinkedHashMap<java.lang.Object,java.lang.Integer> parameters) throws java.lang.Exception
storedProcedure
- Sql statement in the format 'CALL proc_name(?,?,?)'parameters
- Input parameters of the procedure, LinkedHashMap with entries (Object, Integer) where Object is the parameter
and Integer is the data type Types
java.lang.Exception