本文整理汇总了Java中org.projectfloodlight.openflow.protocol.OFStatsReply.getStatsType方法的典型用法代码示例。如果您正苦于以下问题:Java OFStatsReply.getStatsType方法的具体用法?Java OFStatsReply.getStatsType怎么用?Java OFStatsReply.getStatsType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.projectfloodlight.openflow.protocol.OFStatsReply
的用法示例。
在下文中一共展示了OFStatsReply.getStatsType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processOFMultipartReply
import org.projectfloodlight.openflow.protocol.OFStatsReply; //导入方法依赖的package包/类
private void processOFMultipartReply(OFStatsReply stats) {
log.debug("Received message {} during switch-driver " +
"subhandshake " + "from switch {} ... " +
stats,
getStringId());
if (stats.getStatsType() == OFStatsType.EXPERIMENTER) {
try {
OFExpPortDescReply expPortDescReply = (OFExpPortDescReply) stats;
expPortDes.addAll(expPortDescReply.getEntries());
if (!expPortDescReply.getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
driverHandshakeComplete.set(true);
return;
}
} catch (ClassCastException e) {
log.error("Unexspected Experimenter Multipart message type {} ",
stats.getClass().getName());
}
}
}
示例2: processOFStatsReply
import org.projectfloodlight.openflow.protocol.OFStatsReply; //导入方法依赖的package包/类
@Override
/**
* Accumulate a list of the OFTableFeaturesStatsReply's until there
* are no more remaining. Then, pass the list to the switch for
* parsing and configuration.
*
* The assumption is that the OFMessage dispatcher will call this each
* time, which it does. We don't loop and receive here.
*
* @param m, The potential OFTableFeaturesStatsReply message we want to include
*/
void processOFStatsReply(OFStatsReply m) {
if (m.getStatsType() == OFStatsType.TABLE_FEATURES) {
replies.add((OFTableFeaturesStatsReply) m);
if (!((OFTableFeaturesStatsReply)m).getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
handleTableFeaturesMessage(replies, false);
nextState();
}
} else {
/* should only receive TABLE_FEATURES here */
log.error("Received {} message but expected TABLE_FEATURES.", m.getStatsType().toString());
}
}
示例3: processOFStatsReply
import org.projectfloodlight.openflow.protocol.OFStatsReply; //导入方法依赖的package包/类
@Override
/**
* Accumulate a list of the OFTableFeaturesStatsReply's until there
* are no more remaining. Then, pass the list to the switch for
* parsing and configuration.
*
* The assumption is that the OFMessage dispatcher will call this each
* time, which it does. We don't loop and receive here.
*
* @param m, The potential OFTableFeaturesStatsReply message we want to include
*/
void processOFStatsReply(OFStatsReply m) {
if (m.getStatsType() == OFStatsType.TABLE_FEATURES) {
replies.add((OFTableFeaturesStatsReply) m);
if (!((OFTableFeaturesStatsReply)m).getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
handleTableFeaturesMessage(replies, false);
nextState();
}
} else {
/* should only receive TABLE_FEATURES here */
log.error("Received {} message but expected TABLE_FEATURES.", m.getStatsType().toString());
}
}
示例4: processOFStatisticsReply
import org.projectfloodlight.openflow.protocol.OFStatsReply; //导入方法依赖的package包/类
@Override
void processOFStatisticsReply(OFChannelHandler h, OFStatsReply m)
throws SwitchStateException {
// Read port description
if (m.getStatsType() != OFStatsType.PORT_DESC) {
log.warn("Expecting port description stats but received stats "
+ "type {} from {}. Ignoring ...", m.getStatsType(),
h.channel.getRemoteAddress());
return;
}
if (m.getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
log.debug("Stats reply indicates more stats from sw {} for "
+ "port description",
h.getSwitchInfoString());
h.portDescReplies.add((OFPortDescStatsReply)m);
return;
}
else {
h.portDescReplies.add((OFPortDescStatsReply)m);
}
//h.portDescReply = (OFPortDescStatsReply) m; // temp store
log.info("Received port desc reply for switch at {}",
h.getSwitchInfoString());
try {
h.sendHandshakeSetConfig();
} catch (IOException e) {
log.error("Unable to send setConfig after PortDescReply. "
+ "Error: {}", e.getMessage());
}
h.setState(WAIT_CONFIG_REPLY);
}
示例5: processOFStatsReply
import org.projectfloodlight.openflow.protocol.OFStatsReply; //导入方法依赖的package包/类
void processOFStatsReply(OFStatsReply m) {
switch(m.getStatsType()) {
case PORT_DESC:
processPortDescStatsReply((OFPortDescStatsReply) m);
break;
default:
unhandledMessageReceived(m);
}
}
示例6: processDriverHandshakeMessage
import org.projectfloodlight.openflow.protocol.OFStatsReply; //导入方法依赖的package包/类
@Override
public void processDriverHandshakeMessage(OFMessage m) {
if (!startDriverHandshakeCalled) {
throw new SwitchDriverSubHandshakeNotStarted();
}
if (driverHandshakeComplete.get()) {
throw new SwitchDriverSubHandshakeCompleted(m);
}
switch (m.getType()) {
case BARRIER_REPLY:
log.debug("OPLK ROADM Received barrier response");
break;
case ERROR:
log.error("Switch {} Error {}", getStringId(), m);
break;
case FEATURES_REPLY:
break;
case FLOW_REMOVED:
break;
case GET_ASYNC_REPLY:
break;
case PACKET_IN:
break;
case PORT_STATUS:
processOFPortStatus((OFCircuitPortStatus) m);
break;
case QUEUE_GET_CONFIG_REPLY:
break;
case ROLE_REPLY:
break;
case STATS_REPLY:
OFStatsReply stats = (OFStatsReply) m;
if (stats.getStatsType() == OFStatsType.EXPERIMENTER) {
log.warn("OPLK ROADM : Received multipart (port desc) reply message {}", m);
//OTN Optical extension 1.0 port-desc
createOpticalPortList((OFCircuitPortsReply) m);
driverHandshakeComplete.set(true);
}
break;
default:
log.warn("Received message {} during switch-driver " +
"subhandshake " + "from switch {} ... " +
"Ignoring message", m,
getStringId());
}
}
示例7: processDriverHandshakeMessage
import org.projectfloodlight.openflow.protocol.OFStatsReply; //导入方法依赖的package包/类
@Override
public void processDriverHandshakeMessage(OFMessage m) {
if (!startDriverHandshakeCalled) {
throw new SwitchDriverSubHandshakeNotStarted();
}
if (driverHandshakeComplete.get()) {
throw new SwitchDriverSubHandshakeCompleted(m);
}
switch (m.getType()) {
case BARRIER_REPLY:
if (m.getXid() == barrierXidToWaitFor) {
log.debug("LINC-OE Received barrier response");
}
break;
case ERROR:
log.error("Switch {} Error {}", getStringId(), m);
break;
case FEATURES_REPLY:
break;
case FLOW_REMOVED:
break;
case GET_ASYNC_REPLY:
break;
case PACKET_IN:
break;
case PORT_STATUS:
log.warn("****LINC-OE Port Status {} {}", getStringId(), m);
processOFPortStatus((OFCircuitPortStatus) m);
break;
case QUEUE_GET_CONFIG_REPLY:
break;
case ROLE_REPLY:
break;
case STATS_REPLY:
OFStatsReply stats = (OFStatsReply) m;
if (stats.getStatsType() == OFStatsType.EXPERIMENTER) {
log.warn("LINC-OE : Received stats reply message {}", m);
createOpticalPortList((OFCircuitPortsReply) m);
driverHandshakeComplete.set(true);
}
break;
default:
log.warn("Received message {} during switch-driver " +
"subhandshake " + "from switch {} ... " +
"Ignoring message", m,
getStringId());
}
}