Class Interface

    • Constructor Summary

      Constructors 
      Constructor Description
      Interface()
      Default Constructor.
      Interface​(java.lang.String name)
      Constructor that sets the name.
      Interface​(java.lang.String name, java.lang.String service)
      Constructor that sets the name and adds service.
      Interface​(java.lang.String name, java.lang.String service, long losttime)
      Constructor that sets the name to interface and adds service and outage with lost time.
      Interface​(java.lang.String name, java.lang.String service, long losttime, long regainedtime)
      Constructor that sets the name to interface and adds service and outage with lost time and regained time.
      Interface​(java.lang.String name, java.util.List<Service> services)
      Constructor that sets the name of interface and sets the services.
      Interface​(java.util.List<Service> services)
      Constructor that sets the services.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addService​(java.lang.String service)
      Adds a new service to this interface
      void addService​(java.lang.String service, long losttime)
      Adds a new service to this interface.
      void addService​(java.lang.String service, long losttime, long regainedtime)
      Adds a service to this interface with outage having lost time and regained time.
      void addService​(Service service)
      Adds a new service object to this interface
      boolean equals​(java.lang.Object obj)
      long getDownTime​(long currentTime, long rollingWindow)
      Returns the down time for this interface.
      Service getService​(java.lang.String svcname)
      Return the Service object given the service name
      int getServiceAffectCount()
      Returns the number of services affected.
      int getServiceCount()
      Returns the number of services that this node/interface has.
      java.util.List<Service> getServices()
      Return the services
      • Methods inherited from class java.lang.Object

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

      • Interface

        public Interface()
        Default Constructor.
      • Interface

        public Interface​(java.lang.String name,
                         java.util.List<Service> services)
        Constructor that sets the name of interface and sets the services.
        Parameters:
        name - Name of the interface.
        services - Services to be set for this interface.
      • Interface

        public Interface​(java.lang.String name,
                         java.lang.String service)
        Constructor that sets the name and adds service. If there is already an interface with name, this method adds a service to this found service. Otherwise adds a new interface with service.
        Parameters:
        name - Name of the interface.
        service - Name of the service to be added
      • Interface

        public Interface​(java.lang.String name,
                         java.lang.String service,
                         long losttime)
        Constructor that sets the name to interface and adds service and outage with lost time. If there is already an interface with name, adds a service depending upon whether it exists or not. Otherwise adds a new interface with service.
        Parameters:
        name - Name of the interface.
        service - Name of the service to be added
        losttime - Lost time
      • Interface

        public Interface​(java.lang.String name,
                         java.lang.String service,
                         long losttime,
                         long regainedtime)
        Constructor that sets the name to interface and adds service and outage with lost time and regained time. If there is already an interface with name, adds a service depending upon whether it exists or not. Otherwise adds a new interface with service.
        Parameters:
        name - Name of the interface.
        service - Name of the service to be added
        losttime - Lost time
        regainedtime - Regained Time
      • Interface

        public Interface​(java.lang.String name)
        Constructor that sets the name.
        Parameters:
        name - Name of the interface.
      • Interface

        public Interface​(java.util.List<Service> services)
        Constructor that sets the services.
        Parameters:
        services - Services for this interface to be set.
    • Method Detail

      • getServices

        public java.util.List<Service> getServices()
        Return the services
        Returns:
        Services to be set.
      • getService

        public Service getService​(java.lang.String svcname)
        Return the Service object given the service name
        Parameters:
        svcname - The service name to lookup.
        Returns:
        Service with matching service name.
      • addService

        public void addService​(Service service)
        Adds a new service object to this interface
        Parameters:
        service - The service to be add.
      • addService

        public void addService​(java.lang.String service)
        Adds a new service to this interface
        Parameters:
        service - The name of the service to add.
      • addService

        public void addService​(java.lang.String service,
                               long losttime)
        Adds a new service to this interface.
        Parameters:
        service - Service name to be added
        losttime - Outage with lost time to be added to service
      • addService

        public void addService​(java.lang.String service,
                               long losttime,
                               long regainedtime)
        Adds a service to this interface with outage having lost time and regained time.
        Parameters:
        service - Service name
        losttime - Lost time
        regainedtime - Regained Time
      • getDownTime

        public long getDownTime​(long currentTime,
                                long rollingWindow)
        Returns the down time for this interface.
        Parameters:
        currentTime - End of rolling window
        rollingWindow - Rolling Window
        Returns:
        the down time for this interface.
      • getServiceCount

        public int getServiceCount()
        Returns the number of services that this node/interface has.
        Returns:
        a int.
      • getServiceAffectCount

        public int getServiceAffectCount()
        Returns the number of services affected.
        Returns:
        a int.
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object