use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.pcupd.message.pcupd.message.updates.Path in project openflowplugin by opendaylight.
the class TransactionChainManagerTest method testEnableCounter1.
/**
* Test of {@link TransactionChainManager#enableSubmit()}: no submit - counter is not active.
*/
@Test
public void testEnableCounter1() throws Exception {
final Node data = new NodeBuilder().setId(nodeId).build();
txChainManager.writeToTransaction(LogicalDatastoreType.CONFIGURATION, path, data, false);
txChainManager.writeToTransaction(LogicalDatastoreType.CONFIGURATION, path, data, false);
Mockito.verify(txChain).newReadWriteTransaction();
Mockito.verify(writeTx, Mockito.times(2)).put(LogicalDatastoreType.CONFIGURATION, path, data, false);
Mockito.verify(writeTx, Mockito.never()).submit();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.pcupd.message.pcupd.message.updates.Path in project openflowplugin by opendaylight.
the class FlowCapableTopologyProvider method start.
/**
* Gets called on start of a bundle.
*/
public void start() {
final TopologyKey key = new TopologyKey(new TopologyId(TOPOLOGY_ID));
final InstanceIdentifier<Topology> path = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, key);
final FlowCapableTopologyExporter listener = new FlowCapableTopologyExporter(processor, path);
this.listenerRegistration = notificationService.registerNotificationListener(listener);
this.transactionChainManager = new TransactionChainManager(dataBroker, TOPOLOGY_PROVIDER);
this.transactionChainManager.activateTransactionManager();
this.transactionChainManager.initialSubmitWriteTransaction();
if (!isFlowTopologyExist(path)) {
transactionChainManager.writeToTransaction(LogicalDatastoreType.OPERATIONAL, path, new TopologyBuilder().setKey(key).build(), true);
transactionChainManager.submitTransaction();
}
LOG.info("FlowCapableTopologyProvider started");
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.pcupd.message.pcupd.message.updates.Path in project openflowplugin by opendaylight.
the class MatchExtensionHelper method injectExtension.
/**
* Injects an extension.
*
* @param matchEntry match entry
* @param ofVersion openflow version
* @param matchPath match path
*/
public static void injectExtension(final short ofVersion, final MatchEntry matchEntry, final MatchBuilder matchBuilder, final MatchPath matchPath) {
final ExtensionListBuilder extBuilder = processExtension(matchEntry, ofVersion, matchPath);
if (Objects.isNull(extBuilder)) {
LOG.warn("Convertor for {} for version {} with match path {} not found.", matchEntry.toString(), ofVersion, matchPath.name());
}
final GeneralAugMatchNodesNodeTableFlowBuilder builder = Optional.ofNullable(matchBuilder.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class)).map(GeneralAugMatchNodesNodeTableFlowBuilder::new).orElse(new GeneralAugMatchNodesNodeTableFlowBuilder().setExtensionList(new ArrayList<>()));
builder.getExtensionList().add(extBuilder.build());
matchBuilder.addAugmentation(GeneralAugMatchNodesNodeTableFlow.class, builder.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.pcupd.message.pcupd.message.updates.Path in project openflowplugin by opendaylight.
the class MatchExtensionHelper method processAllExtensions.
/**
* Processes all extensions.
*
* @param matchEntries match entries
* @param ofVersion openflow version
* @param matchPath match path
* @param <E> extension point
* @return augmentation wrapper containing augmentation depending on matchPath
*/
@SuppressWarnings("unchecked")
public static <E extends Augmentable<E>> AugmentTuple<E> processAllExtensions(Collection<MatchEntry> matchEntries, OpenflowVersion ofVersion, MatchPath matchPath) {
List<ExtensionList> extensionsList = new ArrayList<>();
for (MatchEntry matchEntry : matchEntries) {
ExtensionListBuilder extensionListBld = processExtension(matchEntry, ofVersion.getVersion(), matchPath);
if (extensionListBld == null) {
continue;
}
extensionsList.add(extensionListBld.build());
}
AugmentTuple<E> augmentTuple = null;
if (!extensionsList.isEmpty()) {
switch(matchPath) {
case FLOWS_STATISTICS_UPDATE_MATCH:
GeneralAugMatchNotifUpdateFlowStatsBuilder generalExtMatchAugBld1 = new GeneralAugMatchNotifUpdateFlowStatsBuilder();
generalExtMatchAugBld1.setExtensionList(extensionsList);
augmentTuple = (AugmentTuple<E>) new AugmentTuple<>(GeneralAugMatchNotifUpdateFlowStats.class, generalExtMatchAugBld1.build());
break;
case PACKET_RECEIVED_MATCH:
GeneralAugMatchNotifPacketInBuilder generalExtMatchAugBld2 = new GeneralAugMatchNotifPacketInBuilder();
generalExtMatchAugBld2.setExtensionList(extensionsList);
augmentTuple = (AugmentTuple<E>) new AugmentTuple<>(GeneralAugMatchNotifPacketIn.class, generalExtMatchAugBld2.build());
break;
case PACKET_IN_MESSAGE_MATCH:
GeneralAugMatchPacketInMessageBuilder generalExtMatchAugBld5 = new GeneralAugMatchPacketInMessageBuilder();
generalExtMatchAugBld5.setExtensionList(extensionsList);
augmentTuple = (AugmentTuple<E>) new AugmentTuple<>(GeneralAugMatchPacketInMessage.class, generalExtMatchAugBld5.build());
break;
case SWITCH_FLOW_REMOVED_MATCH:
GeneralAugMatchNotifSwitchFlowRemovedBuilder generalExtMatchAugBld3 = new GeneralAugMatchNotifSwitchFlowRemovedBuilder();
generalExtMatchAugBld3.setExtensionList(extensionsList);
augmentTuple = (AugmentTuple<E>) new AugmentTuple<>(GeneralAugMatchNotifSwitchFlowRemoved.class, generalExtMatchAugBld3.build());
break;
case FLOWS_STATISTICS_RPC_MATCH:
GeneralAugMatchRpcOutputFlowStatsBuilder generalExtMatchAugBld4 = new GeneralAugMatchRpcOutputFlowStatsBuilder();
generalExtMatchAugBld4.setExtensionList(extensionsList);
augmentTuple = (AugmentTuple<E>) new AugmentTuple<>(GeneralAugMatchRpcOutputFlowStats.class, generalExtMatchAugBld4.build());
break;
default:
LOG.warn("matchPath not supported: {}", matchPath);
}
}
return augmentTuple;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.pcupd.message.pcupd.message.updates.Path in project openflowplugin by opendaylight.
the class PacketOutConvertorTest method createNodeRef.
private static NodeRef createNodeRef(final String nodeId) {
NodeKey key = new NodeKey(new NodeId(nodeId));
InstanceIdentifier<Node> path = InstanceIdentifier.<Nodes>builder(Nodes.class).<Node, NodeKey>child(Node.class, key).build();
return new NodeRef(path);
}
Aggregations