@JsonProperty(value="properties") public Map<String, Property> getMapProperties() { Map<String, Property> map = new HashMap<String, Property>(); for (Property p : properties) { map.put(p.getName(), p); } return map; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; Bandwidth other = (Bandwidth) obj; if (bandwidthValue != other.bandwidthValue) return false; return true; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (latencyValue ^ (latencyValue >>> 32)); return result; }
private void updateNode(Node node, Set<Property> properties) { logger.trace("{} updated, props: {}", node, properties); if ((nodeProps == null) || !nodeProps.containsKey(node) || (properties == null) || properties.isEmpty()) { return; } // Update local cache with new properties Set<Property> newProperties = new HashSet<Property>(properties.size()); Map<String, Property> propertyMap = nodeProps.get(node); for (Property property : properties) { String name = property.getName(); Property currentProperty = propertyMap.get(name); if (!property.equals(currentProperty)) { propertyMap.put(name, property); newProperties.add(property); } } // Update SAL if we got new properties if (!newProperties.isEmpty()) { for (IPluginOutInventoryService service : pluginOutInventoryServices) { service.updateNode(node, UpdateType.CHANGED, newProperties); } } }
for (String s : sortedProps) { if (propList.containsKey(s)) { nodeProp = nodeProp.concat(String.format("%-18s ", propList.get(s).getStringValue())); } else { nodeProp = nodeProp.concat(String.format("%-18s ", "null"));
private void updateNode(Node node, Set<Property> properties) { logger.trace("{} updated, props: {}", node, properties); if (nodeProps == null || !nodeProps.containsKey(node) || properties == null || properties.isEmpty()) { return; } // Update local cache with new properties Set<Property> newProperties = new HashSet<Property>(properties.size()); Map<String, Property> propertyMap = nodeProps.get(node); for (Property property : properties) { String name = property.getName(); Property currentProperty = propertyMap.get(name); if (!property.equals(currentProperty)) { propertyMap.put(name, property); newProperties.add(property); } } // Update SAL if we got new properties if (!newProperties.isEmpty()) { synchronized (pluginOutInventoryServices) { for (IPluginOutInventoryService service : pluginOutInventoryServices) { logger.debug("updateNode(): report node update to SAL"); logger.debug("updateNode(): node: {}", node); logger.debug("updateNode(): properties: {}", properties); service.updateNode(node, UpdateType.CHANGED, newProperties); } } } }
for (String s : sortedProps) { if (ncProperties.containsKey(s)) { ncProp = ncProp.concat(String.format("%-18s ", ncProperties.get(s).getStringValue())); } else { ncProp = ncProp.concat(String.format("%-18s ", "null"));
@JsonProperty(value="properties") public Map<String, Property> getMapProperties() { Map<String, Property> map = new HashMap<String, Property>(); for (Property p : properties) { map.put(p.getName(), p); } return map; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; Tier other = (Tier) obj; if (tierValue != other.tierValue) return false; return true; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + configValue; return result; }
@JsonProperty(value="properties") public Map<String, Property> getMapProperties() { Map<String, Property> map = new HashMap<String, Property>(); for (Property p : properties) { map.put(p.getName(), p); } return map; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; Latency other = (Latency) obj; if (latencyValue != other.latencyValue) return false; return true; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + tierValue; return result; }
@JsonProperty(value="properties") public Map<String, Property> getMapProperties() { Map<String, Property> map = new HashMap<String, Property>(); for (Property p : properties) { map.put(p.getName(), p); } return map; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; ForwardingMode other = (ForwardingMode) obj; if (modeValue != other.modeValue) return false; return true; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (int) (bandwidthValue ^ (bandwidthValue >>> 32)); return result; }
@Deprecated public SwitchConfig(String nodeId, String description, String tier, String mode) { this.nodeId = nodeId; this.nodeProperties = new HashMap<String, Property>(); Property desc = new Description(description); this.nodeProperties.put(desc.getName(), desc); Property nodeTier = new Tier(Integer.valueOf(tier)); this.nodeProperties.put(nodeTier.getName(), nodeTier); Property forwardingMode = new ForwardingMode(Integer.valueOf(mode)); this.nodeProperties.put(forwardingMode.getName(), forwardingMode); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; Buffers other = (Buffers) obj; if (buffersValue != other.buffersValue) return false; return true; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + capabilitiesValue; return result; }
@Override public void setNodeProp(Node node, Property prop) { for (int i = 0; i <= REPLACE_RETRY; i++) { /* Get a copy of the property map */ Map<String, Property> propMapCurr = getNodeProps(node); if (propMapCurr == null) { return; } Map<String, Property> propMap = new HashMap<String, Property>(propMapCurr); propMap.put(prop.getName(), prop); if (nodeProps.replace(node, propMapCurr, propMap)) { return; } } log.warn("Cluster conflict: Unable to add property {} to node {}.", prop.getName(), node.getID()); }