本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode类的典型用法代码示例。如果您正苦于以下问题:Java FlowCapableNode类的具体用法?Java FlowCapableNode怎么用?Java FlowCapableNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FlowCapableNode类属于org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819包,在下文中一共展示了FlowCapableNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: remove
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode; //导入依赖的package包/类
@Override
protected void remove(InstanceIdentifier<FlowCapableNode> key, FlowCapableNode dataObjectModification) {
NodeKey nodeKey = key.firstKeyOf(Node.class);
BigInteger dpnId = MDSALUtil.getDpnIdFromNodeName(nodeKey.getId());
if (!aclDataUtil.doesDpnHaveAclInterface(dpnId)) {
// serialize ACL pool deletion per switch
jobCoordinator.enqueueJob(String.valueOf(dpnId), () -> {
this.aclServiceUtils.deleteAclIdPools(dpnId);
return Collections.emptyList();
});
LOG.debug("On FlowCapableNode remove event, ACL pools for dpid: {} are deleted.", dpnId);
} else {
LOG.info("On FlowCapableNode remove event, ACL pools for dpid: {} are not deleted "
+ "because ACL ports are associated.", dpnId);
}
}
示例2: removeTunnelTableEntry
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode; //导入依赖的package包/类
private void removeTunnelTableEntry(BigInteger dpId, long label, WriteTransaction tx) {
FlowEntity flowEntity;
LOG.debug("remove terminatingServiceActions called with DpnId = {} and label = {}", dpId, label);
List<MatchInfo> mkMatches = new ArrayList<>();
// Matching metadata
mkMatches.add(new MatchTunnelId(BigInteger.valueOf(label)));
flowEntity = MDSALUtil.buildFlowEntity(dpId,
NwConstants.INTERNAL_TUNNEL_TABLE,
getTableMissFlowRef(dpId, NwConstants.INTERNAL_TUNNEL_TABLE, (int) label),
5, String.format("%s:%d", "TST Flow Entry ", label), 0, 0,
COOKIE_TUNNEL.add(BigInteger.valueOf(label)), mkMatches, null);
Node nodeDpn = FibUtil.buildDpnNode(flowEntity.getDpnId());
FlowKey flowKey = new FlowKey(new FlowId(flowEntity.getFlowId()));
InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class)
.child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flowEntity.getTableId())).child(Flow.class, flowKey).build();
tx.delete(LogicalDatastoreType.CONFIGURATION, flowInstanceId);
LOG.debug("Terminating service Entry for dpID {} : label : {} removed successfully", dpId, label);
}
示例3: getGroup
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode; //导入依赖的package包/类
private Group getGroup(GroupBuilder groupBuilder, NodeBuilder nodeBuilder) {
InstanceIdentifier<Group> path1 = InstanceIdentifier.builder(Nodes.class)
.child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class,
nodeBuilder.getKey())
.augmentation(FlowCapableNode.class).child(Group.class, new GroupKey(groupBuilder.getGroupId()))
.build();
DataBroker databroker = getDataBroker();
ReadOnlyTransaction readTx = databroker.newReadOnlyTransaction();
try {
Optional<Group> data = readTx.read(LogicalDatastoreType.CONFIGURATION, path1).get();
if (data.isPresent()) {
return data.get();
}
} catch (InterruptedException | ExecutionException e) {
LOG.error(e.getMessage(), e);
}
LOG.debug("Cannot find data for Group " + groupBuilder.getGroupName());
return null;
}
示例4: writeGroup
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode; //导入依赖的package包/类
private void writeGroup(GroupBuilder groupBuilder, NodeBuilder nodeBuilder) {
DataBroker databroker = getDataBroker();
ReadWriteTransaction modification = databroker.newReadWriteTransaction();
InstanceIdentifier<Group> path1 = InstanceIdentifier.builder(Nodes.class)
.child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class,
nodeBuilder.getKey())
.augmentation(FlowCapableNode.class).child(Group.class, new GroupKey(groupBuilder.getGroupId()))
.build();
// modification.put(LogicalDatastoreType.CONFIGURATION, path1,
// groupBuilder.build(), true /*createMissingParents*/);
modification.merge(LogicalDatastoreType.CONFIGURATION, path1, groupBuilder.build(),
true /* createMissingParents */);
CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
try {
commitFuture.get();
LOG.debug("Transaction success for write of Group " + groupBuilder.getGroupName());
} catch (InterruptedException | ExecutionException e) {
LOG.error(e.getMessage(), e);
}
}
示例5: removeGroup
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode; //导入依赖的package包/类
private void removeGroup(GroupBuilder groupBuilder, NodeBuilder nodeBuilder) {
DataBroker databroker = getDataBroker();
WriteTransaction modification = databroker.newWriteOnlyTransaction();
InstanceIdentifier<Group> path1 = InstanceIdentifier.builder(Nodes.class)
.child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class,
nodeBuilder.getKey())
.augmentation(FlowCapableNode.class).child(Group.class, new GroupKey(groupBuilder.getGroupId()))
.build();
modification.delete(LogicalDatastoreType.CONFIGURATION, path1);
CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
try {
commitFuture.get();
LOG.debug("Transaction success for deletion of Group " + groupBuilder.getGroupName());
} catch (InterruptedException | ExecutionException e) {
LOG.error(e.getMessage(), e);
}
}
示例6: removeTap
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode; //导入依赖的package包/类
private void removeTap(Tap tap) {
NodeId nodeId = tap.getNode();
String tapId = tap.getId();
String flowIdStr = "Tap_" + tapId + "SrcPort_"; // TODO: Concat srcNodeConnector to each flow;
FlowId flowId = new FlowId(flowIdStr);
FlowBuilder flowBuilder = new FlowBuilder()
.setKey(new FlowKey(flowId))
.setId(flowId)
.setTableId((short)0);
InstanceIdentifier<Flow> flowIID = InstanceIdentifier.builder(Nodes.class)
.child(Node.class, new NodeKey(nodeId))
.augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flowBuilder.getTableId()))
.child(Flow.class, flowBuilder.getKey())
.build();
GenericTransactionUtils.writeData(dataBroker, LogicalDatastoreType.CONFIGURATION, flowIID, flowBuilder.build(), false);
}
示例7: AclNodeListener
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode; //导入依赖的package包/类
@Inject
public AclNodeListener(final IMdsalApiManager mdsalManager, DataBroker dataBroker, AclserviceConfig config,
AclServiceUtils aclServiceUtils, AclDataUtil aclDataUtil, JobCoordinator jobCoordinator) {
super(FlowCapableNode.class, AclNodeListener.class);
this.mdsalManager = mdsalManager;
this.dataBroker = dataBroker;
this.config = config;
this.aclServiceUtils = aclServiceUtils;
this.aclDataUtil = aclDataUtil;
this.jobCoordinator = jobCoordinator;
}
示例8: add
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode; //导入依赖的package包/类
@Override
protected void add(InstanceIdentifier<FlowCapableNode> key, FlowCapableNode dataObjectModification) {
LOG.trace("FlowCapableNode Added: key: {}", key);
NodeKey nodeKey = key.firstKeyOf(Node.class);
BigInteger dpnId = MDSALUtil.getDpnIdFromNodeName(nodeKey.getId());
createTableDefaultEntries(dpnId);
// serialize ACL pool creation per switch
jobCoordinator.enqueueJob(String.valueOf(dpnId), () -> {
this.aclServiceUtils.createAclIdPools(dpnId);
return Collections.emptyList();
});
LOG.trace("FlowCapableNode (dpid: {}) add event is processed.", dpnId);
}
示例9: QosNodeListener
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode; //导入依赖的package包/类
@Inject
public QosNodeListener(final DataBroker dataBroker, final IMdsalApiManager mdsalUtils) {
super(FlowCapableNode.class, QosNodeListener.class);
this.dataBroker = dataBroker;
this.mdsalUtils = mdsalUtils;
LOG.debug("{} created", getClass().getSimpleName());
}
示例10: getFlowRef
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode; //导入依赖的package包/类
public static FlowRef getFlowRef(BigInteger dpId, Flow flow) {
FlowKey flowKey = new FlowKey(new FlowId(flow.getId()));
Node nodeDpn = buildInventoryDpnNode(dpId);
InstanceIdentifier<Flow> flowInstanceId =
InstanceIdentifier.builder(Nodes.class)
.child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flow.getTableId()))
.child(Flow.class, flowKey)
.build();
return new FlowRef(flowInstanceId);
}
示例11: add
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode; //导入依赖的package包/类
@Override
protected void add(InstanceIdentifier<FlowCapableNode> key, FlowCapableNode flowCapableNode) {
BigInteger dpId = MDSALUtil.getDpnIdFromNodeName(key.firstKeyOf(Node.class).getId());
WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
createTableMissFlow(dpId, NwConstants.EGRESS_POLICY_CLASSIFIER_TABLE,
NwConstants.EGRESS_POLICY_CLASSIFIER_COOKIE, tx);
createTableMissFlow(dpId, NwConstants.EGRESS_POLICY_ROUTING_TABLE, NwConstants.EGRESS_POLICY_ROUTING_COOKIE,
tx);
tx.submit();
}
示例12: createTerminatingServiceActions
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode; //导入依赖的package包/类
public void createTerminatingServiceActions(BigInteger destDpId, int label, List<ActionInfo> actionsInfos,
WriteTransaction tx) {
List<MatchInfo> mkMatches = new ArrayList<>();
LOG.debug("create terminatingServiceAction on DpnId = {} and serviceId = {} and actions = {}",
destDpId, label, actionsInfos);
// Matching metadata
// FIXME vxlan vni bit set is not working properly with OVS.need to revisit
mkMatches.add(new MatchTunnelId(BigInteger.valueOf(label)));
List<InstructionInfo> mkInstructions = new ArrayList<>();
mkInstructions.add(new InstructionApplyActions(actionsInfos));
FlowEntity terminatingServiceTableFlowEntity =
MDSALUtil.buildFlowEntity(destDpId, NwConstants.INTERNAL_TUNNEL_TABLE,
getTableMissFlowRef(destDpId, NwConstants.INTERNAL_TUNNEL_TABLE, label), 5,
String.format("%s:%d", "TST Flow Entry ", label),
0, 0, COOKIE_TUNNEL.add(BigInteger.valueOf(label)), mkMatches, mkInstructions);
FlowKey flowKey = new FlowKey(new FlowId(terminatingServiceTableFlowEntity.getFlowId()));
FlowBuilder flowbld = terminatingServiceTableFlowEntity.getFlowBuilder();
Node nodeDpn = FibUtil.buildDpnNode(terminatingServiceTableFlowEntity.getDpnId());
InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class)
.child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(terminatingServiceTableFlowEntity.getTableId()))
.child(Flow.class, flowKey).build();
tx.put(LogicalDatastoreType.CONFIGURATION, flowInstanceId, flowbld.build(),
WriteTransaction.CREATE_MISSING_PARENTS);
}
示例13: makeLFibTableEntry
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode; //导入依赖的package包/类
private void makeLFibTableEntry(BigInteger dpId, long label, List<InstructionInfo> instructions, int priority,
int addOrRemove, WriteTransaction tx) {
Boolean wrTxPresent = true;
if (tx == null) {
wrTxPresent = false;
tx = dataBroker.newWriteOnlyTransaction();
}
List<MatchInfo> matches = new ArrayList<>();
matches.add(MatchEthernetType.MPLS_UNICAST);
matches.add(new MatchMplsLabel(label));
// Install the flow entry in L3_LFIB_TABLE
String flowRef = FibUtil.getFlowRef(dpId, NwConstants.L3_LFIB_TABLE, label, priority);
FlowEntity flowEntity;
flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.L3_LFIB_TABLE, flowRef, priority, flowRef, 0, 0,
NwConstants.COOKIE_VM_LFIB_TABLE, matches, instructions);
Flow flow = flowEntity.getFlowBuilder().build();
String flowId = flowEntity.getFlowId();
FlowKey flowKey = new FlowKey(new FlowId(flowId));
Node nodeDpn = FibUtil.buildDpnNode(dpId);
InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class)
.child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flowKey).build();
if (addOrRemove == NwConstants.ADD_FLOW) {
tx.put(LogicalDatastoreType.CONFIGURATION, flowInstanceId, flow, WriteTransaction.CREATE_MISSING_PARENTS);
} else {
tx.delete(LogicalDatastoreType.CONFIGURATION, flowInstanceId);
}
if (!wrTxPresent) {
tx.submit();
}
LOG.debug("LFIB Entry for dpID {} : label : {} instructions {} : key {} {} successfully",
dpId, label, instructions, flowKey, NwConstants.ADD_FLOW == addOrRemove ? "ADDED" : "REMOVED");
}
示例14: appendFlowForCreate
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode; //导入依赖的package包/类
public void appendFlowForCreate(NodeId node, Flow flow, WriteTransaction tx) {
NodeKey nodeKey = new NodeKey(node);
InstanceIdentifier<Flow> iidFlow = InstanceIdentifier.builder(Nodes.class)
.child(Node.class, nodeKey)
.augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flow.getTableId()))
.child(Flow.class, flow.getKey())
.build();
tx.put(LogicalDatastoreType.CONFIGURATION, iidFlow, flow, WriteTransaction.CREATE_MISSING_PARENTS);
}
示例15: appendFlowForDelete
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode; //导入依赖的package包/类
public void appendFlowForDelete(NodeId node, Flow flow, WriteTransaction tx) {
NodeKey nodeKey = new NodeKey(node);
InstanceIdentifier<Flow> iidFlow = InstanceIdentifier.builder(Nodes.class)
.child(Node.class, nodeKey)
.augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flow.getTableId()))
.child(Flow.class, flow.getKey())
.build();
tx.delete(LogicalDatastoreType.CONFIGURATION, iidFlow);
}