public class MicUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static MXLogger |
INTEGRATIONLOGGER
The Integration logger
|
| Constructor and Description |
|---|
MicUtil() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
checkALNDomainValue(java.lang.String domainId,
java.lang.String maxValue)
Check whether the internal value exists in the specified alndomain.
|
static boolean |
checkLicense(java.util.Set allLicences)
Parse license keys and check if license is installed
|
static boolean |
checkStatus(StructureData irData,
java.lang.String extSystem,
java.lang.String sendListName,
java.lang.String orgId,
java.lang.String siteId,
boolean sendUpdates)
This method checks status and does the following.
|
static java.lang.String |
dateToJmigString(java.util.Date in)
Deprecated.
please use ConversionUtil.dateToString.
|
static void |
deleteFile(java.lang.String filepath)
Delete file
|
static void |
deleteFiles(java.util.List filesList,
java.lang.String folder)
Delete list of files directly residing under specified folder.
|
static java.lang.Object |
deserialize(byte[] objData)
De-serialize an object
|
static java.lang.String |
formatMboColumn(MboRemote mbo,
java.lang.String name)
This will format column value to string
|
static int |
getAdminModeState() |
static java.lang.String[] |
getAltKeyArray(java.lang.String indexName)
Deprecated.
|
static java.lang.String[] |
getAltKeyArray(java.lang.String indexName,
java.sql.Connection con)
Deprecated.
|
static java.lang.String[] |
getAltKeyArray(java.lang.String indexName,
java.lang.String entityName)
Get Alternative Key for the Mbo
|
static java.lang.String |
getAppExportDir(java.lang.String fileFormat)
Get the name of the extract directory.
|
static java.lang.String |
getBaseCurrency(java.lang.String key,
UserInfo info,
java.lang.String orgid)
Return BaseCurrencyCode
|
static boolean |
getBooleanProperty(java.lang.String propName,
boolean dflt) |
static java.lang.String |
getConcatenatedValuesList(java.util.List list,
char separationChar,
int maxLength)
Generate the string by concatenating the list elements by using supplied separating character.
|
static java.lang.String[] |
getContextKeyArray(java.lang.String name)
Create array of keys from data dictionary
|
static java.lang.String |
getDefaultDirectory()
Get default file directory for tenant
|
static java.lang.String |
getEntityName(java.lang.String name)
Return entity name for an object name
|
static java.lang.String |
getExternalValueList(java.lang.String listName,
java.lang.String maxValue)
Deprecated.
please use the ones which take site org id as parameters.
|
static java.lang.String |
getExternalValueList(java.lang.String listName,
java.lang.String maxValue,
java.lang.String siteId,
java.lang.String orgId)
Get value for a MAXVALUE in value list
|
static java.lang.String |
getExtractDir(java.lang.String extSysName,
java.lang.String fileFormat)
Get the name of the extract directory.
|
static java.lang.String |
getFileName(java.util.Map msgProperties,
java.lang.String fileType,
boolean queueDir)
Generate the file name and return it based on given message data and
file type(error/retry/delete/deletedhistory) that is being requested
|
static java.lang.String |
getFileName(java.lang.String extSystem,
java.lang.String serviceName,
java.lang.String messageId,
java.lang.String queueName,
java.lang.String fileType,
boolean queueDir)
Get the full path and file name based on given message data.
|
static java.lang.String |
getFromEmail()
Get From Email address for Integration
|
static int |
getIntegerProperty(java.lang.String propName,
int dflt) |
static java.lang.String |
getInternalValueList(java.lang.String listName,
java.lang.String value)
Get MAXVALUE for a value in value list
|
static java.lang.String |
getItemType(MboRemote mbo,
java.lang.String relation) |
static java.lang.String[] |
getKeyArray(MicSetInfo micInfo)
Deprecated.
|
static java.lang.String[] |
getKeyArray(java.lang.String name)
Create array of keys from data dictionary
|
static java.util.Iterator |
getKeyMboValues(java.lang.String name) |
static int |
getMaximoType(java.lang.String objectName,
java.lang.String attributeName)
Get MAXIMO Type for the MAXIMO Attribute
|
static java.lang.String |
getMaxVar(java.lang.String varname)
Returns the value for the given maxvar.
|
static java.lang.String |
getMaxVar(java.lang.String key,
java.lang.String orgid,
java.lang.String siteid)
Return MaxVar value for the key using ORGID and SITEID
|
static java.lang.String |
getMeaGlobalDir()
Get the integration global directory.
|
static java.lang.String |
getMeaGlobalDir(boolean getDefaultDir)
Get the integration global directory.
|
static java.lang.String |
getMEAProperty(java.lang.String propertyName)
Get MEA Property.
|
static java.lang.String |
getMeaTextDelimiter()
Get the integration default Text Delimiter.
|
static java.lang.String |
getMeaTextQualifier()
Get the integration default Text Delimiter.
|
static java.lang.String |
getProperty(java.lang.String propName)
Get property value for a dynamic property [may or may not be existing] without the overhead of logging a miss
|
static java.sql.Connection |
getRemoteConnection(java.lang.String driver,
java.lang.String url,
java.lang.String username,
java.lang.String password)
Get remote databse Connection
|
static java.lang.String |
getToEmail()
Get To Email address for Integration
|
static int |
getType(int maxtype)
Get Java Type for the MAXIMO Type
|
static java.lang.String |
getUserNo(MboSetRemote mboSet)
Returns Local value for NO.
|
static java.lang.String |
getUserYes(MboSetRemote mboSet)
Returns Local value for YES.
|
static java.lang.String |
getYORNValue(int val,
MboSetRemote mboSet)
Returns Local value YES/NO.
|
static boolean |
isCondExpression(java.lang.String cond) |
static boolean |
isResponseRequired(java.lang.String messageType)
Get Response Required to return response for the all operation
|
static java.util.Date |
jmigStringToDateTime(java.lang.String in)
Deprecated.
please use ConversionUtil.stringToDate.
|
static boolean |
parseCondition(java.lang.String str,
MboRemote mbo)
This will validate a condition
|
static java.lang.String |
prettyPrintJSON(byte[] byteData) |
static byte[] |
serializeData(java.io.Serializable obj)
Serialize an object
|
static void |
setDefaultSite(UserInfo userInfo) |
static void |
updateSendersysid(java.lang.String tableName,
java.lang.String where,
java.sql.Connection con)
Update Sendersysid for the table
|
static void |
validateOrgSite(StructureData struc,
MboSetRemote mboSet,
java.lang.String orgName,
java.lang.String siteName,
java.lang.String itemSetName,
java.lang.String companySetName)
Validate ORG and SITE for the inbound transaction.
|
static void |
validateOrgSite(StructureObject struc,
MboSetRemote mboSet,
java.lang.String orgName,
java.lang.String siteName,
java.lang.String itemSetName,
java.lang.String companySetName)
Validate ORG and SITE for the inbound transaction.
|
public static final MXLogger INTEGRATIONLOGGER
public static java.lang.String getItemType(MboRemote mbo, java.lang.String relation) throws MXException, java.rmi.RemoteException
MXExceptionjava.rmi.RemoteExceptionpublic static java.lang.String getProperty(java.lang.String propName)
propName - the name of the Maximo propertypublic static boolean getBooleanProperty(java.lang.String propName,
boolean dflt)
throws MXApplicationException
MXApplicationExceptionpublic static int getIntegerProperty(java.lang.String propName,
int dflt)
throws MXApplicationException
MXApplicationExceptionpublic static java.lang.String[] getAltKeyArray(java.lang.String indexName,
java.sql.Connection con)
throws MXException,
java.rmi.RemoteException
indexName - Name of the index which have alternative key columnscon - Database connectionMXException - MAXIMO exceptionjava.rmi.RemoteException - Remote exceptiongetAltKeyArray(String indexName)public static java.lang.String[] getAltKeyArray(java.lang.String indexName)
throws MXException,
java.rmi.RemoteException
indexName - Name of the index which have alternative key columnsconn - Database connectionMXException - MAXIMO exceptionjava.rmi.RemoteException - Remote exceptionMicUtil.getAltKeyArray(String indexName)public static void updateSendersysid(java.lang.String tableName,
java.lang.String where,
java.sql.Connection con)
throws MXException,
java.rmi.RemoteException
tableName - Name of MAXIMO tablewhere - Where clausecon - Database connectionMXException - MAXIMO exceptionjava.rmi.RemoteException - Remote exceptionpublic static java.lang.String getFromEmail()
public static java.lang.String getToEmail()
public static java.lang.String[] getKeyArray(MicSetInfo micInfo) throws MXException, java.rmi.RemoteException
micInfo - Information of the Integration ObjectMXException - MAXIMO exceptionjava.rmi.RemoteException - Remote exceptionpublic static java.lang.String[] getContextKeyArray(java.lang.String name)
throws MXException,
java.rmi.RemoteException
name - Object nameMXException - MAXIMO exceptionjava.rmi.RemoteException - Remote exceptionpublic static java.lang.String[] getKeyArray(java.lang.String name)
throws MXException,
java.rmi.RemoteException
name - Object nameMXException - MAXIMO exceptionjava.rmi.RemoteException - Remote exceptionpublic static java.util.Iterator getKeyMboValues(java.lang.String name)
throws MXException
MXExceptionpublic static java.lang.String getEntityName(java.lang.String name)
throws MXException,
java.rmi.RemoteException
name - Object nameMXException - MAXIMO exceptionjava.rmi.RemoteException - Remote exceptionpublic static void validateOrgSite(StructureData struc, MboSetRemote mboSet, java.lang.String orgName, java.lang.String siteName, java.lang.String itemSetName, java.lang.String companySetName) throws MXException, java.rmi.RemoteException
struc - StructureData ObjectmboSet - MboSet to set org or sit id parametersorgName - Name of field which has Organization IdsiteName - Name of field which has Site IditemSetName - Name of field which has Item Set IdcompanySetName - Name of field which has Company Set IdMXException - MAXIMO exceptionjava.rmi.RemoteException - Remote exceptionpublic static void validateOrgSite(StructureObject struc, MboSetRemote mboSet, java.lang.String orgName, java.lang.String siteName, java.lang.String itemSetName, java.lang.String companySetName) throws MXException, java.rmi.RemoteException
struc - StructureData ObjectmboSet - MboSet to set org or sit id parametersorgName - Name of field which has Organization IdsiteName - Name of field which has Site IditemSetName - Name of field which has Item Set IdcompanySetName - Name of field which has Company Set IdMXException - MAXIMO exceptionjava.rmi.RemoteException - Remote exceptionpublic static java.lang.String dateToJmigString(java.util.Date in)
in - Give date in java.util.Date formatpublic static java.util.Date jmigStringToDateTime(java.lang.String in)
throws MXException
in - Give date in String formatMXExceptionpublic static void deleteFile(java.lang.String filepath)
throws MXException
filepath - Give path of the file.MXException - MAXIMO exceptionpublic static java.lang.String getBaseCurrency(java.lang.String key,
UserInfo info,
java.lang.String orgid)
throws MXException,
java.rmi.RemoteException
key - BaseCurrency or BaseCurrency2info - UserInfo Objectorgid - Organization IdMXException - MAXIMO exceptionjava.rmi.RemoteException - Remote exceptionpublic static boolean parseCondition(java.lang.String str,
MboRemote mbo)
throws MXException,
java.rmi.RemoteException
str - Condition to evaluatembo - Mbo to apply conditionMXException - MAXIMO exceptionjava.rmi.RemoteException - Remote exceptionpublic static boolean isCondExpression(java.lang.String cond)
public static java.lang.String getMaxVar(java.lang.String key,
java.lang.String orgid,
java.lang.String siteid)
throws MXException,
java.rmi.RemoteException
key - MaxVar Nameorgid - Organization Idsiteid - Site IdMXException - MAXIMO exceptionjava.rmi.RemoteException - Remote exceptionpublic static java.sql.Connection getRemoteConnection(java.lang.String driver,
java.lang.String url,
java.lang.String username,
java.lang.String password)
throws MXException
driver - Database Driver Nameurl - URL Nameusername - User Namepassword - PasswordMXException - MAXIMO exceptionpublic static int getType(int maxtype)
maxtype - MAXIMO Data Typepublic static int getMaximoType(java.lang.String objectName,
java.lang.String attributeName)
throws MXException,
java.rmi.RemoteException
objectName - Object NameattributeName - Attribute NameMXException - MAXIMO exceptionjava.rmi.RemoteException - Remote exceptionpublic static byte[] serializeData(java.io.Serializable obj)
obj - Serializable ObjectMXException - MAXIMO exceptionjava.rmi.RemoteException - Remote exceptionpublic static java.lang.Object deserialize(byte[] objData)
objData - Data in Byte Array formatMXException - MAXIMO exceptionjava.rmi.RemoteException - Remote exceptionpublic static java.lang.String getMEAProperty(java.lang.String propertyName)
propertyName - Name of the propertypublic static java.lang.String getYORNValue(int val,
MboSetRemote mboSet)
throws MXException,
java.rmi.RemoteException
val - Yes or No valuemboSet - MboSet referenceMXException - -
MAXIMO exceptionjava.rmi.RemoteException - -
Remote exceptionpublic static java.lang.String getUserYes(MboSetRemote mboSet) throws MXException, java.rmi.RemoteException
mboSet - MboSet referenceMXException - -
MAXIMO exceptionjava.rmi.RemoteException - -
Remote exceptionpublic static java.lang.String getUserNo(MboSetRemote mboSet) throws MXException, java.rmi.RemoteException
mboSet - MboSet referenceMXException - -
MAXIMO exceptionjava.rmi.RemoteException - -
Remote exceptionpublic static java.lang.String getMaxVar(java.lang.String varname)
throws MXException,
java.rmi.RemoteException
varname - the maxvar nameMXException - -
MAXIMO exceptionjava.rmi.RemoteException - -
Remote exceptionpublic static java.lang.String getMeaGlobalDir()
throws MXException
MXExceptionpublic static java.lang.String getMeaGlobalDir(boolean getDefaultDir)
throws MXException
MXExceptionpublic static java.lang.String getExternalValueList(java.lang.String listName,
java.lang.String maxValue)
throws MXException,
java.rmi.RemoteException
maxValue - -
value to search forMXException - -
MAXIMO exceptionjava.rmi.RemoteException - -
Remote exceptionpublic static java.lang.String getExternalValueList(java.lang.String listName,
java.lang.String maxValue,
java.lang.String siteId,
java.lang.String orgId)
throws MXException,
java.rmi.RemoteException
listName - - list to searchmaxValue - -
value to search forMXException - -
MAXIMO exceptionjava.rmi.RemoteException - -
Remote exceptionpublic static java.lang.String getInternalValueList(java.lang.String listName,
java.lang.String value)
throws MXException,
java.rmi.RemoteException
listName - - list to searchvalue - -
value to search forMXException - -
MAXIMO exceptionjava.rmi.RemoteException - -
Remote exceptionpublic static java.lang.String formatMboColumn(MboRemote mbo, java.lang.String name) throws MXException, java.rmi.RemoteException
mbo - Mbo referencename - Column nameMXException - MAXIMO exceptionjava.rmi.RemoteException - Remote exceptionpublic static java.lang.String getFileName(java.util.Map msgProperties,
java.lang.String fileType,
boolean queueDir)
msgProperties - Message properties having information about the messagefileType - Full path including fileType (example - error/retry/delete/deletedhistory))queueDir - Returned filename will be under queuename/sender sub folder if this parameter is truepublic static java.lang.String getFileName(java.lang.String extSystem,
java.lang.String serviceName,
java.lang.String messageId,
java.lang.String queueName,
java.lang.String fileType,
boolean queueDir)
extSystem - External SystemserviceName - Service NamemessageId - Message IDqueueName - Queue NamefileType - Full path including fileType (example - error/retry/delete/deletedhistory))queueDir - true to include queueName/extSystem in pathpublic static java.lang.String getConcatenatedValuesList(java.util.List list,
char separationChar,
int maxLength)
list - List of elements to be concatenated togetherseparationChar - Separator to used while doing concatenationmaxLength - Concatenation is limited to this lengthpublic static java.lang.String getMeaTextDelimiter()
public static java.lang.String getMeaTextQualifier()
public static java.lang.String getExtractDir(java.lang.String extSysName,
java.lang.String fileFormat)
throws MXException
extSysName - External System NamefileFormat - File format.MXExceptionpublic static java.lang.String getAppExportDir(java.lang.String fileFormat)
throws MXException
fileFormat - File format.MXExceptionpublic static void deleteFiles(java.util.List filesList,
java.lang.String folder)
filesList - List of files to be deleted which reside directly under specified folderfolder - Folder name under which the files to be deleted existpublic static java.lang.String[] getAltKeyArray(java.lang.String indexName,
java.lang.String entityName)
throws MXException,
java.rmi.RemoteException
indexName - Name of the index which have alternateive key columnsMXException - MAXIMO exceptionjava.rmi.RemoteException - Remote exceptionpublic static boolean isResponseRequired(java.lang.String messageType)
throws MXException,
java.rmi.RemoteException
messageType - get operationMXExceptionjava.rmi.RemoteExceptionpublic static java.lang.String getDefaultDirectory()
throws MXException
java.rmi.RemoteException - Remote exceptionMXExceptionpublic static boolean checkLicense(java.util.Set allLicences)
throws java.rmi.RemoteException,
MXException
mdi - MosDetailInfojava.rmi.RemoteExceptionMXExceptionpublic static void setDefaultSite(UserInfo userInfo) throws MXException, java.rmi.RemoteException
MXExceptionjava.rmi.RemoteExceptionpublic static java.lang.String prettyPrintJSON(byte[] byteData)
throws java.io.IOException
java.io.IOExceptionpublic static boolean checkStatus(StructureData irData, java.lang.String extSystem, java.lang.String sendListName, java.lang.String orgId, java.lang.String siteId, boolean sendUpdates) throws MXException, java.rmi.RemoteException
irData - StructureData for IR.extSystem - Name of the External System.sendListName - Name of the XXSEND list.orgId - orgId for the list controlsiteId - siteId for the list controlsendUpdates - indicator to send updatesMXExceptionjava.rmi.RemoteExceptionpublic static int getAdminModeState()
throws java.rmi.RemoteException,
MXException
java.rmi.RemoteExceptionMXExceptionpublic static java.lang.String checkALNDomainValue(java.lang.String domainId,
java.lang.String maxValue)
throws MXException,
java.rmi.RemoteException
domainId - maxValue - MXExceptionjava.rmi.RemoteException