本文整理匯總了Java中org.opendaylight.controller.samples.simpleforwarding.HostNodePair.getNode方法的典型用法代碼示例。如果您正苦於以下問題:Java HostNodePair.getNode方法的具體用法?Java HostNodePair.getNode怎麽用?Java HostNodePair.getNode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.opendaylight.controller.samples.simpleforwarding.HostNodePair
的用法示例。
在下文中一共展示了HostNodePair.getNode方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: uninstallPerNodeRules
import org.opendaylight.controller.samples.simpleforwarding.HostNodePair; //導入方法依賴的package包/類
/**
* Cleanup all the host rules for a given node, triggered when the
* switch disconnects, so there is no reason for Hw cleanup
* because it's disconnected anyhow
* TBD - Revisit above stmt in light of CSCus88743
* @param targetNode Node for which we want to do cleanup
*
*/
private void uninstallPerNodeRules(Node targetNode) {
//RulesProgrammingReturnCode retCode = RulesProgrammingReturnCode.SUCCESS;
Map<NodeConnector, FlowEntry> pos;
FlowEntry po;
// Now program every single switch
for (HostNodePair key : this.rulesDB.keySet()) {
Node node = key.getNode();
if (targetNode == null || node.equals(targetNode)) {
log.debug("Work on {} host {}", node, key.getHost());
pos = this.rulesDB.get(key);
for (Map.Entry<NodeConnector, FlowEntry> e : pos.entrySet()) {
po = e.getValue();
if (po != null) {
// Uninstall the policy
this.frm.uninstallFlowEntry(po);
}
}
log.debug("Remove {}", key);
this.rulesDB.remove(key);
}
}
}