psdi.app.sla

Class SLAUtil

  • java.lang.Object
    • psdi.app.sla.SLAUtil


  • public class SLAUtil
    extends java.lang.Object
    The utility methods that are shared among the SLA classes
    • Constructor Detail

      • SLAUtil

        public SLAUtil()
    • Method Detail

      • getUniqueKeyFieldName

        public static java.lang.String getUniqueKeyFieldName(Mbo mbo)
        Returns the unique key field name for the given mbo
      • getUniqueKeyFieldName

        public static java.lang.String getUniqueKeyFieldName(MboSetInfo mboSetInfo)
        Returns the unique key field name given the mbo set info.
      • getSuperType

        public static java.lang.String getSuperType(Mbo mbo)
        Get the super type of a mbo
      • singleSLA

        public static boolean singleSLA(Mbo mbo)
                                 throws MXException,
                                        java.rmi.RemoteException
        Read maxvars to decide if singlesla is to apply
        Throws:
        MXException
        java.rmi.RemoteException
      • useRanking

        public static boolean useRanking(Mbo mbo)
                                  throws MXException,
                                         java.rmi.RemoteException
        Read maxvars to decide if useranking is to apply
        Throws:
        MXException
        java.rmi.RemoteException
      • buildExcludingWhere

        public static java.lang.String buildExcludingWhere(java.lang.String keyField,
                                                           java.lang.String checkField,
                                                           MboSetRemote set)
                                                    throws MXException,
                                                           java.rmi.RemoteException
        Build a where clause the exclude the mbos that are already in the mboset
        Throws:
        MXException
        java.rmi.RemoteException
      • mboEq

        public static boolean mboEq(MboRemote mbo1,
                                    MboRemote mbo2)
                             throws MXException,
                                    java.rmi.RemoteException
        Helper function that test if 2 mbo objects are equal to each other By equal it means they of of the same object type and key values are the same.
        Throws:
        MXException
        java.rmi.RemoteException
      • isNull

        public static boolean isNull(java.lang.String str)
        Is a string null or empty
      • getContractStatusToExclude

        public static java.lang.String getContractStatusToExclude(Mbo mbo)
                                                           throws MXException
        This returns a list of contract status that are synonym to CAN or CLOSE. These are the staus to be excluded when associating contracts to an SLA.
        Throws:
        MXException
      • getContractStatusToInclude

        public static java.lang.String getContractStatusToInclude(Mbo mbo)
                                                           throws MXException
        This returns a list of contract status that are synonym to APPR. These are the staus to be included when associating contracts to an SLA.
        Throws:
        MXException
      • throwValidationException

        public static void throwValidationException(MboValue mboValue)
                                             throws MXException
        Throws the generic validation exception
        Parameters:
        mboValue -
        Throws:
        MXException
      • getInPhrase

        public static java.lang.String getInPhrase(java.lang.String fieldName,
                                                   java.lang.String in)
        Create the SQL in phrase in the where clause.
        Parameters:
        fieldName -
        in -
        Returns:
      • compareCommitment

        public static int compareCommitment(MboRemote commitment1,
                                            MboRemote commitment2,
                                            Translate translate)
                                     throws MXException,
                                            java.rmi.RemoteException
        compare 2 commitment based on their stringent, returns:
        1: if commitment1 is more stringent than commitment2
        -1: if commitment1 is less stringent than commitment2
        0: if the 2 commitments are of the same stringenncy

        This version only support response, resolution and contact types so only time compare is performed.
        Throws:
        MXException
        java.rmi.RemoteException
      • getTargetFieldName

        public static java.lang.String getTargetFieldName(java.lang.String targetMboType,
                                                          MboRemote commitment,
                                                          Translate translate)
                                                   throws java.rmi.RemoteException,
                                                          MXException
        Helper function to get the target field name for a commitmment
        Parameters:
        targetMboType -
        commitment -
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • getSLARecordsTargetFieldName

        public static java.lang.String getSLARecordsTargetFieldName(MboRemote commitment,
                                                                    Translate translate)
                                                             throws java.rmi.RemoteException,
                                                                    MXException
        Helper method to get the SLARECORDS target field name for a commitmment
        Parameters:
        targetMboType -
        commitment -
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException