本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table类的典型用法代码示例。如果您正苦于以下问题:Java Table类的具体用法?Java Table怎么用?Java Table使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Table类属于org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables包,在下文中一共展示了Table类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeTunnelTableEntry
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的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);
}
示例2: removeTap
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的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);
}
示例3: getFlowRef
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的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);
}
示例4: createTerminatingServiceActions
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的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);
}
示例5: makeLFibTableEntry
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的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");
}
示例6: appendFlowForCreate
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的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);
}
示例7: appendFlowForDelete
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的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);
}
示例8: getFlowIid
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
public static InstanceIdentifier<Flow> getFlowIid(Flow flow, BigInteger dpnId) {
FlowKey flowKey = new FlowKey(new FlowId(flow.getId()));
org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId =
new org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId("openflow:" + dpnId);
org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node nodeDpn =
new NodeBuilder().setId(nodeId).setKey(new NodeKey(nodeId)).build();
return InstanceIdentifier.builder(Nodes.class)
.child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class,
nodeDpn.getKey()).augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flowKey).build();
}
示例9: getFlowIid
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
protected InstanceIdentifier<Flow> getFlowIid(short tableId, FlowId flowid, BigInteger dpnId) {
FlowKey flowKey = new FlowKey(new FlowId(flowid));
NodeId nodeId =
new NodeId("openflow:" + dpnId);
Node nodeDpn =
new NodeBuilder().setId(nodeId).setKey(new NodeKey(nodeId)).build();
return InstanceIdentifier.builder(Nodes.class)
.child(Node.class,
nodeDpn.getKey()).augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(tableId)).child(Flow.class, flowKey).build();
}
示例10: createFlowPath
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
private static InstanceIdentifier<Flow> createFlowPath(FlowBuilder flowBuilder, NodeBuilder nodeBuilder) {
return InstanceIdentifier.builder(Nodes.class)
.child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class,
nodeBuilder.getKey())
.augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flowBuilder.getTableId()))
.child(Flow.class, flowBuilder.getKey()).build();
}
示例11: getTable
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
public static Table getTable(NodeBuilder nodeBuilder, short table, ReadOnlyTransaction readTx,
final LogicalDatastoreType store) {
try {
Optional<Table> data = readTx.read(store, createTablePath(nodeBuilder, table)).get();
if (data.isPresent()) {
return data.get();
}
} catch (InterruptedException | ExecutionException e) {
LOG.error("Failed to get table {}", table, e);
}
LOG.info("Cannot find data for table {} in {}", table, store);
return null;
}
示例12: retrieveIdentifier
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
private InstanceIdentifier<Flow> retrieveIdentifier(final NodeBuilder nodeBuilder,
final FlowBuilder flowBuilder) {
flowBuilder.setTableId(OFRendererConstants.FALLBACK_TABLE_ID);
InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow> flowIID = InstanceIdentifier.builder(Nodes.class)
.child(Node.class, nodeBuilder.getKey())
.augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flowBuilder.getTableId()))
.child(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow.class, flowBuilder.getKey())
.build();
return flowIID;
}
示例13: writeDataTransaction
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
/**
* Writes a Flow with a flow action on the Configuration
* data store so that it can be applied to an OF switch.
* @param nodeId The {@link NodeId} of the OF Switch
* @param flowBuilder The {@link FlowBuilder} that is built and submitted
* @param flowAction The {@link FlowAction} the flow action (ADD or REMOVE)
* @return A boolean representing the transaction result
*/
protected boolean writeDataTransaction(NodeId nodeId, FlowBuilder flowBuilder, FlowAction flowAction) {
boolean result = false;
final NodeBuilder nodeBuilder = new NodeBuilder();
final FlowKey flowKey = new FlowKey(flowBuilder.getKey());
nodeBuilder.setId(nodeId);
nodeBuilder.setKey(new NodeKey(nodeBuilder.getId()));
MdsalUtils mdsal = new MdsalUtils(dataBroker);
if (!pipelineManager.setTableId(nodeId, flowBuilder)) {
flowBuilder.setTableId(OFRendererConstants.FALLBACK_TABLE_ID);
}
final TableKey tableKey = new TableKey(flowBuilder.getTableId());
InstanceIdentifier<Flow> flowIID = InstanceIdentifier.builder(Nodes.class)
.child(Node.class, nodeBuilder.getKey())
.augmentation(FlowCapableNode.class)
.child(Table.class, tableKey)
.child(Flow.class, flowKey)
.build();
if (flowAction == FlowAction.ADD_FLOW) {
result = mdsal.put(LogicalDatastoreType.CONFIGURATION, flowIID, flowBuilder.build());
}
else if(flowAction == FlowAction.REMOVE_FLOW) {
result = mdsal.delete(LogicalDatastoreType.CONFIGURATION, flowIID);
}
return result;
}
示例14: createPipeline
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
private void createPipeline(Node node) {
List<Table> tableList = getTableList(node);
for (Table table : tableList) {
List<Short> nextIds = getNextTablesMiss(node.getId(), table.getId());
if (nextIds.isEmpty()) {
break;
}
Short nextId = Collections.min(nextIds);
Short currentId = table.getId();
addFlowGoto(node, currentId, nextId);
}
}
示例15: addFlowGoto
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
private void addFlowGoto(Node node, Short currentId, Short nextId) {
FlowBuilder flowBuilder = new FlowBuilder();
flowBuilder.setTableId(currentId);
flowBuilder.setHardTimeout(0);
flowBuilder.setPriority(0);
flowBuilder.setMatch(new MatchBuilder().build());
flowBuilder.setInstructions(
new InstructionsBuilder().setInstruction(Collections.singletonList(
new InstructionBuilder().setInstruction(
new GoToTableCaseBuilder().setGoToTable(
new GoToTableBuilder().setTableId(nextId).build()
).build()
).setOrder(0).build()
)).build());
String flowIdStr = "PipelineManager";
final FlowId flowId = new FlowId(flowIdStr);
final FlowKey key = new FlowKey(flowId);
flowBuilder.setKey(key);
InstanceIdentifier<Flow> flowIID = InstanceIdentifier.builder(Nodes.class)
.child(Node.class, new NodeKey(node.getId())).augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flowBuilder.getTableId())).child(Flow.class, flowBuilder.getKey())
.build();
WriteTransaction transaction = dataBroker.newWriteOnlyTransaction();
transaction.put(LogicalDatastoreType.CONFIGURATION, flowIID, flowBuilder.build(), true);
transaction.submit();
}