本文整理汇总了Java中net.floodlightcontroller.core.internal.OFChannelState.HandshakeState.FEATURES_REPLY属性的典型用法代码示例。如果您正苦于以下问题:Java HandshakeState.FEATURES_REPLY属性的具体用法?Java HandshakeState.FEATURES_REPLY怎么用?Java HandshakeState.FEATURES_REPLY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.floodlightcontroller.core.internal.OFChannelState.HandshakeState
的用法示例。
在下文中一共展示了HandshakeState.FEATURES_REPLY属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkSwitchReady
protected void checkSwitchReady() {
if (state.hsState == HandshakeState.FEATURES_REPLY &&
state.hasDescription && state.hasGetConfigReply) {
state.hsState = HandshakeState.READY;
synchronized(roleChanger) {
// We need to keep track of all of the switches that are connected
// to the controller, in any role, so that we can later send the
// role request messages when the controller role changes.
// We need to be synchronized while doing this: we must not
// send a another role request to the connectedSwitches until
// we were able to add this new switch to connectedSwitches
// *and* send the current role to the new switch.
connectedSwitches.add(sw);
if (role != null) {
// Send a role request if role support is enabled for the controller
// This is a probe that we'll use to determine if the switch
// actually supports the role request message. If it does we'll
// get back a role reply message. If it doesn't we'll get back an
// OFError message.
// If role is MASTER we will promote switch to active
// list when we receive the switch's role reply messages
log.debug("This controller's role is {}, " +
"sending initial role request msg to {}",
role, sw);
Collection<OFSwitchImpl> swList = new ArrayList<OFSwitchImpl>(1);
swList.add(sw);
roleChanger.submitRequest(swList, role);
}
else {
// Role supported not enabled on controller (for now)
// automatically promote switch to active state.
log.debug("This controller's role is null, " +
"not sending role request msg to {}",
role, sw);
// Need to clear FlowMods before we add the switch
// and dispatch updates otherwise we have a race condition.
sw.clearAllFlowMods();
addSwitch(sw);
state.firstRoleReplyReceived = true;
}
}
}
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:46,代码来源:Controller.java
示例2: checkSwitchReady
protected void checkSwitchReady() {
if (!state.switchBindingDone) {
bindSwitchToDriver();
}
if (state.hsState == HandshakeState.FEATURES_REPLY &&
state.switchBindingDone) {
state.hsState = HandshakeState.READY;
// replay queued port status messages
for (OFMessage m : state.queuedOFMessages) {
try {
processOFMessage(m);
} catch (Exception e) {
log.error("Failed to process delayed OFMessage {} {}",
m, e.getCause());
}
}
state.queuedOFMessages.clear();
synchronized(roleChanger) {
// We need to keep track of all of the switches that are connected
// to the controller, in any role, so that we can later send the
// role request messages when the controller role changes.
// We need to be synchronized while doing this: we must not
// send a another role request to the connectedSwitches until
// we were able to add this new switch to connectedSwitches
// *and* send the current role to the new switch.
connectedSwitches.add(sw);
// Send a role request.
// This is a probe that we'll use to determine if the switch
// actually supports the role request message. If it does we'll
// get back a role reply message. If it doesn't we'll get back an
// OFError message.
// If role is MASTER we will promote switch to active
// list when we receive the switch's role reply messages
if (log.isDebugEnabled())
log.debug("This controller's role is {}, " +
"sending initial role request msg to {}",
role, sw);
Collection<IOFSwitch> swList = new ArrayList<IOFSwitch>(1);
swList.add(sw);
roleChanger.submitRequest(swList, role);
}
}
}