本文整理汇总了Java中org.openflow.protocol.OFError.OFQueueOpFailedCode.toString方法的典型用法代码示例。如果您正苦于以下问题:Java OFQueueOpFailedCode.toString方法的具体用法?Java OFQueueOpFailedCode.toString怎么用?Java OFQueueOpFailedCode.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openflow.protocol.OFError.OFQueueOpFailedCode
的用法示例。
在下文中一共展示了OFQueueOpFailedCode.toString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOFErrorString
import org.openflow.protocol.OFError.OFQueueOpFailedCode; //导入方法依赖的package包/类
static String getOFErrorString(OFError error) {
// Handle VENDOR extension errors here
if (error.getErrorType() == V6Error.NICIRA_VENDOR_ERRORTYPE) {
V6Error er = new V6Error(error);
byte[] b = error.getError();
ByteBuffer bb = ByteBuffer.allocate(b.length);
bb.put(b);
bb.rewind();
er.readFrom(bb);
return er.toString();
}
// Handle OF1.0 errors here
OFErrorType et = OFErrorType.values()[0xffff & error.getErrorType()];
String errorStr = "Error : " + et.toString();
switch (et) {
case OFPET_HELLO_FAILED:
OFHelloFailedCode hfc = OFHelloFailedCode.values()[0xffff & error
.getErrorCode()];
errorStr += " " + hfc.toString();
break;
case OFPET_BAD_REQUEST:
OFBadRequestCode brc = OFBadRequestCode.values()[0xffff & error
.getErrorCode()];
errorStr += " " + brc.toString();
break;
case OFPET_BAD_ACTION:
OFBadActionCode bac = OFBadActionCode.values()[0xffff & error
.getErrorCode()];
errorStr += " " + bac.toString();
break;
case OFPET_FLOW_MOD_FAILED:
OFFlowModFailedCode fmfc = OFFlowModFailedCode.values()[0xffff & error
.getErrorCode()];
errorStr += " " + fmfc.toString();
break;
case OFPET_PORT_MOD_FAILED:
OFPortModFailedCode pmfc = OFPortModFailedCode.values()[0xffff & error
.getErrorCode()];
errorStr += " " + pmfc.toString();
break;
case OFPET_QUEUE_OP_FAILED:
OFQueueOpFailedCode qofc = OFQueueOpFailedCode.values()[0xffff & error
.getErrorCode()];
errorStr += " " + qofc.toString();
break;
default:
break;
}
return errorStr;
}