Class MockEventUtil


  • public abstract class MockEventUtil
    extends java.lang.Object

    Abstract MockEventUtil class.

    Version:
    $Id: $
    Author:
    brozow TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates
    • Constructor Detail

      • MockEventUtil

        public MockEventUtil()
    • Method Detail

      • createNodeLostServiceEvent

        public static Event createNodeLostServiceEvent​(java.lang.String source,
                                                       MockService svc,
                                                       java.lang.String reason)

        createNodeLostServiceEvent

        Parameters:
        source - a String object.
        svc - a MockService object.
        reason - a String object.
        Returns:
        a Event object.
      • createOutageCreatedEvent

        public static Event createOutageCreatedEvent​(java.lang.String source,
                                                     MockService svc,
                                                     java.lang.String reason)
      • createOutageResolvedEvent

        public static Event createOutageResolvedEvent​(java.lang.String source,
                                                      MockService svc,
                                                      java.lang.String reason)
      • createNodeLostServiceEvent

        public static Event createNodeLostServiceEvent​(java.lang.String source,
                                                       MockService svc)

        createNodeLostServiceEvent

        Parameters:
        source - a String object.
        svc - a MockService object.
        Returns:
        a Event object.
      • createNodeRegainedServiceEvent

        public static Event createNodeRegainedServiceEvent​(java.lang.String source,
                                                           MockService svc)

        createNodeRegainedServiceEvent

        Parameters:
        source - a String object.
        svc - a MockService object.
        Returns:
        a Event object.
      • createServiceUnresponsiveEvent

        public static Event createServiceUnresponsiveEvent​(java.lang.String source,
                                                           MockService svc,
                                                           java.lang.String reason)

        createServiceUnresponsiveEvent

        Parameters:
        source - a String object.
        svc - a MockService object.
        reason - a String object.
        Returns:
        a Event object.
      • createServiceUnresponsiveEventBuilder

        public static EventBuilder createServiceUnresponsiveEventBuilder​(java.lang.String source,
                                                                         MockService svc,
                                                                         java.lang.String reason)

        createServiceUnresponsiveEventBuilder

        Parameters:
        source - a String object.
        svc - a MockService object.
        reason - a String object.
        Returns:
        a EventBuilder object.
      • createServiceResponsiveEvent

        public static Event createServiceResponsiveEvent​(java.lang.String source,
                                                         MockService svc)

        createServiceResponsiveEvent

        Parameters:
        source - a String object.
        svc - a MockService object.
        Returns:
        a Event object.
      • createNodeGainedServiceEvent

        public static Event createNodeGainedServiceEvent​(java.lang.String source,
                                                         MockService svc)

        createNodeGainedServiceEvent

        Parameters:
        source - a String object.
        svc - a MockService object.
        Returns:
        a Event object.
      • createServiceDeletedEvent

        public static Event createServiceDeletedEvent​(java.lang.String source,
                                                      MockService svc)

        createServiceDeletedEvent

        Parameters:
        source - a String object.
        svc - a MockService object.
        Returns:
        a Event object.
      • createSuspendPollingServiceEvent

        public static Event createSuspendPollingServiceEvent​(java.lang.String source,
                                                             MockService svc)

        createSuspendPollingServiceEvent

        Parameters:
        source - a String object.
        svc - a MockService object.
        Returns:
        a Event object.
      • createResumePollingServiceEvent

        public static Event createResumePollingServiceEvent​(java.lang.String source,
                                                            MockService svc)

        createResumePollingServiceEvent

        Parameters:
        source - a String object.
        svc - a MockService object.
        Returns:
        a Event object.
      • createServiceEvent

        public static Event createServiceEvent​(java.lang.String source,
                                               java.lang.String uei,
                                               MockService svc,
                                               java.lang.String reason)

        createServiceEvent

        Parameters:
        source - a String object.
        uei - a String object.
        svc - a MockService object.
        reason - a String object.
        Returns:
        a Event object.
      • createServiceEventBuilder

        public static EventBuilder createServiceEventBuilder​(java.lang.String source,
                                                             java.lang.String uei,
                                                             MockService svc,
                                                             java.lang.String reason)

        createServiceEventBuilder

        Parameters:
        source - a String object.
        uei - a String object.
        svc - a MockService object.
        reason - a String object.
        Returns:
        a EventBuilder object.
      • createInterfaceDownEvent

        public static Event createInterfaceDownEvent​(java.lang.String source,
                                                     MockInterface iface)

        createInterfaceDownEvent

        Parameters:
        source - a String object.
        iface - a MockInterface object.
        Returns:
        a Event object.
      • createInterfaceUpEvent

        public static Event createInterfaceUpEvent​(java.lang.String source,
                                                   MockInterface iface)

        createInterfaceUpEvent

        Parameters:
        source - a String object.
        iface - a MockInterface object.
        Returns:
        a Event object.
      • createNodeGainedInterfaceEvent

        public static Event createNodeGainedInterfaceEvent​(java.lang.String source,
                                                           MockInterface iface)

        createNodeGainedInterfaceEvent

        Parameters:
        source - a String object.
        iface - a MockInterface object.
        Returns:
        a Event object.
      • createInterfaceDeletedEvent

        public static Event createInterfaceDeletedEvent​(java.lang.String source,
                                                        MockInterface iface)

        createInterfaceDeletedEvent

        Parameters:
        source - a String object.
        iface - a MockInterface object.
        Returns:
        a Event object.
      • createInterfaceEvent

        public static Event createInterfaceEvent​(java.lang.String source,
                                                 java.lang.String uei,
                                                 MockInterface iface)

        createInterfaceEvent

        Parameters:
        source - a String object.
        uei - a String object.
        iface - a MockInterface object.
        Returns:
        a Event object.
      • createInterfaceEventBuilder

        public static EventBuilder createInterfaceEventBuilder​(java.lang.String source,
                                                               java.lang.String uei,
                                                               MockInterface iface)

        createInterfaceEventBuilder

        Parameters:
        source - a String object.
        uei - a String object.
        iface - a MockInterface object.
        Returns:
        a EventBuilder object.
      • createNodeDownEvent

        public static Event createNodeDownEvent​(java.lang.String source,
                                                MockNode node)

        createNodeDownEvent

        Parameters:
        source - a String object.
        node - a MockNode object.
        Returns:
        a Event object.
      • createNodeDownEventBuilder

        public static EventBuilder createNodeDownEventBuilder​(java.lang.String source,
                                                              MockNode node)

        createNodeDownEventBuilder

        Parameters:
        source - a String object.
        node - a MockNode object.
        Returns:
        a EventBuilder object.
      • createNodeDownEventBuilder

        public static EventBuilder createNodeDownEventBuilder​(java.lang.String source,
                                                              OnmsNode node)

        createNodeDownEventBuilder

        Parameters:
        source - a String object.
        node - a MockNode object.
        Returns:
        a EventBuilder object.
      • createNodeDownEventWithReason

        public static Event createNodeDownEventWithReason​(java.lang.String source,
                                                          MockNode node,
                                                          java.lang.String reason)

        createNodeDownEventWithReason

        Parameters:
        source - a String object.
        node - a MockNode object.
        reason - a String object.
        Returns:
        a Event object.
      • createNodeUpEventBuilder

        public static EventBuilder createNodeUpEventBuilder​(java.lang.String source,
                                                            OnmsNode node)
      • createNodeUpEventBuilder

        public static EventBuilder createNodeUpEventBuilder​(java.lang.String source,
                                                            MockNode node)

        createNodeUpEventBuilder

        Parameters:
        source - a String object.
        node - a MockNode object.
        Returns:
        a EventBuilder object.
      • createNodeUpEvent

        public static Event createNodeUpEvent​(java.lang.String source,
                                              MockNode node)

        createNodeUpEvent

        Parameters:
        source - a String object.
        node - a MockNode object.
        Returns:
        a Event object.
      • createNodeAddedEvent

        public static Event createNodeAddedEvent​(java.lang.String source,
                                                 MockNode node)

        createNodeAddedEvent

        Parameters:
        source - a String object.
        node - a MockNode object.
        Returns:
        a Event object.
      • createNodeDeletedEvent

        public static Event createNodeDeletedEvent​(java.lang.String source,
                                                   MockNode node)

        createNodeDeletedEvent

        Parameters:
        source - a String object.
        node - a MockNode object.
        Returns:
        a Event object.
      • createNodeEvent

        public static Event createNodeEvent​(java.lang.String source,
                                            java.lang.String uei,
                                            MockNode node)

        createNodeEvent

        Parameters:
        source - a String object.
        uei - a String object.
        node - a MockNode object.
        Returns:
        a Event object.
      • createNodeEventBuilder

        public static EventBuilder createNodeEventBuilder​(java.lang.String source,
                                                          java.lang.String uei,
                                                          MockNode node)

        createNodeEventBuilder

        Parameters:
        source - a String object.
        uei - a String object.
        node - a MockNode object.
        Returns:
        a EventBuilder object.
      • createNodeEventBuilder

        public static EventBuilder createNodeEventBuilder​(java.lang.String source,
                                                          java.lang.String uei,
                                                          OnmsNode node)

        createNodeEventBuilder

        Parameters:
        source - a String object.
        uei - a String object.
        node - a MockNode object.
        Returns:
        a EventBuilder object.
      • createNodeEventWithReason

        public static Event createNodeEventWithReason​(java.lang.String source,
                                                      java.lang.String uei,
                                                      MockNode node,
                                                      java.lang.String reason)

        createNodeEventWithReason

        Parameters:
        source - a String object.
        uei - a String object.
        node - a MockNode object.
        reason - a String object.
        Returns:
        a Event object.
      • createNewSuspectEventBuilder

        public static EventBuilder createNewSuspectEventBuilder​(java.lang.String source,
                                                                java.lang.String uei,
                                                                java.lang.String ipAddr)

        createNewSuspectEventBuilder

        Parameters:
        source - a String object.
        uei - a String object.
        ipAddr - a String object.
        Returns:
        a EventBuilder object.
      • createBgpBkTnEvent

        public static Event createBgpBkTnEvent​(java.lang.String source,
                                               MockNode node,
                                               java.lang.String ipAddr,
                                               int peerState)

        createBgpBkTnEvent

        Parameters:
        source - a String object.
        node - a MockNode object.
        ipAddr - a String object.
        peerState - a int.
        Returns:
        a Event object.
      • setEventTime

        public static void setEventTime​(Event event,
                                        java.util.Date date)

        setEventTime

        Parameters:
        event - a Event object.
        date - a Date object.
      • createEvent

        public static Event createEvent​(java.lang.String source,
                                        java.lang.String uei,
                                        int nodeId,
                                        java.lang.String ipAddr,
                                        java.lang.String svcName,
                                        java.lang.String reason)

        createEvent

        Parameters:
        source - a String object.
        uei - a String object.
        nodeId - a int.
        ipAddr - a String object.
        svcName - a String object.
        reason - a String object.
        Returns:
        a Event object.
      • createEventBuilder

        public static EventBuilder createEventBuilder​(java.lang.String source,
                                                      java.lang.String uei,
                                                      int nodeId,
                                                      java.lang.String ipAddr,
                                                      java.lang.String svcName,
                                                      java.lang.String reason)

        createEventBuilder

        Parameters:
        source - a String object.
        uei - a String object.
        nodeId - a int.
        ipAddr - a String object.
        svcName - a String object.
        reason - a String object.
        Returns:
        a EventBuilder object.
      • createEventBuilder

        public static EventBuilder createEventBuilder​(java.lang.String source,
                                                      java.lang.String uei)

        createEventBuilder

        Parameters:
        source - a String object.
        uei - a String object.
        Returns:
        a EventBuilder object.
      • createReparentEvent

        public static Event createReparentEvent​(java.lang.String source,
                                                java.lang.String ipAddr,
                                                int oldNode,
                                                int newNode)

        createReparentEvent

        Parameters:
        source - a String object.
        ipAddr - a String object.
        oldNode - a int.
        newNode - a int.
        Returns:
        a Event object.
      • eventsMatchDeep

        public static boolean eventsMatchDeep​(Event e1,
                                              Event e2)

        eventsMatchDeep

        Parameters:
        e1 - a Event object.
        e2 - a Event object.
        Returns:
        a boolean.
      • eventsMatchDeep

        public static boolean eventsMatchDeep​(Event e1,
                                              Event e2,
                                              long toleratedTimestampOffset)

        eventsMatchDeep

        Parameters:
        e1 - a Event object.
        e2 - a Event object.
        Returns:
        a boolean.
      • printEvent

        public static void printEvent​(java.lang.String prefix,
                                      Event event)

        printEvent

        Parameters:
        prefix - a String object.
        event - a Event object.
      • printEvents

        public static void printEvents​(java.lang.String prefix,
                                       java.util.Collection<Event> events)

        printEvents

        Parameters:
        prefix - a String object.
        events - a Collection object.