本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey类的典型用法代码示例。如果您正苦于以下问题:Java FlowKey类的具体用法?Java FlowKey怎么用?Java FlowKey使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FlowKey类属于org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table包,在下文中一共展示了FlowKey类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeTunnelTableEntry
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey; //导入依赖的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: createFlowBuilder
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey; //导入依赖的package包/类
public static FlowBuilder createFlowBuilder(final short table, final int priority, final BigInteger cookieValue,
final String flowName, final String flowIdStr, MatchBuilder match,
InstructionsBuilder isb) {
FlowBuilder flow = new FlowBuilder();
flow.setId(new FlowId(flowIdStr));
flow.setKey(new FlowKey(new FlowId(flowIdStr)));
flow.setTableId(table);
flow.setFlowName(flowName);
flow.setCookie(new FlowCookie(cookieValue));
flow.setCookieMask(new FlowCookie(cookieValue));
flow.setContainerName(null);
flow.setStrict(false);
flow.setMatch(match.build());
flow.setInstructions(isb.build());
flow.setPriority(priority);
flow.setHardTimeout(0);
flow.setIdleTimeout(0);
flow.setFlags(new FlowModFlags(false, false, false, false, false));
if (null == flow.isBarrier()) {
flow.setBarrier(Boolean.FALSE);
}
return flow;
}
示例3: createArpReplyToControllerFlow
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey; //导入依赖的package包/类
protected FlowBuilder createArpReplyToControllerFlow() {
final FlowBuilder arpFlow = new FlowBuilder()
.setPriority(OFRendererConstants.ARP_REPLY_TO_CONTROLLER_FLOW_PRIORITY)
.setIdleTimeout(0)
.setHardTimeout(0)
.setCookie(new FlowCookie(BigInteger.valueOf(flowCookie.incrementAndGet())))
.setFlags(new FlowModFlags(false, false, false, false, false));
final EthernetMatch ethernetMatch = FlowUtils.createEthernetMatch();
/** NOTE:
* Setting layer 3 match seems to be messing with the flow ID
* check for possible bug on openflow plugin side.
* Use following code for specific ARP REQUEST or REPLY packet capture
* ArpMatch arpMatch = FlowUtils.createArpMatch();
*/
final Match match = new MatchBuilder().setEthernetMatch(ethernetMatch).build();//.setLayer3Match(arpMatch).build();
arpFlow.setMatch(match);
final Instructions instructions = createOutputInstructions(OutputPortValues.CONTROLLER, OutputPortValues.NORMAL);
arpFlow.setInstructions(instructions);
final String flowName = createFlowName();
arpFlow.setFlowName(flowName);
final FlowId flowId = new FlowId(flowName);
arpFlow.setId(flowId);
arpFlow.setKey(new FlowKey(flowId));
return arpFlow;
}
示例4: createFlow
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey; //导入依赖的package包/类
public FlowBuilder createFlow(final Dataflow dataFlow) throws DataflowCreationException {
FlowBuilder flowBuilder = new FlowBuilder();
try {
final FlowModFlags flowModFlags = new FlowModFlags(false, false, false, false, false);
final FlowId flowId = new FlowId(dataFlow.getId().toString());
final FlowKey flowKey = new FlowKey(flowId);
final MeterId meterId = new MeterId(dataFlow.getMeterId().longValue());
flowBuilder.setFlowName("NIC_METER" + meterId.getValue());
flowBuilder.setId(new FlowId(Long.toString(flowBuilder.hashCode())));
flowBuilder.setMatch(createMatch(dataFlow.getSourceIpAddress()));
flowBuilder.setInstructions(createInstruction(meterId));
flowBuilder.setPriority(OFRendererConstants.DEFAULT_PRIORITY);
flowBuilder.setCookie(new FlowCookie(BigInteger.valueOf(flowCookieInc.getAndIncrement())));
flowBuilder.setBufferId(OFP_NO_BUFFER);
flowBuilder.setHardTimeout((int) dataFlow.getTimeout());
flowBuilder.setIdleTimeout((int) dataFlow.getTimeout());
flowBuilder.setFlags(flowModFlags);
flowBuilder.setKey(flowKey);
} catch (Exception e) {
throw new DataflowCreationException(e.getMessage());
}
return flowBuilder;
}
示例5: createFlowBuilder
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey; //导入依赖的package包/类
private FlowBuilder createFlowBuilder(final MatchBuilder matchBuilder, final FlowId flowId) {
final Match match = matchBuilder.build();
final FlowKey key = new FlowKey(flowId);
final FlowBuilder flowBuilder = new FlowBuilder();
final BigInteger cookieId = new BigInteger("20", RADIX);
flowBuilder.setId(flowId);
flowBuilder.setKey(key);
flowBuilder.setFlowName(flowName);
flowBuilder.setCookie(new FlowCookie(cookieId));
flowBuilder.setCookieMask(new FlowCookie(cookieId));
flowBuilder.setContainerName(null);
flowBuilder.setStrict(false);
flowBuilder.setMatch(match);
flowBuilder.setFlags(new FlowModFlags(false, false, false, false, false));
flowBuilder.setBarrier(true);
flowBuilder.setPriority(OFRendererConstants.DEFAULT_PRIORITY);
flowBuilder.setHardTimeout(OFRendererConstants.DEFAULT_HARD_TIMEOUT);
flowBuilder.setIdleTimeout(OFRendererConstants.DEFAULT_IDLE_TIMEOUT);
return flowBuilder;
}
示例6: createLldpReplyToControllerFlow
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey; //导入依赖的package包/类
private FlowBuilder createLldpReplyToControllerFlow() {
FlowBuilder lldpFlow = new FlowBuilder().setFlowName(createFlowName())
.setIdleTimeout(0)
.setHardTimeout(0)
.setCookie(new FlowCookie(BigInteger.valueOf(flowCookie.incrementAndGet())))
.setFlags(new FlowModFlags(false, false, false, false, false))
.setPriority(OFRendererConstants.LLDP_REPLY_TO_CONTROLLER_FLOW_PRIORITY);
EthernetMatchBuilder ethernetMatchBuilder = new EthernetMatchBuilder()
.setEthernetType(new EthernetTypeBuilder()
.setType(new EtherType(Long.valueOf(OFRendererConstants.LLDP_ETHER_TYPE))).build());
Match match = new MatchBuilder().setEthernetMatch(ethernetMatchBuilder.build()).build();
lldpFlow.setMatch(match);
Instructions instructions = createOutputInstructions(OutputPortValues.CONTROLLER);
lldpFlow.setInstructions(instructions);
FlowId flowId = new FlowId(createFlowName());
lldpFlow.setId(flowId);
lldpFlow.setKey(new FlowKey(flowId));
return lldpFlow;
}
示例7: removeTap
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey; //导入依赖的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);
}
示例8: getFlowRef
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey; //导入依赖的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);
}
示例9: createTerminatingServiceActions
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey; //导入依赖的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);
}
示例10: makeLFibTableEntry
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey; //导入依赖的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");
}
示例11: removeVpnLinkEndpointFlows
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey; //导入依赖的package包/类
@SuppressWarnings("checkstyle:IllegalCatch")
private void removeVpnLinkEndpointFlows(InterVpnLink del, String vpnUuid, String rd, List<BigInteger> dpns,
int otherEndpointLportTag, String otherEndpointIpAddr,
List<VrfEntry> vrfEntries, final boolean isVpnFirstEndPoint) {
String interVpnLinkName = del.getName();
LOG.debug("Removing endpoint flows for vpn {}. InterVpnLink={}. OtherEndpointLportTag={}",
vpnUuid, interVpnLinkName, otherEndpointLportTag);
if (dpns == null) {
LOG.debug("VPN {} endpoint is not instantiated in any DPN for InterVpnLink {}",
vpnUuid, interVpnLinkName);
return;
}
for (BigInteger dpnId : dpns) {
try {
// Removing flow from LportDispatcher table
String flowRef = InterVpnLinkUtil.getLportDispatcherFlowRef(interVpnLinkName, otherEndpointLportTag);
FlowKey flowKey = new FlowKey(new FlowId(flowRef));
Flow flow = new FlowBuilder().setKey(flowKey).setId(new FlowId(flowRef))
.setTableId(NwConstants.LPORT_DISPATCHER_TABLE).setFlowName(flowRef)
.build();
mdsalManager.removeFlow(dpnId, flow);
// Also remove the 'fake' iface from the VpnToDpn map
InterVpnLinkUtil.removeIVpnLinkIfaceFromVpnFootprint(vpnFootprintService, vpnUuid, rd, dpnId);
} catch (Exception e) {
// Whatever happens it should not stop it from trying to remove as much as possible
LOG.warn("Error while removing InterVpnLink {} Endpoint flows on dpn {}. Reason: ",
interVpnLinkName, dpnId, e);
}
}
// Removing flow from FIB and LFIB tables
LOG.trace("Removing flow in FIB and LFIB tables for vpn {} interVpnLink {} otherEndpointIpAddr {}",
vpnUuid, interVpnLinkName, otherEndpointIpAddr);
cleanUpInterVPNRoutes(interVpnLinkName, vrfEntries, isVpnFirstEndPoint);
}
示例12: getFlowIid
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey; //导入依赖的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();
}
示例13: getFlowIid
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey; //导入依赖的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();
}
示例14: writeDataTransaction
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey; //导入依赖的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;
}
示例15: addFlowGoto
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey; //导入依赖的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();
}