public class Node extends StandardNamedObject
| Constructor and Description | 
|---|
Node()
Default Constructor. 
 | 
Node(List<Interface> interfaces)
Constructor that sets the outages. 
 | 
Node(String name,
    int id)
Constructor that initialises the nodeid. 
 | 
Node(String name,
    List<Interface> interfaces,
    int id)
Constructor that sets the name and the outages. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addInterface(String intfname)
Add Interface with interface name. 
 | 
void | 
addInterface(String intfname,
            String service)
Add an Interface with interface and service name. 
 | 
void | 
addInterface(String intfname,
            String service,
            long lost)
Add Interface with interface name, service id, lost time. 
 | 
void | 
addInterface(String intfname,
            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(String intfname)
Searches the list of interfaces and returns the interface object with
 name intfname. 
 | 
int | 
getInterfaceCount()
Returns the number of interfaces. 
 | 
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. 
 | 
String | 
toString()
Returns the string that displays the Node/Interface/Service/Outages
 combinations. 
 | 
getName, setNamepublic Node()
public Node(String name, int id)
name - a String object.id - a int.public Node(String name, List<Interface> interfaces, int id)
name - Name of the service.interfaces - interfaces to be set for this node.id - node id.public boolean hasOutages()
public long getDownTime()
public long getBusDownTime()
public double getPercentAvail()
public double getPercentBusAvail()
public int getServiceCount()
public int getInterfaceCount()
public long getBusTotalWindow()
public long getTotalWindow()
public List<Interface> getInterfaces()
public int getNodeID()
public int getServiceAffectCount()
public void addInterface(String intfname)
intfname - interface name Checks if the interface with name intfname
            exists. If not, adds a new interface with name intfname.public void addInterface(String intfname, String service)
intfname - interface nameservice - 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.public void addInterface(String intfname, String service, long lost)
intfname - Interface nameservice - Service namelost - 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.public Interface getInterface(String intfname)
intfname - a String object.public void addInterface(String intfname, String service, long lost, long regained)
intfname - Interface nameservice - Service namelost - Lost timeregained - 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.public double getPercentAvail(long endTime,
                              long rollingWindow)
endTime - End Time of the rolling window in milliseconds.rollingWindow - a long.public long getOutage(long endTime,
                      long rollingWindow)
endTime - a long.rollingWindow - a long.Copyright © 2021. All rights reserved.