use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.table.update.OriginalTableBuilder in project openflowplugin by opendaylight.
the class TableForwarder method update.
@Override
public Future<RpcResult<UpdateTableOutput>> update(final InstanceIdentifier<TableFeatures> identifier, final TableFeatures original, final TableFeatures update, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
LOG.debug("Forwarding Table Update request [Tbl id, node Id {} {}", identifier, nodeIdent);
final UpdateTableInputBuilder builder = new UpdateTableInputBuilder();
builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
final InstanceIdentifier<Table> iiToTable = nodeIdent.child(Table.class, new TableKey(identifier.firstKeyOf(TableFeatures.class).getTableId()));
builder.setTableRef(new TableRef(iiToTable));
builder.setUpdatedTable(new UpdatedTableBuilder().setTableFeatures(Collections.singletonList(update)).build());
builder.setOriginalTable(new OriginalTableBuilder().setTableFeatures(Collections.singletonList(original)).build());
LOG.debug("Invoking SalTableService {} ", nodeIdent);
return salTableService.updateTable(builder.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.table.update.OriginalTableBuilder in project openflowplugin by opendaylight.
the class TableForwarder method update.
@Override
public void update(final InstanceIdentifier<TableFeatures> identifier, final TableFeatures original, final TableFeatures update, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
LOG.debug("Received the Table Update request [Tbl id, node Id, original, upd" + " " + identifier + " " + nodeIdent + " " + original + " " + update);
final TableFeatures originalTableFeatures = original;
TableFeatures updatedTableFeatures;
if (null == update) {
updatedTableFeatures = original;
} else {
updatedTableFeatures = update;
}
final UpdateTableInputBuilder builder = new UpdateTableInputBuilder();
builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
// TODO: reconsider model - this particular field is not used in service
// implementation
builder.setTableRef(new TableRef(identifier));
builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
builder.setUpdatedTable(new UpdatedTableBuilder().setTableFeatures(Collections.singletonList(updatedTableFeatures)).build());
builder.setOriginalTable(new OriginalTableBuilder().setTableFeatures(Collections.singletonList(originalTableFeatures)).build());
LOG.debug("Invoking SalTableService ");
if (this.provider.getSalTableService() != null) {
LOG.debug(" Handle to SalTableServices" + this.provider.getSalTableService());
}
final Future<RpcResult<UpdateTableOutput>> resultFuture = this.provider.getSalTableService().updateTable(builder.build());
JdkFutures.addErrorLogging(resultFuture, LOG, "updateTable");
}
Aggregations