public FlowCapableNodeBuilder(FlowCapableNode base) { this._description = base.getDescription(); this._group = base.getGroup(); this._hardware = base.getHardware(); this._ipAddress = base.getIpAddress(); this._manufacturer = base.getManufacturer(); this._meter = base.getMeter(); this._portNumber = base.getPortNumber(); this._serialNumber = base.getSerialNumber(); this._software = base.getSoftware(); this._staleGroup = base.getStaleGroup(); this._staleMeter = base.getStaleMeter(); this._supportedActions = base.getSupportedActions(); this._supportedInstructions = base.getSupportedInstructions(); this._supportedMatchTypes = base.getSupportedMatchTypes(); this._switchFeatures = base.getSwitchFeatures(); this._table = base.getTable(); this._tableFeatures = base.getTableFeatures(); }
private NodeDescription toNodeDescription(final NodeRef nodeRef) { final FlowCapableNode capableNode = this.readOperFlowCapableNode(nodeRef); if (capableNode == null) { return null; } final NodeDescription it = new NodeDescription(); it.setManufacturer(capableNode.getManufacturer()); it.setSerialNumber(capableNode.getSerialNumber()); it.setSoftware(capableNode.getSoftware()); it.setDescription(capableNode.getDescription()); return it; }
FlowCapableNode flowCapableNode = node.getAugmentation(FlowCapableNode.class); if (flowCapableNode != null) { List<Meter> meters = flowCapableNode.getMeter(); if (meters != null) { for (Meter meter : meters) { List<Table> flowTables = flowCapableNode.getTable(); if (flowTables != null) { for (Table table : flowTables) { List<Group> groups = flowCapableNode.getGroup(); if (groups != null) { for (Group group : groups) {
List<TableFeatures> tableList = flowNode.get().getTableFeatures() != null ? flowNode.get().getTableFeatures() : Collections.<TableFeatures>emptyList(); for (TableFeatures tableFeaturesItem : tableList) { TableFeaturesKey tableKey = tableFeaturesItem.getKey(); List<Group> groups = flowNode.get().getGroup() != null ? flowNode.get().getGroup() : Collections.<Group>emptyList(); List<Group> toBeInstalledGroups = new ArrayList<>(); toBeInstalledGroups.addAll(groups); List<Meter> meters = flowNode.get().getMeter() != null ? flowNode.get().getMeter() : Collections.<Meter>emptyList(); for (Meter meter : meters) { final KeyedInstanceIdentifier<Meter, MeterKey> meterIdent = List<Table> tables = flowNode.get().getTable() != null ? flowNode.get().getTable() : Collections.<Table>emptyList(); for (Table table : tables) { final KeyedInstanceIdentifier<Table, TableKey> tableIdent =
private List<Table> getTableList(Node node) { FlowCapableNode flowCapableNode = node.getAugmentation(FlowCapableNode.class); List<Table> tableList = flowCapableNode.getTable(); Collections.sort(tableList, new Comparator<Table>() { @Override public int compare(Table o1, Table o2) { return o1.getId().compareTo(o2.getId()); } }); return tableList; }
private void checkOFMatch(final InstanceIdentifier<Node> path, Node node, FlowCapableNode flowCapableNode, List<DeviceTypeInfo> dtiInfoList ){ if (flowCapableNode != null) { String hardware = flowCapableNode.getHardware(); String manufacturer = flowCapableNode.getManufacturer(); String serialNumber = flowCapableNode.getSerialNumber(); String software = flowCapableNode.getSoftware(); LOG.debug("Node '{}' is FlowCapable (\"{}\", \"{}\", \"{}\", \"{}\")", node.getId().getValue(), hardware, manufacturer, serialNumber, software); // TODO: is there a more efficient way to do this? for(DeviceTypeInfo dti: dtiInfoList) { // if the manufacturer matches and there is a h/w match if (manufacturer != null && (manufacturer.equals(dti.getOpenflowManufacturer()))) { List<String> hardwareValues = dti.getOpenflowHardware(); if(hardwareValues != null && hardwareValues.contains(hardware)) { setDeviceType(dti.getDeviceType(), path); return; } } } } }
nodeIdent.toString()); List<Table> tables = flowNode.get().getTable() != null ? flowNode.get().getTable() : Collections.<Table> emptyList(); for (Table table : tables) { final KeyedInstanceIdentifier<Table, TableKey> tableIdent = List<StaleGroup> staleGroups = flowNode.get().getStaleGroup() != null ? flowNode.get().getStaleGroup() : Collections.<StaleGroup> emptyList(); for (StaleGroup staleGroup : staleGroups) { nodeIdent.toString()); List<StaleMeter> staleMeters = flowNode.get().getStaleMeter() != null ? flowNode.get().getStaleMeter() : Collections.<StaleMeter> emptyList();
public void _descStats(CommandInterpreter ci) { int descCount = 0; int descStatsCount = 0; List<Node> nodes = getNodes(); for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext();) { descCount++; NodeKey nodeKey = iterator.next().getKey(); InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier .create(Nodes.class).child(Node.class, nodeKey) .augmentation(FlowCapableNode.class); ReadOnlyTransaction readOnlyTransaction = dataProviderService .newReadOnlyTransaction(); FlowCapableNode node = TestProviderTransactionUtil.getDataObject( readOnlyTransaction, nodeRef); if (node != null) { if (null != node.getHardware() && null != node.getManufacturer() && null != node.getSoftware()) { descStatsCount++; } } } if (descCount == descStatsCount) { LOG.debug("descStats - Success"); } else { LOG.debug("descStats - Failed"); LOG .debug("System fetches stats data in 50 seconds interval, so please wait and try again."); } }
private List<TableFeatureProperties> getTableFeatureProperties(final NodeId nodeId, final Short tableId) { Node node = getDataObject(dataBroker.newReadOnlyTransaction(), InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(nodeId))); if (node == null) { return Collections.emptyList(); } FlowCapableNode flowCapableNode = node.getAugmentation(FlowCapableNode.class); List<TableFeatures> features = flowCapableNode.getTableFeatures(); if (features == null || features.isEmpty()) { return Collections.emptyList(); } return features.get(tableId).getTableProperties().getTableFeatureProperties(); }
.getAugmentation(FlowCapableNode.class); if (fcnode != null) { List<Meter> meters = fcnode.getMeter(); if (meters != null) { for (Meter meter : meters) { List<Table> tables = fcnode.getTable(); if (tables != null) { for (Table t : tables) { List<Group> groups = fcnode.getGroup(); if (groups != null) { for (Group g : groups) {
public NodeUpdateState(final InstanceIdentifier<FlowCapableNode> fNodeIdent, final FlowCapableNode flowCapableNode) { nodeIdentifier = fNodeIdent; final List<Table> tableList = flowCapableNode.getTable(); if(tableList != null) { for (final Table table : tableList) { final TableKey tableKey = table.getKey(); tables.put(tableKey, new TableFlowUpdateState(nodeIdentifier.child(Table.class,tableKey),table)); } } }
if (!Objects.equals(_description, other.getDescription())) { return false; if (!Objects.equals(_group, other.getGroup())) { return false; if (!Objects.equals(_hardware, other.getHardware())) { return false; if (!Objects.equals(_ipAddress, other.getIpAddress())) { return false; if (!Objects.equals(_manufacturer, other.getManufacturer())) { return false; if (!Objects.equals(_meter, other.getMeter())) { return false; if (!Objects.equals(_portNumber, other.getPortNumber())) { return false; if (!Objects.equals(_serialNumber, other.getSerialNumber())) { return false; if (!Objects.equals(_software, other.getSoftware())) { return false; if (!Objects.equals(_staleGroup, other.getStaleGroup())) { return false;
public NodeUpdateState(final InstanceIdentifier<FlowCapableNode> fNodeIdent, final FlowCapableNode flowCapableNode) { nodeIdentifier = fNodeIdent; final List<Table> tableList = flowCapableNode.getTable(); if(tableList != null) { for (final Table table : tableList) { final TableKey tableKey = table.getKey(); tables.put(tableKey, new TableFlowUpdateState(nodeIdentifier.child(Table.class,tableKey),table)); } } }