本文整理了Java中org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow.getId()
方法的一些代码示例,展示了Flow.getId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Flow.getId()
方法的具体详情如下:
包路径:org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow
类名称:Flow
方法名:getId
暂无
代码示例来源:origin: org.opendaylight.vtn/manager.it.ofmock
/**
* Add a MD-SAL flow entry to be removed from the flow table.
*
* @param flow A MD-SAL flow entry to be removed from the flow table.
*/
public void addRemoved(Flow flow) {
removedIds.add(flow.getId().getValue());
}
代码示例来源:origin: org.opendaylight.nic/of-renderer
/**
* To delete Arp flows in the given node.
* @param nodeId : nodeId
*/
private void deleteArpFlow(NodeId nodeId) {
List<Flow> flowList = getFlowList(nodeId);
for (Flow flow : flowList) {
String flowId = flow.getId().toString();
if (flowId.contains(ARP_REPLY_TO_CONTROLLER_FLOW_NAME)) {
deleteFlow(nodeId, flow);
}
}
}
代码示例来源:origin: org.opendaylight.vpnservice/mdsalutil-impl
private void notifyTaskIfRequired(BigInteger dpId, Flow flow) {
FlowInfoKey flowKey = new FlowInfoKey(dpId, flow.getTableId(), flow.getMatch(), flow.getId().getValue());
Runnable notifyTask = flowMap.remove(flowKey);
if (notifyTask == null) {
return;
}
executorService.execute(notifyTask);
}
代码示例来源:origin: org.opendaylight.openflowplugin.applications/forwardingrules-manager
private StaleFlow makeStaleFlow(InstanceIdentifier<Flow> identifier, Flow del, InstanceIdentifier<FlowCapableNode> nodeIdent){
StaleFlowBuilder staleFlowBuilder = new StaleFlowBuilder(del);
return staleFlowBuilder.setId(del.getId()).build();
}
代码示例来源:origin: org.opendaylight.vtn/manager.implementation
/**
* Add the given flow information into this instance.
*
* @param data An {@link IdentifiedData} instance which contains
* flow statistics.
*/
public void add(IdentifiedData<Flow> data) {
Flow flow = data.getValue();
FlowCookie cookie = flow.getCookie();
VtnFlowId vtnId = FlowUtils.getVtnFlowId(cookie);
if (vtnId == null) {
LOG.debug("{}: Unwanted flow cookie: {}",
flow.getId().getValue(), cookie);
} else {
InstanceIdentifier<Flow> path = data.getIdentifier();
SalNode snode = SalNode.create(path.firstKeyOf(Node.class));
if (snode == null) {
LOG.debug("{}: Invalid flow path: {}",
flow.getId().getValue(), path);
} else {
Map<SalNode, Flow> flowMap = addedFlows.get(vtnId);
if (flowMap == null) {
flowMap = new HashMap<>();
addedFlows.put(vtnId, flowMap);
}
flowMap.put(snode, flow);
}
}
}
代码示例来源:origin: org.opendaylight.vtn/manager.it.ofmock
/**
* {@inheritDoc}
*/
@Override
protected void execute(ReadWriteTransaction tx) {
removedFlow = null;
// Fetch the target flow entry.
LogicalDatastoreType oper = LogicalDatastoreType.OPERATIONAL;
Optional<Flow> opt = DataStoreUtils.read(tx, oper, flowPath);
if (opt.isPresent()) {
Flow flow = opt.get();
if (targetFlow.equalsFlow(flow) &&
cookieMatcher.match(flow)) {
// Delete the target flow entry.
tx.delete(oper, flowPath);
removedFlow = flow.getId().getValue();
}
}
}
代码示例来源:origin: org.opendaylight.nic/of-renderer
/**
* To remove redirect flows in the given nodes.
* @param nodeId : nodeId
* @param intent : intent
*/
private void removeRedirectFlow(NodeId nodeId, Intent intent) {
List<Flow> flowList = getFlowList(nodeId);
List<String> endPointGroups = IntentUtils.extractEndPointGroup(intent);
String endPointGroupsFroward = createRedirectFlowName(endPointGroups);
Collections.reverse(endPointGroups);
String endPointGroupsReverse = createRedirectFlowName(endPointGroups);
for (Flow flow : flowList) {
String flowId = flow.getId().toString();
if (flowId.contains(endPointGroupsFroward) || flowId.contains(endPointGroupsReverse)) {
deleteFlow(nodeId, flow);
}
}
}
代码示例来源:origin: org.opendaylight.groupbasedpolicy/ofoverlay-renderer
private static InstanceIdentifier<Flow> createFlowIid(Flow flow, InstanceIdentifier<Node> nodeIid) {
return nodeIid.builder()
.augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flow.getTableId()))
.child(Flow.class, new FlowKey(flow.getId()))
.build();
}
代码示例来源:origin: org.opendaylight.netvirt/openstack.net-virt-providers
private static InstanceIdentifier<Flow> createFlowIid(Flow flow, InstanceIdentifier<Node> nodeIid) {
return nodeIid.builder()
.augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flow.getTableId()))
.child(Flow.class, new FlowKey(flow.getId()))
.build();
}
代码示例来源:origin: org.opendaylight.alto.ext/alto-spce-impl
private InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow> getFlowInstanceIdentifier(NodeRef nodeRef, Flow flow) {
return ((InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node>) nodeRef.getValue())
.augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(DEFAULT_TABLE_ID))
.child(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow.class,
new FlowKey(new FlowId(flow.getId())));
}
代码示例来源:origin: org.opendaylight.openflowplugin.legacy/sal-compatibility
private static final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow> flowPath(
final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow flow, final NodeKey nodeKey) {
return InstanceIdentifier.builder(Nodes.class)
.child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, nodeKey)
.augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flow.getTableId()))
.child(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow.class, new FlowKey(flow.getId()))
.toInstance();
}
代码示例来源:origin: org.opendaylight.lacp.main/lacp.main.impl
builder.setFlowRef(new FlowRef(lacpFId));
builder.setFlowTable(new FlowTableRef(tableId));
builder.setTransactionUri(new Uri(lacpFlow.getId().getValue()));
Future<RpcResult<RemoveFlowOutput>> result = salFlow.removeFlow(builder.build());
try
代码示例来源:origin: org.opendaylight.l2switch.arphandler/arphandler-impl
private Future<RpcResult<AddFlowOutput>> writeFlowToController(InstanceIdentifier<Node> nodeInstanceId,
InstanceIdentifier<Table> tableInstanceId,
InstanceIdentifier<Flow> flowPath,
Flow flow) {
LOG.trace("Adding flow to node {}",nodeInstanceId.firstKeyOf(Node.class, NodeKey.class).getId().getValue());
final AddFlowInputBuilder builder = new AddFlowInputBuilder(flow);
builder.setNode(new NodeRef(nodeInstanceId));
builder.setFlowRef(new FlowRef(flowPath));
builder.setFlowTable(new FlowTableRef(tableInstanceId));
builder.setTransactionUri(new Uri(flow.getId().getValue()));
return salFlowService.addFlow(builder.build());
}
}
代码示例来源:origin: org.opendaylight.l2switch.main/main-impl
private Future<RpcResult<AddFlowOutput>> writeFlowToController(InstanceIdentifier<Node> nodeInstanceId,
InstanceIdentifier<Table> tableInstanceId,
InstanceIdentifier<Flow> flowPath,
Flow flow) {
LOG.trace("Adding flow to node {}",nodeInstanceId.firstKeyOf(Node.class, NodeKey.class).getId().getValue());
final AddFlowInputBuilder builder = new AddFlowInputBuilder(flow);
builder.setNode(new NodeRef(nodeInstanceId));
builder.setFlowRef(new FlowRef(flowPath));
builder.setFlowTable(new FlowTableRef(tableInstanceId));
builder.setTransactionUri(new Uri(flow.getId().getValue()));
return salFlowService.addFlow(builder.build());
}
}
代码示例来源:origin: org.opendaylight.vpnservice/mdsalutil-impl
public CheckedFuture<Void,TransactionCommitFailedException> removeFlowNew(BigInteger dpnId, Flow flowEntity) {
s_logger.debug("Remove flow {}",flowEntity);
Node nodeDpn = buildDpnNode(dpnId);
FlowKey flowKey = new FlowKey(new FlowId(flowEntity.getId()));
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();
WriteTransaction modification = m_dataBroker.newWriteOnlyTransaction();
modification.delete(LogicalDatastoreType.CONFIGURATION,flowInstanceId );
return modification.submit();
}
代码示例来源:origin: org.opendaylight.nic/of-renderer
/**
* To delete the flows in the configuration DS
* @param nodeId : nodeId
* @param flow : flow
*/
private void deleteFlow(NodeId nodeId, Flow flow) {
InstanceIdentifier<Flow> deleteFLow = InstanceIdentifier
.builder(Nodes.class)
.child(Node.class, new NodeKey(nodeId))
.augmentation(FlowCapableNode.class)
.child(Table.class,
new TableKey(OFRendererConstants.FALLBACK_TABLE_ID))
.child(Flow.class, new FlowKey(flow.getId()))
.build();
mdsal.delete(LogicalDatastoreType.CONFIGURATION, deleteFLow);
}
代码示例来源:origin: org.opendaylight.nic/of-renderer
for (Flow flow : flows) {
String flowId = null;
flowId = flow.getId().getValue().toString();
if (flowId.contains(logFlowId)) {
return flowId;
代码示例来源:origin: org.opendaylight.l2switch.arphandler/arphandler-impl
/**
* Starts and commits data change transaction which modifies provided
* flow path with supplied body.
*/
private Future<RpcResult<AddFlowOutput>> writeFlowToSwitch(NodeId nodeId, Flow flow) {
InstanceIdentifier<Node> nodeInstanceId = InstanceIdentifier.<Nodes>builder(Nodes.class)
.<Node, NodeKey>child(Node.class, new NodeKey(nodeId)).build();
InstanceIdentifier<Table> tableInstanceId = nodeInstanceId
.<FlowCapableNode>augmentation(FlowCapableNode.class)
.<Table, TableKey>child(Table.class, new TableKey(flowTableId));
InstanceIdentifier<Flow> flowPath = tableInstanceId.<Flow, FlowKey>child(Flow.class,
new FlowKey(new FlowId(String.valueOf(flowIdInc.getAndIncrement()))));
final AddFlowInputBuilder builder = new AddFlowInputBuilder(flow).setNode(new NodeRef(nodeInstanceId))
.setFlowTable(new FlowTableRef(tableInstanceId)).setFlowRef(new FlowRef(flowPath))
.setTransactionUri(new Uri(flow.getId().getValue()));
return salFlowService.addFlow(builder.build());
}
}
代码示例来源:origin: org.opendaylight.vpnservice/mdsalutil-impl
public CheckedFuture<Void,TransactionCommitFailedException> installFlow(BigInteger dpId, Flow flow) {
FlowKey flowKey = new FlowKey( new FlowId(flow.getId()) );
Node nodeDpn = 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();
WriteTransaction modification = m_dataBroker.newWriteOnlyTransaction();
modification.put(LogicalDatastoreType.CONFIGURATION, flowInstanceId, flow, true);
return modification.submit();
}
代码示例来源:origin: org.opendaylight.l2switch.main/main-impl
/**
* Starts and commits data change transaction which modifies provided flow
* path with supplied body.
*
* @param flowPath
* @param flow
* @return transaction commit
*/
private Future<RpcResult<AddFlowOutput>> writeFlowToConfigData(InstanceIdentifier<Flow> flowPath, Flow flow) {
final InstanceIdentifier<Table> tableInstanceId = flowPath.<Table>firstIdentifierOf(Table.class);
final InstanceIdentifier<Node> nodeInstanceId = flowPath.<Node>firstIdentifierOf(Node.class);
final AddFlowInputBuilder builder = new AddFlowInputBuilder(flow);
builder.setNode(new NodeRef(nodeInstanceId));
builder.setFlowRef(new FlowRef(flowPath));
builder.setFlowTable(new FlowTableRef(tableInstanceId));
builder.setTransactionUri(new Uri(flow.getId().getValue()));
return salFlowService.addFlow(builder.build());
}
}
内容来源于网络,如有侵权,请联系作者删除!