psdi.util

Class CommonUtil

  • java.lang.Object
    • psdi.util.CommonUtil
    • Constructor Detail

      • CommonUtil

        public CommonUtil()
    • Method Detail

      • vectorToStringArray

        public static java.lang.String[] vectorToStringArray(java.util.Vector vector)
        Helper method to convert a vector of Strings to an array of Strings.
        Parameters:
        vector - A vector of Strings
        Returns:
        An array of Strings
        Throws:
        MXException
        java.rmi.RemoteException
      • commaSepStringToVector

        public static java.util.Vector commaSepStringToVector(java.lang.String tokens)
      • commaSepStringToVector

        public static java.util.Vector commaSepStringToVector(java.lang.String tokens,
                                                              boolean toUpper)
      • getCombineDateTime

        public static java.util.Date getCombineDateTime(java.util.Date date,
                                                        java.util.Date time)
        Help method that combines date and time to one element.
        Parameters:
        date - date
        time - time
        Returns:
        Combined Date
      • getNextTaskID

        public static int getNextTaskID(int maxTask,
                                        java.lang.String seedName,
                                        java.lang.String intervalName,
                                        java.lang.String siteOrOrg)
                                 throws MXException,
                                        java.rmi.RemoteException
        Given a number representing the maximum taskID, this method calculates the next greater TaskID.
        Parameters:
        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.
        Returns:
        The next TaskID to use.
        Throws:
        MXException
        java.rmi.RemoteException
      • getEmailOfPerson

        public static java.lang.String getEmailOfPerson(MboRemote person)
                                                 throws MXException,
                                                        java.rmi.RemoteException
        Method to get email of a given person
        Parameters:
        person - The person mbo whose email address is returned
        Returns:
        email address of the person
        Throws:
        MXException
        java.rmi.RemoteException
      • getGroupPeople

        public static PersonSetRemote getGroupPeople(PersonGroupRemote group,
                                                     MboRemote mbo,
                                                     boolean isBroadcast)
                                              throws MXException,
                                                     java.rmi.RemoteException
        Returns the people in a person group. If isBroadcast is true, returns all people in group. Otherwise returns only the current responsible person. It returns an empty person set if there is no people associated to the group.
        Parameters:
        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.
        Throws:
        MXException
        java.rmi.RemoteException
      • getEmailsOfPersonGroup

        public static java.lang.String[] getEmailsOfPersonGroup(PersonGroupRemote personGroup,
                                                                MboRemote mbo,
                                                                boolean broadcast)
                                                         throws MXException,
                                                                java.rmi.RemoteException
        Method to get emails of a given person group. If broadcast is true, all person's emails in this group are returned. Otherwise, return the first available person's email based on the date.
        Parameters:
        personGroup - The personGroup mbo whose email addresses is returned
        mbo - The mbo on whose behalf we are resolving the PersonGroup.
        broadcast - Boolean to indicate whether to broadcast to the whole group.
        Returns:
        email addresses of the person group
        Throws:
        MXException
        java.rmi.RemoteException
      • getEmailsOfPersonSet

        public static java.lang.String[] getEmailsOfPersonSet(PersonSetRemote personSet)
                                                       throws MXException,
                                                              java.rmi.RemoteException
        Method to get emails of a given set of people.
        Parameters:
        personSet - The set of people whose email addresses to be returned.
        mbo - The mbo on whose behalf we are resolving the PersonGroup.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • getSMSPhonesOfPersonSet

        public static java.util.HashSet getSMSPhonesOfPersonSet(PersonSetRemote personSet)
                                                         throws MXException,
                                                                java.rmi.RemoteException
        Method to get emails of a given set of people.
        Parameters:
        personSet - The set of people whose email addresses to be returned.
        mbo - The mbo on whose behalf we are resolving the PersonGroup.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • getSMSNumOfPerson

        public static java.lang.String getSMSNumOfPerson(MboRemote person)
                                                  throws MXException,
                                                         java.rmi.RemoteException
        Method to get email of a given person
        Parameters:
        person - The person mbo whose email address is returned
        Returns:
        email address of the person
        Throws:
        MXException
        java.rmi.RemoteException
      • csvStringFromArray

        public 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
        Parameters:
        set - HashSet
        Returns:
        csvString string respresenting comma seperated values
        Throws:
        MXException
        java.rmi.RemoteException
      • inClauseFromArray

        public static java.lang.String inClauseFromArray(java.lang.Object[] values)
      • inClauseFromSet

        public static java.lang.String inClauseFromSet(java.util.Set values)
      • calEncodedValue

        public static java.lang.String calEncodedValue(java.lang.String filepathvalue)
      • EncodeDocLink

        public static java.lang.String EncodeDocLink(java.lang.String docpath)
        To encode the doclinks correctly
      • EncodeFilePath

        public static java.lang.String EncodeFilePath(java.lang.String filepathvalue)
      • getDomainValDescription

        public static java.lang.String getDomainValDescription(java.lang.String domainid,
                                                               java.lang.String maxvalue,
                                                               MboRemote tktotal)
                                                        throws MXException,
                                                               java.rmi.RemoteException
        get description of the maxvalue in domain
        Parameters:
        the - name of the domainid
        the - maxvalue
        Throws:
        MXException
        java.rmi.RemoteException
      • arrayToString

        public static java.lang.String arrayToString(java.lang.String[] list)
        Generate a comma seperated string from an array
      • copyDocStoreFile

        public static void copyDocStoreFile(AttachmentStorage docStore,
                                            java.lang.String in,
                                            java.lang.String out)
                                     throws MXException,
                                            java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • copyFile

        public static void copyFile(java.lang.String in,
                                    java.lang.String out)
                             throws MXException
        Throws:
        MXException
      • getWASLoginContext

        public static javax.security.auth.login.LoginContext getWASLoginContext()
                                                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getDeploymentMgrURL

        public static java.lang.String getDeploymentMgrURL()
        Method to return the url of WAS Deployment Manager.
        Returns:
      • getAppServerPorts

        public static java.lang.String getAppServerPorts()
        Method to return the http/https ports of the app server.
        Returns:
      • getWASPorts

        public static java.lang.String getWASPorts()
                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • removeSpaces

        public static java.lang.String removeSpaces(java.lang.String inStr)
        Given a string, removes all its leading, trailing and in-between spaces.
        Parameters:
        inStr -
        Returns:
      • removeNewLines

        public static java.lang.String removeNewLines(java.lang.String inStr)
        Remove new lines "\r\n" from input string.
      • isRepairFacilityEnabled

        public static boolean isRepairFacilityEnabled(MboRemote mbo,
                                                      MXServerRemote mxServer)
                                               throws java.rmi.RemoteException,
                                                      MXException
        Checks if the Repair Facility maxvar is enabled for the org/site where the mbo, received as a parameter, belongs to
        Parameters:
        mbo -
        mxServer - Required argument when this method is called by a databean. If it is null, MXServer.getMXServer() is then called.
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • isRepairFacilityEnabled

        public static boolean isRepairFacilityEnabled(java.lang.String orgSite,
                                                      MXServerRemote mxServer)
                                               throws java.rmi.RemoteException,
                                                      MXException
        Checks if the Repair Facility maxvar is enabled for the org/site received as a parameter
        Parameters:
        orgSite -
        mxServer - Required argument when this method is called by a databean. If it is null, MXServer.getMXServer() is then called.
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • isBypassSiteMismatchWarningEnabled

        public static boolean isBypassSiteMismatchWarningEnabled(MboRemote mbo,
                                                                 MXServerRemote mxServer)
                                                          throws java.rmi.RemoteException,
                                                                 MXException
        Checks if the Bypass Site Mismatch Warning Message maxvar is enabled for the org/site where the mbo, received as a parameter, belongs to
        Parameters:
        mbo -
        mxServer - Required argument when this method is called by a databean. If it is null, MXServer.getMXServer() is then called.
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • isBypassSiteMismatchWarningEnabled

        public static boolean isBypassSiteMismatchWarningEnabled(java.lang.String orgSite,
                                                                 MXServerRemote mxServer)
                                                          throws java.rmi.RemoteException,
                                                                 MXException
        Checks if the Bypass Site Mismatch Warning Message maxvar is enabled for the org/site received as a parameter
        Parameters:
        orgSite -
        mxServer - Required argument when this method is called by a databean. If it is null, MXServer.getMXServer() is then called.
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • convertGregorianDateToIslamicString

        public 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. Then converts to islamic-civil calendar and formats to the display format specified in maximo.
        Parameters:
        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.
        Returns:
        Formatted date String
        Throws:
        java.rmi.RemoteException
        MXException
      • isEmail

        public static boolean isEmail(java.lang.String notfType)
                               throws java.rmi.RemoteException,
                                      MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • isSMS

        public static boolean isSMS(java.lang.String notfType)
                             throws java.rmi.RemoteException,
                                    MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • isMASDeployed

        public static boolean isMASDeployed()
      • useSQLServerSequence

        public static boolean useSQLServerSequence()
        returns true if the license MANAGE is present
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • useSQLServerAdvancedFeatures

        public static boolean useSQLServerAdvancedFeatures()