public class DMUtil
extends java.lang.Object
Constructor and Description |
---|
DMUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkRestriction(java.sql.Connection conn,
java.lang.String source)
Check if any row exist for this source in target dmrestriction table.
|
static void |
clearNewDeployValues()
Clear the deploy map
|
static long |
createBulletinBoard(UserInfo ui,
boolean isCreate)
Creates a bulletin board message before start deploying in target
environment
|
static java.util.jar.JarOutputStream |
createJarArchive(java.util.jar.JarOutputStream archiveStream,
java.lang.String inFileName,
java.io.ByteArrayInputStream in)
Create a jar stream by adding the inputstream to the jar
|
static java.lang.String |
dateInDigits(boolean includeMilliseconds) |
static void |
deleteInvalidStagingRows(java.lang.String pkgDefName,
java.lang.String source,
java.lang.String pkg,
UserInfo ui)
Delete staging records with diststatus 0
|
static void |
deletePreviewLogs(java.lang.String pkgName)
Delete preview log files
|
static void |
dmMapDefCheck(MboRemote pkgMbo)
Deploy the package metadata.
|
static MboRemote |
findTopLevelMosForChild(MosInfo mosInfo,
MboRemote childMbo)
Find top level mbo for a child mbo
|
static java.lang.String |
getAttrValues(MboSet mboSet,
java.lang.String attrName,
int maxCount)
Returns the attribute values in the mboset in a comma separated string.
|
static java.util.LinkedHashMap<java.lang.String,java.util.LinkedList<java.lang.String>> |
getCfgObjsForGrp(MboRemote defMbo)
Get MOSs for groups.
|
static java.lang.String |
getDatabaseName()
Get the database name from system tables depending on database type.
|
static java.lang.String |
getDatabaseName(java.sql.Connection conn)
Get the database name from system tables depending on database type.
|
static int |
getDatabaseType(java.sql.Connection conn)
Get the database type for the connection
|
static java.io.File |
getDatedFile(java.io.File folder,
java.lang.String prefix,
java.lang.String suffix)
Generates a filename that is not used, based on a prefix, suffix, and the current date/time.
|
static java.lang.String |
getDBHostName()
Get the host name where database is installed from system tables
depending on database type.
|
static java.lang.String |
getDBHostName(java.sql.Connection conn)
Get the host name where database is installed from system tables
depending on database type.
|
static java.lang.String[] |
getDDCfgGroupNames()
Returns the Data Dictionary config group's name
|
static java.lang.String[] |
getDDCfgGroupNames(UserInfo ui)
Returns the Data Dictionary config group's name, use specific UserInfo for PMR 09898,SGC,724.
|
static MboSetRemote |
getDDCfgGroups()
Get the DMCfgGroup objects which is of type DDMETADATA.
|
static MboSetRemote |
getDDCfgGroups(UserInfo ui)
Get the DMCfgGroup objects which is of type DDMETADATA with a specific userInfo for PMR 09898,SGC,724.
|
static java.util.Map<java.lang.String,java.lang.String> |
getDeployDefaultValueSet()
Default values MEA needs to ignore if value in XML is null.
|
static MXLogger |
getDMLogger(UserInfo ui)
Get the logger for DM
|
static long |
getLongKey(java.lang.String key)
Given a key string, return its value in long.
|
static byte[] |
getManifestFromFile(java.lang.String fileName,
java.lang.String direction) |
static byte[] |
getManifestFromStaging(UserInfo ui,
java.lang.String pkgName)
Get the manifest from staging table
|
static java.lang.String |
getMessageText(UserInfo msgUserInfo,
java.lang.String errorKey,
java.lang.Object[] params)
Return the message in correct language
|
static java.util.HashMap |
getNewDeployValues()
Get the deploy map
|
static java.lang.String |
getPackageName(java.lang.String source,
java.lang.String pkgDefName)
Get the package instnce name from source and package definition name
|
static java.lang.String[] |
getPkgAndSourceFromJarName(java.lang.String jarName)
From pkg archive file, read the pkgdef name and source.Should be only
called for file type
|
static java.lang.String |
getPkgFileName(MboRemote stageMbo)
Get the package file name
|
static MboRemote |
getPKGMETADATACfgGroup()
Get the DMCfgGroup object which is of type PKGMETAMETADATA.
|
static java.lang.String |
getPKGMETADATAGroupName()
Returns the package metadata config group's name
|
static java.lang.String |
getPKInfo(MboRemote topMbo)
Get primary key information in format for storing on DMCompResult.PrimaryKeys.
|
static java.lang.String |
getSchemaName()
Get the schema name from system tables depending on database type.
|
static java.lang.String |
getSchemaName(java.sql.Connection conn)
Get the schema name from system tables depending on database type.
|
static java.lang.String |
getSourceName()
Returns the source name.
|
static java.lang.String |
getSourceName(java.sql.Connection conn) |
static int |
getTenantID(MboRemote mbo)
Returns the TenantID of the Mbo.
|
static java.lang.String[] |
getTypeAndOrderFromFileName(java.lang.String fileName,
java.lang.String pkgSrc)
Read each jar entry and get pkgstaging information from jar entry name
|
static boolean |
inMEATransaction()
Checks if creation of a mbo is from MEA or not.
|
static boolean |
inMEATransaction(MXTransaction txn)
Checks if creation of a mbo is from MEA or not.
|
static void |
putNewDeployValues(java.lang.String key,
java.lang.Object value) |
static void |
readJarArchive(java.io.File jarF,
java.lang.String pkgFileName,
UserInfo ui)
Read each jar entry from .zip file and write to the database
|
static MboRemote |
redistributePackage(MboRemote pkgMbo)
Redistribute a package from target to another new target
|
static MboRemote |
redistributePkgMetaData(MboRemote pkgDefMbo,
MboRemote pkgMbo)
Staging record withtype pkgmetadata has to be recreated again for
redistribution
|
static void |
removeBulletinBoard(UserInfo ui,
long bbId)
Removes the bulletin board message
|
static void |
writeLongOpMsg(MboSetRemote mboSet,
java.lang.String msg)
Write long op messages to mbo set.
|
static void |
writeLongOpMsg(UserInfo msgUI,
MboSetRemote mboSet,
java.lang.String msg)
Write long op messages to mbo set.
|
static java.lang.String |
writeToDMMessage(MboRemote ownerMbo,
java.lang.String pkgName,
java.lang.String type,
java.lang.String errorKey,
java.lang.Throwable t,
java.lang.String msgDetail,
java.lang.Object[] params,
boolean isLongOpMsg)
Write message to DMMessage table
|
static java.lang.String |
writeToDMMessage(MboRemote ownerMbo,
java.lang.String pkgName,
java.lang.String type,
java.lang.String errorKey,
java.lang.Throwable t,
java.lang.String msgDetail,
java.lang.Object[] params,
boolean isLongOpMsg,
UserInfo msgUI) |
public static final MXLogger DMLOGGER
public static java.util.jar.JarOutputStream createJarArchive(java.util.jar.JarOutputStream archiveStream, java.lang.String inFileName, java.io.ByteArrayInputStream in) throws MXException
archiveStream
- inFileName
- in
- MXException
public static java.lang.String getPackageName(java.lang.String source, java.lang.String pkgDefName) throws MXException
source
- pkgDefName
- MXException
public static java.io.File getDatedFile(java.io.File folder, java.lang.String prefix, java.lang.String suffix) throws java.rmi.RemoteException
folder
- Where the file will be created.prefix
- The text before the date, i.e. "COLLECTION_OBJSTRUCT_".suffix
- The text after the date, i.e. ".XML"java.rmi.RemoteException
public static java.lang.String dateInDigits(boolean includeMilliseconds) throws java.rmi.RemoteException
java.rmi.RemoteException
public static MboSetRemote getDDCfgGroups() throws MXException
MXException
public static MboSetRemote getDDCfgGroups(UserInfo ui) throws MXException
UserInfo
- MXException
public static java.lang.String[] getDDCfgGroupNames() throws MXException
MXException
java.rmi.RemoteException
public static int getTenantID(MboRemote mbo) throws MXException, java.rmi.RemoteException
mbo
- MXException
java.rmi.RemoteException
public static java.lang.String[] getDDCfgGroupNames(UserInfo ui) throws MXException
UserInfo
- MXException
java.rmi.RemoteException
public static MboRemote getPKGMETADATACfgGroup() throws MXException
MXException
public static java.lang.String getPKGMETADATAGroupName() throws MXException
MXException
java.rmi.RemoteException
public static java.lang.String[] getPkgAndSourceFromJarName(java.lang.String jarName) throws MXException
jarName
- java.lang.Exception
MXException
public static java.lang.String[] getTypeAndOrderFromFileName(java.lang.String fileName, java.lang.String pkgSrc) throws java.lang.Exception
fileName
- pkgSrc
- java.lang.Exception
public static void readJarArchive(java.io.File jarF, java.lang.String pkgFileName, UserInfo ui) throws MXException, java.rmi.RemoteException
pkgStream
- pkgFileName
- ui
- MXException
java.rmi.RemoteException
public static void deleteInvalidStagingRows(java.lang.String pkgDefName, java.lang.String source, java.lang.String pkg, UserInfo ui) throws java.lang.Exception
pkgDefName
- source
- pkg
- ui
- java.lang.Exception
public static java.lang.String getSourceName() throws MXException
MXException
public static java.lang.String getSourceName(java.sql.Connection conn) throws MXException
MXException
public static java.lang.String getDatabaseName(java.sql.Connection conn) throws MXException
dbType
- MXException
java.rmi.RemoteException
public static java.lang.String getDatabaseName() throws MXException
dbType
- MXException
java.rmi.RemoteException
public static java.lang.String getSchemaName(java.sql.Connection conn) throws MXException
dbType
- MXException
java.rmi.RemoteException
public static java.lang.String getSchemaName() throws MXException
dbType
- MXException
java.rmi.RemoteException
public static java.lang.String getDBHostName(java.sql.Connection conn) throws MXException
dbType
- MXException
java.rmi.RemoteException
public static java.lang.String getDBHostName() throws MXException
dbType
- MXException
java.rmi.RemoteException
public static boolean checkRestriction(java.sql.Connection conn, java.lang.String source) throws MXException
conn
- source
- MXException
public static boolean inMEATransaction(MXTransaction txn) throws java.rmi.RemoteException
txn
- java.rmi.RemoteException
public static boolean inMEATransaction() throws java.rmi.RemoteException
txn
- java.rmi.RemoteException
public static long createBulletinBoard(UserInfo ui, boolean isCreate) throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public static void removeBulletinBoard(UserInfo ui, long bbId) throws MXException, java.rmi.RemoteException
ui
- bbId
- MXException
java.rmi.RemoteException
public static MboRemote redistributePackage(MboRemote pkgMbo) throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public static MboRemote redistributePkgMetaData(MboRemote pkgDefMbo, MboRemote pkgMbo) throws java.lang.Exception
pkgDefMbo
- pkgMbo
- MXException
java.rmi.RemoteException
java.lang.Exception
public static java.lang.String writeToDMMessage(MboRemote ownerMbo, java.lang.String pkgName, java.lang.String type, java.lang.String errorKey, java.lang.Throwable t, java.lang.String msgDetail, java.lang.Object[] params, boolean isLongOpMsg)
ownerMbo
- pkgName
- type
- errorKey
- t
- msgDetail
- params
- MXException
public static java.lang.String writeToDMMessage(MboRemote ownerMbo, java.lang.String pkgName, java.lang.String type, java.lang.String errorKey, java.lang.Throwable t, java.lang.String msgDetail, java.lang.Object[] params, boolean isLongOpMsg, UserInfo msgUI)
public static long getLongKey(java.lang.String key)
key
- public static java.util.Map<java.lang.String,java.lang.String> getDeployDefaultValueSet()
public static java.lang.String getAttrValues(MboSet mboSet, java.lang.String attrName, int maxCount) throws MXException, java.rmi.RemoteException
mboSet
- The mbo set which attribute values are being extracted.attrName
- The attribute name.maxCount
- The maximum number of values shown in the list. The rest will
be represented by "...". If maxCount=-1, will print all values
in set.MXException
java.rmi.RemoteException
public static byte[] getManifestFromFile(java.lang.String fileName, java.lang.String direction) throws MXException
MXException
public static void writeLongOpMsg(MboSetRemote mboSet, java.lang.String msg) throws java.rmi.RemoteException
mboSet
- msg
- java.rmi.RemoteException
public static void writeLongOpMsg(UserInfo msgUI, MboSetRemote mboSet, java.lang.String msg) throws java.rmi.RemoteException
userinfo
- for messagesmboSet
- msg
- java.rmi.RemoteException
public static void putNewDeployValues(java.lang.String key, java.lang.Object value) throws java.rmi.RemoteException
java.rmi.RemoteException
public static void clearNewDeployValues()
java.rmi.RemoteException
public static java.util.HashMap getNewDeployValues()
public static java.lang.String getPkgFileName(MboRemote stageMbo) throws MXException, java.rmi.RemoteException
stageMbo
- MXException
java.rmi.RemoteException
public static byte[] getManifestFromStaging(UserInfo ui, java.lang.String pkgName) throws MXException, java.rmi.RemoteException
ui
- pkgName
- MXException
java.rmi.RemoteException
public static MXLogger getDMLogger(UserInfo ui)
ui
- public static void deletePreviewLogs(java.lang.String pkgName) throws MXException, java.rmi.RemoteException
java.lang.Exception
MXException
java.rmi.RemoteException
public static java.lang.String getMessageText(UserInfo msgUserInfo, java.lang.String errorKey, java.lang.Object[] params)
msgUserInfo
- errorKey
- public static java.util.LinkedHashMap<java.lang.String,java.util.LinkedList<java.lang.String>> getCfgObjsForGrp(MboRemote defMbo) throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public static int getDatabaseType(java.sql.Connection conn) throws java.lang.Exception
conn
- java.lang.Exception
public static MboRemote findTopLevelMosForChild(MosInfo mosInfo, MboRemote childMbo) throws MXException, java.rmi.RemoteException
mosInfo
- childMbo
- MXException
java.rmi.RemoteException
public static java.lang.String getPKInfo(MboRemote topMbo) throws MXException, java.rmi.RemoteException
MboRemote
- top level mboMXException
java.rmi.RemoteException
public static void dmMapDefCheck(MboRemote pkgMbo) throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException