Class Node

    • Constructor Summary

      Constructors 
      Constructor Description
      Node()
      Default Constructor.
      Node​(java.lang.String name, int id)
      Constructor that initialises the nodeid.
      Node​(java.lang.String name, java.util.List<Interface> interfaces, int id)
      Constructor that sets the name and the outages.
      Node​(java.util.List<Interface> interfaces)
      Constructor that sets the outages.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addInterface​(java.lang.String intfname)
      Add Interface with interface name.
      void addInterface​(java.lang.String intfname, java.lang.String service)
      Add an Interface with interface and service name.
      void addInterface​(java.lang.String intfname, java.lang.String service, long lost)
      Add Interface with interface name, service id, lost time.
      void addInterface​(java.lang.String intfname, java.lang.String service, long lost, long regained)
      Adds Interface with interface name, service id, lost time, regained time.
      long getBusDownTime()
      Returns the total outage on the node during business hours.
      long getBusTotalWindow()
      Returns the total window for this node during business hours.
      long getDownTime()
      Returns the total outage on the node.
      Interface getInterface​(java.lang.String intfname)
      Searches the list of interfaces and returns the interface object with name intfname.
      int getInterfaceCount()
      Returns the number of interfaces.
      java.util.List<Interface> getInterfaces()
      Return the interfaces
      int getNodeID()
      Return the nodeid
      long getOutage​(long endTime, long rollingWindow)
      Get the outage for this node.
      double getPercentAvail()
      Returns the percentage availability on the node.
      double getPercentAvail​(long endTime, long rollingWindow)
      Computes the availability of the node.
      double getPercentBusAvail()
      Returns the percentage availability on the node during business hours.
      int getServiceAffectCount()
      Returns the service affected count.
      int getServiceCount()
      Returns the number of unique interface/service combinations.
      long getTotalWindow()
      Returns the total window for this node.
      boolean hasOutages()
      Indicates whether the node has outages.
      java.lang.String toString()
      Returns the string that displays the Node/Interface/Service/Outages combinations.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Node

        public Node()
        Default Constructor.
      • Node

        public Node​(java.lang.String name,
                    int id)
        Constructor that initialises the nodeid.
        Parameters:
        name - a String object.
        id - a int.
      • Node

        public Node​(java.lang.String name,
                    java.util.List<Interface> interfaces,
                    int id)
        Constructor that sets the name and the outages.
        Parameters:
        name - Name of the service.
        interfaces - interfaces to be set for this node.
        id - node id.
      • Node

        public Node​(java.util.List<Interface> interfaces)
        Constructor that sets the outages.
        Parameters:
        interfaces - Interfaces for this node to be set.
    • Method Detail

      • hasOutages

        public boolean hasOutages()
        Indicates whether the node has outages.
        Returns:
        True if has outages.
      • getDownTime

        public long getDownTime()
        Returns the total outage on the node.
        Returns:
        The down time.
      • getBusDownTime

        public long getBusDownTime()
        Returns the total outage on the node during business hours.
        Returns:
        The business hours down time.
      • getPercentAvail

        public double getPercentAvail()
        Returns the percentage availability on the node.
        Returns:
        The percentage availability
      • getPercentBusAvail

        public double getPercentBusAvail()
        Returns the percentage availability on the node during business hours.
        Returns:
        The percentage availability during business hours.
      • getServiceCount

        public int getServiceCount()
        Returns the number of unique interface/service combinations.
        Returns:
        The service count
      • getInterfaceCount

        public int getInterfaceCount()
        Returns the number of interfaces.
        Returns:
        The interface count
      • getBusTotalWindow

        public long getBusTotalWindow()
        Returns the total window for this node during business hours.
        Returns:
        The totals for the business hours window.
      • getTotalWindow

        public long getTotalWindow()
        Returns the total window for this node.
        Returns:
        The totals
      • getInterfaces

        public java.util.List<Interface> getInterfaces()
        Return the interfaces
        Returns:
        A list of interfaces.
      • getNodeID

        public int getNodeID()
        Return the nodeid
        Returns:
        This node's id.
      • getServiceAffectCount

        public int getServiceAffectCount()
        Returns the service affected count.
        Returns:
        The number of affected services.
      • addInterface

        public void addInterface​(java.lang.String intfname)
        Add Interface with interface name.
        Parameters:
        intfname - interface name Checks if the interface with name intfname exists. If not, adds a new interface with name intfname.
      • addInterface

        public void addInterface​(java.lang.String intfname,
                                 java.lang.String service)
        Add an Interface with interface and service name.
        Parameters:
        intfname - interface name
        service - service name Checks if the interface with name intfname exists. If so, adds service to that interface. Otherwise, adds a new interface with name intfname and service.
      • addInterface

        public void addInterface​(java.lang.String intfname,
                                 java.lang.String service,
                                 long lost)
        Add Interface with interface name, service id, lost time.
        Parameters:
        intfname - Interface name
        service - Service name
        lost - Lost time Checks if the interface with name intfname exists. If so, adds service to that interface. Otherwise, adds a new interface with name intfname and service, and adds an outage with losttime as lost.
      • getInterface

        public Interface getInterface​(java.lang.String intfname)
        Searches the list of interfaces and returns the interface object with name intfname.
        Parameters:
        intfname - a String object.
        Returns:
        Interface with name intfname
      • addInterface

        public void addInterface​(java.lang.String intfname,
                                 java.lang.String service,
                                 long lost,
                                 long regained)
        Adds Interface with interface name, service id, lost time, regained time.
        Parameters:
        intfname - Interface name
        service - Service name
        lost - Lost time
        regained - Regained time. Checks if the interface with name intfname exists. If so, adds service to that interface. Otherwise, adds a new interface with name intfname and service, and adds an outage with losttime as lost and regained time as regained.
      • getPercentAvail

        public double getPercentAvail​(long endTime,
                                      long rollingWindow)
        Computes the availability of the node. The rolling window (in milliseconds)
        Parameters:
        endTime - End Time of the rolling window in milliseconds.
        rollingWindow - a long.
        Returns:
        percentage availability of node for the last week.
      • getOutage

        public long getOutage​(long endTime,
                              long rollingWindow)
        Get the outage for this node.
        Parameters:
        endTime - a long.
        rollingWindow - a long.
        Returns:
        The outage time.
      • toString

        public java.lang.String toString()
        Returns the string that displays the Node/Interface/Service/Outages combinations.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string representation.