psdi.app.escalation.engine

Class EscalationCalendar

  • java.lang.Object
    • psdi.app.escalation.engine.EscalationCalendar


  • public class EscalationCalendar
    extends java.lang.Object
    This class handles all calendar related behavior for the Escalation Engine
    • Constructor Detail

      • EscalationCalendar

        public EscalationCalendar()
        Constructor
        Parameters:
        escalationData -
        MboRemote -
    • Method Detail

      • setLogger

        public static void setLogger(MXLogger logger)
      • getLogger

        public static MXLogger getLogger()
      • calculateNewElapsedTime

        public static long calculateNewElapsedTime(java.util.Date now,
                                                   ReferencePointData refPointData)
                                            throws java.rmi.RemoteException,
                                                   MXException
        Calculate a new Elapsed time for spanning days
        Parameters:
        now -
        refPointData -
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • getSLARefPointCondition

        public static java.lang.String getSLARefPointCondition(java.util.Date now,
                                                               ReferencePointData refPointData)
                                                        throws java.rmi.RemoteException,
                                                               MXException
        Calculates and returns the refpoint conditon (1=1 or 1=2)
        Parameters:
        now -
        refPointData -
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • isRefPointEscalationWithinCalendarBoundary

        public static boolean isRefPointEscalationWithinCalendarBoundary(java.util.Date now,
                                                                         ReferencePointData refPointData)
                                                                  throws java.rmi.RemoteException,
                                                                         MXException
        Checks if there is a Calendar/Shift associcated with this Escalation. If there is a Calendar/Shift asscociated it checks if the current date/time falls within the window
        Parameters:
        esclationData -
        now -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • isEscalationWithinCalendarBoundary

        public static boolean isEscalationWithinCalendarBoundary(java.util.Date now,
                                                                 EscalationData escalationData,
                                                                 MboRemote escalationMbo)
                                                          throws java.rmi.RemoteException,
                                                                 MXException
        Checks if there is a Calendar/Shift associcated with this Escalation. If there is a Calendar/Shift asscociated it checks if the current date/time falls within the window
        Parameters:
        esclationData -
        now -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • calculateTimeLeftForTodaysShift

        public static long calculateTimeLeftForTodaysShift(MboRemote workPeriod,
                                                           java.util.Date now)
                                                    throws java.rmi.RemoteException,
                                                           MXException
        For the given Work Period is the current time valid
        Parameters:
        workPeriod -
        now -
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • calculateTimeLeftBeforeTarget

        public static long calculateTimeLeftBeforeTarget(MboRemote workPeriod,
                                                         java.util.Date targetDate)
                                                  throws java.rmi.RemoteException,
                                                         MXException
        Calculate the how much time we have until we hit the target today
        Parameters:
        workPeriod -
        targetDate -
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • isInBoundary

        public static boolean isInBoundary(MboRemote workPeriod,
                                           java.util.Date now)
                                    throws java.rmi.RemoteException,
                                           MXException
        For the given Work Period is the current time valid
        Parameters:
        workPeriod -
        now -
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • getShiftType

        public static int getShiftType(MboRemote workPeriod)
                                throws java.rmi.RemoteException,
                                       MXException
        Returns the shift type i.e. Day or Night
        Parameters:
        workPeriod -
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException