public class CommonUtil extends java.lang.Object implements FixedLoggers
APPLOGGER, CRONTASKLOGGER, CRONTASKMGRLOGGER, CRONTASKMGRSQLLOGGER, DBCONNECTIONLOGGER, DDLOGGER, DMLOGGER, EVENTLOGGER, EXCEPTIONLOGGER, MAILLOGGER, MAXIMOLOGGER, MTLOGGER, NULLMBOPOINTER, SECURITY, SENDFAILEDLOGGER, SERVICELOGGER, SQLLOGGER
appenderPrefix, LOGGERNAME_APP, LOGGERNAME_CRONTASK, LOGGERNAME_CRONTASKMGR, LOGGERNAME_DBCONNECTION, LOGGERNAME_DD, LOGGERNAME_DM, LOGGERNAME_DMPREVIEW, LOGGERNAME_EVENT, LOGGERNAME_EXCEPTION, LOGGERNAME_MAIL, LOGGERNAME_MAXIMO, LOGGERNAME_MT, LOGGERNAME_NULLMBOPOINTER, LOGGERNAME_SECURITY, LOGGERNAME_SENDFAILED, LOGGERNAME_SERVICE, LOGGERNAME_SQL, LOGGERNAME_SQL_CRONTASKMGR, LOGGERNAME_TXN, loggerPrefix
Constructor and Description |
---|
CommonUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
arrayToString(java.lang.String[] list)
Generate a comma seperated string from an array
|
static java.lang.String |
calcWebUrl(MboRemote doc)
Call @link {#calcWebUrl(MboRemote, MboRemote) calcWebUrl} with second param null.
|
static java.lang.String |
calcWebUrl(MboRemote doc,
MboRemote doclinkMbo)
This method determines the value for the "weburl" used for displaying a document in the browser.
|
static java.lang.String |
calEncodedValue(java.lang.String filepathvalue) |
static java.util.Vector<java.lang.String> |
commaSepStringToVector(java.lang.String tokens) |
static java.util.Vector<java.lang.String> |
commaSepStringToVector(java.lang.String tokens,
boolean toUpper) |
static java.lang.String |
convertGregorianDateToIslamicString(java.util.Date date,
java.util.TimeZone sourceTimeZone,
java.util.TimeZone targetTimeZone,
java.util.Locale l)
Converts the date to the targetTimeZone.
|
static void |
copyDocStoreFile(AttachmentStorage docStore,
java.lang.String in,
java.lang.String out) |
static void |
copyFile(java.lang.String in,
java.lang.String out) |
static java.lang.String |
csvStringFromArray(java.lang.Object[] values)
Returns helper method to return a string of comma separated values from an array of objects
|
static java.lang.String |
EncodeDocLink(java.lang.String docpath)
To encode the doclinks correctly
|
static java.lang.String |
EncodeFilePath(java.lang.String filepathvalue) |
static java.lang.String |
getAppServerPorts()
Method to return the http/https ports of the app server.
|
static java.util.Date |
getCombineDateTime(java.util.Date date,
java.util.Date time)
Help method that combines date and time to one element.
|
static java.lang.String |
getDeploymentMgrURL()
Method to return the url of WAS Deployment Manager.
|
static java.lang.String |
getDomainValDescription(java.lang.String domainid,
java.lang.String maxvalue,
MboRemote tktotal)
get description of the maxvalue in domain
|
static java.lang.String |
getEmailOfPerson(MboRemote person)
Method to get email of a given person
|
static java.lang.String[] |
getEmailsOfPersonGroup(PersonGroupRemote personGroup,
MboRemote mbo,
boolean broadcast)
Method to get emails of a given person group.
|
static java.lang.String[] |
getEmailsOfPersonSet(PersonSetRemote personSet)
Method to get emails of a given set of people.
|
static PersonSetRemote |
getGroupPeople(PersonGroupRemote group,
MboRemote mbo,
boolean isBroadcast)
Returns the people in a person group.
|
static int |
getNextTaskID(int maxTask,
java.lang.String seedName,
java.lang.String intervalName,
java.lang.String siteOrOrg)
Given a number representing the maximum taskID, this method calculates
the next greater TaskID.
|
static java.lang.String |
getSMSNumOfPerson(MboRemote person)
Method to get email of a given person
|
static java.util.HashSet<java.lang.String> |
getSMSPhonesOfPersonSet(PersonSetRemote personSet)
Method to get emails of a given set of people.
|
static javax.security.auth.login.LoginContext |
getWASLoginContext() |
static java.lang.String |
getWASPorts() |
static java.lang.String |
inClauseFromArray(java.lang.Object[] values) |
static java.lang.String |
inClauseFromSet(java.util.Set values) |
static boolean |
isBypassSiteMismatchWarningEnabled(MboRemote mbo,
MXServerRemote mxServer)
Checks if the Bypass Site Mismatch Warning Message maxvar is enabled for the org/site where the mbo, received as a parameter,
belongs to
|
static boolean |
isBypassSiteMismatchWarningEnabled(java.lang.String orgSite,
MXServerRemote mxServer)
Checks if the Bypass Site Mismatch Warning Message maxvar is enabled for the org/site received as a parameter
|
static boolean |
isEmail(java.lang.String notfType) |
static boolean |
isRepairFacilityEnabled(MboRemote mbo,
MXServerRemote mxServer)
Checks if the Repair Facility maxvar is enabled for the org/site where the mbo, received as a parameter,
belongs to
|
static boolean |
isRepairFacilityEnabled(java.lang.String orgSite,
MXServerRemote mxServer)
Checks if the Repair Facility maxvar is enabled for the org/site received as a parameter
|
static boolean |
isSMS(java.lang.String notfType) |
static java.lang.String |
removeNewLines(java.lang.String inStr)
Remove new lines "\r\n" from input string.
|
static java.lang.String |
removeSpaces(java.lang.String inStr)
Given a string, removes all its leading, trailing and in-between spaces.
|
static java.lang.String[] |
vectorToStringArray(java.util.Vector vector)
Helper method to convert a vector of Strings to an array of Strings.
|
public static java.lang.String[] vectorToStringArray(java.util.Vector vector)
vector
- A vector of StringsMXException
java.rmi.RemoteException
public static java.util.Vector<java.lang.String> commaSepStringToVector(java.lang.String tokens)
public static java.util.Vector<java.lang.String> commaSepStringToVector(java.lang.String tokens, boolean toUpper)
public static java.util.Date getCombineDateTime(java.util.Date date, java.util.Date time)
date
- datetime
- timepublic static int getNextTaskID(int maxTask, java.lang.String seedName, java.lang.String intervalName, java.lang.String siteOrOrg) throws MXException, java.rmi.RemoteException
maxTask
- The currently largest TaskID. If a zero is given, then it's assumed
there are no TaskIDs defined, and the TaskSeed, the first TaskID, is returned.seedName
- The maxvar name for the seed.intervalName
- The maxvar name for the interval.siteOrOrg
- The site or org id for the maxvar used.MXException
java.rmi.RemoteException
public static java.lang.String getEmailOfPerson(MboRemote person) throws MXException, java.rmi.RemoteException
person
- The person mbo whose email address is returnedMXException
java.rmi.RemoteException
public static PersonSetRemote getGroupPeople(PersonGroupRemote group, MboRemote mbo, boolean isBroadcast) throws MXException, java.rmi.RemoteException
group
- The given person group.mbo
- The mbo on whose behalf we are resolving the PersonGroup.isBroadcast
- If TRUE, return all persons in the group. Otherwise return the first responsible person based on the current date.MXException
java.rmi.RemoteException
public static java.lang.String[] getEmailsOfPersonGroup(PersonGroupRemote personGroup, MboRemote mbo, boolean broadcast) throws MXException, java.rmi.RemoteException
personGroup
- The personGroup mbo whose email addresses is returnedmbo
- The mbo on whose behalf we are resolving the PersonGroup.broadcast
- Boolean to indicate whether to broadcast to the whole group.MXException
java.rmi.RemoteException
public static java.lang.String[] getEmailsOfPersonSet(PersonSetRemote personSet) throws MXException, java.rmi.RemoteException
personSet
- The set of people whose email addresses to be returned.mbo
- The mbo on whose behalf we are resolving the PersonGroup.MXException
java.rmi.RemoteException
public static java.util.HashSet<java.lang.String> getSMSPhonesOfPersonSet(PersonSetRemote personSet) throws MXException, java.rmi.RemoteException
personSet
- The set of people whose email addresses to be returned.mbo
- The mbo on whose behalf we are resolving the PersonGroup.MXException
java.rmi.RemoteException
public static java.lang.String getSMSNumOfPerson(MboRemote person) throws MXException, java.rmi.RemoteException
person
- The person mbo whose email address is returnedMXException
java.rmi.RemoteException
public static java.lang.String csvStringFromArray(java.lang.Object[] values)
set
- HashSetMXException
java.rmi.RemoteException
public static java.lang.String inClauseFromArray(java.lang.Object[] values)
public static java.lang.String inClauseFromSet(java.util.Set values)
public static java.lang.String calcWebUrl(MboRemote doc) throws java.rmi.RemoteException, MXException
java.rmi.RemoteException
MXException
calcWebUrl(MboRemote, MboRemote)
public static java.lang.String calcWebUrl(MboRemote doc, MboRemote doclinkMbo) throws java.rmi.RemoteException, MXException
If the urltype is FILE:
LinkedDocumentInfo getDocumentURL
and see what it returns using the mapping in doclink.properties.
If the urltype is WWW, this method will pass back the value of "urlname".
If the urltype is DMS:
DMSFactory getDocumentURL
.
doc
- The Doclinks or Docinfo mbo.doclinkMbo
- The Doclinks mbo for DMS urltype. Normally this will be null.
It is provided to support DMS that need values such as document version that
exist only on the doclinks.java.rmi.RemoteException
MXException
LinkedDocumentInfo.getDocumentURL(java.lang.String)
,
DMSFactory.getDocumentURL(psdi.mbo.MboRemote, psdi.mbo.MboRemote, psdi.mbo.MboRemote)
,
replaceString(java.lang.String, java.lang.String, java.lang.String)
public static java.lang.String calEncodedValue(java.lang.String filepathvalue)
public static java.lang.String EncodeDocLink(java.lang.String docpath)
public static java.lang.String EncodeFilePath(java.lang.String filepathvalue)
public static java.lang.String getDomainValDescription(java.lang.String domainid, java.lang.String maxvalue, MboRemote tktotal) throws MXException, java.rmi.RemoteException
the
- name of the domainidthe
- maxvalueMXException
java.rmi.RemoteException
public static java.lang.String arrayToString(java.lang.String[] list)
public static void copyDocStoreFile(AttachmentStorage docStore, java.lang.String in, java.lang.String out) throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public static void copyFile(java.lang.String in, java.lang.String out) throws MXException
MXException
public static javax.security.auth.login.LoginContext getWASLoginContext() throws java.lang.Exception
java.lang.Exception
public static java.lang.String getDeploymentMgrURL()
public static java.lang.String getAppServerPorts()
public static java.lang.String getWASPorts() throws java.lang.Exception
java.lang.Exception
public static java.lang.String removeSpaces(java.lang.String inStr)
inStr
- public static java.lang.String removeNewLines(java.lang.String inStr)
public static boolean isRepairFacilityEnabled(MboRemote mbo, MXServerRemote mxServer) throws java.rmi.RemoteException, MXException
mbo
- mxServer
- Required argument when this method is called by a databean. If it is null, MXServer.getMXServer()
is then called.java.rmi.RemoteException
MXException
public static boolean isRepairFacilityEnabled(java.lang.String orgSite, MXServerRemote mxServer) throws java.rmi.RemoteException, MXException
orgSite
- mxServer
- Required argument when this method is called by a databean. If it is null, MXServer.getMXServer()
is then called.java.rmi.RemoteException
MXException
public static boolean isBypassSiteMismatchWarningEnabled(MboRemote mbo, MXServerRemote mxServer) throws java.rmi.RemoteException, MXException
mbo
- mxServer
- Required argument when this method is called by a databean. If it is null, MXServer.getMXServer()
is then called.java.rmi.RemoteException
MXException
public static boolean isBypassSiteMismatchWarningEnabled(java.lang.String orgSite, MXServerRemote mxServer) throws java.rmi.RemoteException, MXException
orgSite
- mxServer
- Required argument when this method is called by a databean. If it is null, MXServer.getMXServer()
is then called.java.rmi.RemoteException
MXException
public static java.lang.String convertGregorianDateToIslamicString(java.util.Date date, java.util.TimeZone sourceTimeZone, java.util.TimeZone targetTimeZone, java.util.Locale l)
date
- date to be converted, if null passed then it will assume it to be current date.sourceTimeZone
- The timezone in which this date is specified.targetTomeZone
- The timezone to which this date will be converted.l
- Locale of the user.java.rmi.RemoteException
MXException
public static boolean isEmail(java.lang.String notfType) throws java.rmi.RemoteException, MXException
java.rmi.RemoteException
MXException
public static boolean isSMS(java.lang.String notfType) throws java.rmi.RemoteException, MXException
java.rmi.RemoteException
MXException