/*
- * Copyright (c) 2014, 2016 Cisco Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2014, 2017 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
public void addFlowCapableNode(NodeKey nodeKey) {
Nodes nodes = new NodesBuilder().setNode(Collections.<Node>emptyList()).build();
- InstanceIdentifier<Node> flowNodeIdentifier = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, nodeKey);
FlowCapableNodeBuilder fcnBuilder = new FlowCapableNodeBuilder();
NodeBuilder nodeBuilder = new NodeBuilder();
- nodeBuilder.setKey(nodeKey);
+ nodeBuilder.withKey(nodeKey);
nodeBuilder.addAugmentation(FlowCapableNode.class, fcnBuilder.build());
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Nodes.class), nodes);
+
+ InstanceIdentifier<Node> flowNodeIdentifier = InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey);
writeTx.put(LogicalDatastoreType.OPERATIONAL, flowNodeIdentifier, nodeBuilder.build());
writeTx.put(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(Nodes.class), nodes);
writeTx.put(LogicalDatastoreType.CONFIGURATION, flowNodeIdentifier, nodeBuilder.build());
public void removeNode(NodeKey nodeKey) throws ExecutionException, InterruptedException {
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
- writeTx.delete(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey));
+ writeTx.delete(LogicalDatastoreType.OPERATIONAL,
+ InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey));
writeTx.submit().get();
}
public void addTable(final TableKey tableKey, final NodeKey nodeKey) {
addFlowCapableNode(nodeKey);
- final Table table = new TableBuilder().setKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
+ final Table table = new TableBuilder().withKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
InstanceIdentifier<Table> tableII = InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey)
.augmentation(FlowCapableNode.class).child(Table.class, tableKey);
final ConfigurationService configurationService = Mockito.mock(ConfigurationService.class);
final ForwardingRulesManagerConfig config = getConfig();
- Mockito.when(configurationService.registerListener(Mockito.any())).thenReturn(() -> {});
+ Mockito.when(configurationService.registerListener(Mockito.any())).thenReturn(() -> {
+ });
Mockito.when(configurationService.getProperty(Mockito.eq("disable-reconciliation"), Mockito.any()))
.thenReturn(config.isDisableReconciliation());
return configurationService;
}
-
}