public static FlowCapableNode toInventoryAugment(final FlowNode source) { if ((source instanceof FlowCapableNode)) { return ((FlowCapableNode) source); } return (new FlowCapableNodeBuilder(source)).build(); } }
private FlowCapableNodeImpl(FlowCapableNodeBuilder 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(); }
/** * Create a new flow-capable-node. * * @return A {@link FlowCapableNode} instance. */ private FlowCapableNode createFlowNode() { SwitchFeaturesBuilder sfBuilder = new SwitchFeaturesBuilder(). setMaxBuffers(Long.valueOf(NODE_BUFSIZE)). setMaxTables(Short.valueOf((short)1)). setCapabilities(CAPABILITIES); // Create table 0. Table table0 = new TableBuilder().setId(TABLE_ID).build(); List<Table> tables = Collections.singletonList(table0); String na = "N/A"; return new FlowCapableNodeBuilder(). setIpAddress(ipAddress).setSwitchFeatures(sfBuilder.build()). setDescription(na).setSerialNumber(na). setHardware("OpenFlow mock-up"). setManufacturer("OpenDaylight").setSoftware("0.1"). setTable(tables). build(); }