use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder in project openflowplugin by opendaylight.
the class OpenflowPluginBulkTransactionProvider method _modifyFlows.
public void _modifyFlows(CommandInterpreter ci) {
NodeBuilder tn = createTestNode(ci.nextArgument());
String flowtype = ci.nextArgument();
Integer flowcnt = Integer.parseInt(flowtype);
FlowBuilder tf;
FlowBuilder tf1;
FlowBuilder tf2;
FlowBuilder tf3;
switch(flowcnt) {
case 1:
tf = createTestFlow(tn, "f82", "10");
tf1 = createTestFlow(tn, "f83", "11");
tf2 = createTestFlow(tn, "f84", "12");
tf3 = createTestFlow(tn, "f85", "13");
break;
case 2:
tf = createTestFlow(tn, "f700", "3");
tf1 = createTestFlow(tn, "f4", "4");
tf2 = createTestFlow(tn, "f900", "5");
tf3 = createTestFlow(tn, "f86", "6");
break;
case 3:
// +
tf = createTestFlow(tn, "f91", "7");
tf1 = createTestFlow(tn, "f92", "8");
tf2 = createTestFlow(tn, "f93", "9");
tf3 = createTestFlow(tn, "f94", "10");
break;
case 4:
// +ve scenario
tf = createTestFlow(tn, "f230", "3");
tf1 = createTestFlow(tn, "f99", "4");
tf2 = createTestFlow(tn, "f100", "5");
tf3 = createTestFlow(tn, "f101", "6");
break;
case 5:
// -
tf = createTestFlow(tn, "f23", "3");
tf1 = createTestFlow(tn, "f99", "4");
tf2 = createTestFlow(tn, "f100", "5");
tf3 = createTestFlow(tn, "f101", "6");
break;
default:
tf = createTestFlow(tn, "f87", "12");
tf1 = createTestFlow(tn, "f88", "13");
tf2 = createTestFlow(tn, "f89", "14");
tf3 = createTestFlow(tn, "f90", "15");
}
writeFlow(ci, tf, tf1, tf2, tf3, tn);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder in project openflowplugin by opendaylight.
the class OpenflowPluginBulkTransactionProvider method _addFlows.
public void _addFlows(CommandInterpreter ci) {
NodeBuilder tn = createTestNode(ci.nextArgument());
String flowtype = ci.nextArgument();
Integer flowcnt = Integer.parseInt(flowtype);
FlowBuilder tf;
FlowBuilder tf1;
FlowBuilder tf2;
FlowBuilder tf3;
switch(flowcnt) {
case 1:
tf = createTestFlow(tn, "f1", "10");
tf1 = createTestFlow(tn, "f2", "11");
tf2 = createTestFlow(tn, "f3", "12");
tf3 = createTestFlow(tn, "f4", "13");
break;
case 2:
tf = createTestFlow(tn, "f3", "3");
tf1 = createTestFlow(tn, "f4", "4");
tf2 = createTestFlow(tn, "f5", "5");
tf3 = createTestFlow(tn, "f6", "6");
break;
case 3:
tf = createTestFlow(tn, "f7", "7");
tf1 = createTestFlow(tn, "f8", "8");
tf2 = createTestFlow(tn, "f9", "9");
tf3 = createTestFlow(tn, "f10", "10");
break;
case 4:
// -ve scenario
tf = createTestFlow(tn, "f23", "3");
tf1 = createTestFlow(tn, "f34", "4");
tf2 = createTestFlow(tn, "f35", "5");
tf3 = createTestFlow(tn, "f36", "6");
break;
case 5:
// +ve scenario
// modify case 6 -ve
tf = createTestFlow(tn, "f230", "3");
tf1 = createTestFlow(tn, "f34", "4");
tf2 = createTestFlow(tn, "f35", "5");
tf3 = createTestFlow(tn, "f36", "6");
break;
default:
tf = createTestFlow(tn, "f42", "42");
tf1 = createTestFlow(tn, "f43", "43");
tf2 = createTestFlow(tn, "f44", "44");
tf3 = createTestFlow(tn, "f45", "45");
}
writeFlow(ci, tf, tf1, tf2, tf3, tn);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginTableFeaturesTestCommandProvider method createTestNode.
private void createTestNode() {
NodeBuilder builder = new NodeBuilder();
builder.setId(new NodeId(OpenflowpluginTestActivator.NODE_ID));
builder.setKey(new NodeKey(builder.getId()));
testNode = builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginTableFeaturesTestCommandProvider method createUserNode.
private void createUserNode(String nodeRef) {
NodeBuilder builder = new NodeBuilder();
builder.setId(new NodeId(nodeRef));
builder.setKey(new NodeKey(builder.getId()));
testNode = builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder in project bgpcep by opendaylight.
the class NodeNlriParser method serializeOspfPseudoNode.
private static CRouterIdentifier serializeOspfPseudoNode(final ContainerNode ospfPseudonode) {
final OspfPseudonodeCaseBuilder builder = new OspfPseudonodeCaseBuilder();
final OspfPseudonodeBuilder nodeBuilder = new OspfPseudonodeBuilder();
if (ospfPseudonode.getChild(LAN_IFACE_NID).isPresent()) {
nodeBuilder.setLanInterface(new OspfInterfaceIdentifier((Long) ospfPseudonode.getChild(LAN_IFACE_NID).get().getValue()));
}
if (ospfPseudonode.getChild(OSPF_ROUTER_NID).isPresent()) {
nodeBuilder.setOspfRouterId((Long) ospfPseudonode.getChild(OSPF_ROUTER_NID).get().getValue());
}
builder.setOspfPseudonode(nodeBuilder.build());
return builder.build();
}
Aggregations