@Override public Bandwidth clone() { return new Bandwidth(this.bandwidthValue); }
private String bandwidthColor(Bandwidth bandwidth) { String color = null; long bandwidthValue = bandwidth.getValue(); if (bandwidthValue == 0) { color = "#000"; } else if (bandwidthValue < Bandwidth.BW1Kbps) { color = "#148AC6"; } else if (bandwidthValue < Bandwidth.BW1Mbps) { color = "#2858A0"; } else if (bandwidthValue < Bandwidth.BW1Gbps) { color = "#009393"; } else if (bandwidthValue < Bandwidth.BW1Tbps) { color = "#C6C014"; } else if (bandwidthValue < Bandwidth.BW1Pbps) { color = "#F9F464"; } return color; } }
@Override public String toString() { StringBuffer sb = new StringBuffer(); sb.append("PeerBandWidth["); sb.append(super.toString()); sb.append("]"); return sb.toString(); } }
@Override public String toString() { return "BandWidth[" + getStringValue() + "]"; }
public EdgeBean(NodeConnector connector, Long hostId) { this(); this.source = null; this.destination = connector; this.hostId = hostId; data.put("$bandwidth", "N/A"); data.put("$color", bandwidthColor(new Bandwidth(0))); data.put("$nodeToPort", connector.getNodeConnectorIDString()); data.put("$nodeFromPort", connector.getNodeConnectorIDString()); data.put("$descTo", ""); data.put("$descFrom", ""); data.put("$nodeToPortName", ""); data.put("$nodeFromPortName", ""); }
public static SupportedBandwidth toAdSupportedBandwidth(final PortFeatures pf) { SupportedBandwidth sbw = null; final Bandwidth bw = toAdBandwidth(pf); if (bw != null) { sbw = new SupportedBandwidth(bw.getValue()); } return sbw; }
@Override public String toString() { StringBuffer sb = new StringBuffer(); sb.append("AdvertisedBandWidth["); sb.append(super.toString()); sb.append("]"); return sb.toString(); }
public static Bandwidth toAdBandwidth(final PortFeatures pf) { Bandwidth bw = null; if (pf.isTenMbHd() || pf.isTenMbFd()) { bw = new Bandwidth(Bandwidth.BW10Mbps); } else if (pf.isHundredMbHd() || pf.isHundredMbFd()) { bw = new Bandwidth(Bandwidth.BW100Mbps); } else if (pf.isOneGbHd() || pf.isOneGbFd()) { bw = new Bandwidth(Bandwidth.BW1Gbps); } else if (pf.isOneGbFd()) { bw = new Bandwidth(Bandwidth.BW10Gbps); } else if (pf.isTenGbFd()) { bw = new Bandwidth(Bandwidth.BW10Gbps); } else if (pf.isFortyGbFd()) { bw = new Bandwidth(Bandwidth.BW40Gbps); } else if (pf.isHundredGbFd()) { bw = new Bandwidth(Bandwidth.BW100Gbps); } else if (pf.isOneTbFd()) { bw = new Bandwidth(Bandwidth.BW1Tbps); } return bw; }
public static PeerBandwidth toAdPeerBandwidth(final PortFeatures pf) { PeerBandwidth pbw = null; final Bandwidth bw = toAdBandwidth(pf); if (bw != null) { pbw = new PeerBandwidth(bw.getValue()); } return pbw; }
@Override public String toString() { StringBuffer sb = new StringBuffer(); sb.append("SupportedBandWidth["); sb.append(super.toString()); sb.append("]"); return sb.toString(); }
} else if (propName.equalsIgnoreCase(Bandwidth.BandwidthPropName)) { long bw = Long.parseLong(propValue); return new Bandwidth(bw); } else if (propName.equalsIgnoreCase(ForwardingMode.name)) { int mode = Integer.parseInt(propValue);
public static AdvertisedBandwidth toAdAdvertizedBandwidth(final PortFeatures pf) { AdvertisedBandwidth abw = null; final Bandwidth bw = toAdBandwidth(pf); if (bw != null) { abw = new AdvertisedBandwidth(bw.getValue()); } return abw; }
/** * EdgeBean object that includes complete node description * * @param link * @param bandwidth * @param headDescription * @param tailDescription */ public EdgeBean(Edge link, Bandwidth bandwidth, String headDescription, String tailDescription, String headPortDescription, String tailPortDescription) { this(); this.source = link.getHeadNodeConnector(); this.destination = link.getTailNodeConnector(); // data data.put("$bandwidth", bandwidth.toString()); data.put("$color", bandwidthColor(bandwidth)); data.put("$nodeToPort", destination.getID().toString()); data.put("$nodeFromPort", source.getID().toString()); data.put("$descFrom", headDescription); data.put("$descTo", tailDescription); data.put("$nodeFromPortName", source.toString()); data.put("$nodeToPortName", destination.toString()); data.put("$nodeFromPortDescription", headPortDescription); data.put("$nodeToPortDescription", tailPortDescription); }
if ((bwSrc == null) || ((srcLinkSpeed = bwSrc.getValue()) == 0)) { log.debug("srcNC: {} - Setting srcLinkSpeed to Default!", srcNC); srcLinkSpeed = DEFAULT_LINK_SPEED; if ((bwDst == null) || ((dstLinkSpeed = bwDst.getValue()) == 0)) { log.debug("dstNC: {} - Setting dstLinkSpeed to Default!", dstNC); dstLinkSpeed = DEFAULT_LINK_SPEED;
for (Property prop : props) { if (prop.getName().equals(Bandwidth.BandwidthPropName)) { bw = ((Bandwidth) prop).getValue();
CapabilitiesType.FLOW_STATS_CAPABILITY.getValue()); ncPropMap.put(Capabilities.CapabilitiesPropName, cap); Bandwidth bw = new Bandwidth(Bandwidth.BW1Gbps); ncPropMap.put(Bandwidth.BandwidthPropName, bw); State st = new State(State.EDGE_UP);
for (Property prop : propSet) { if (prop instanceof Bandwidth) { bw = ((Bandwidth) prop).getValue(); break;