本文整理汇总了Java中org.openflow.protocol.OFError.getXid方法的典型用法代码示例。如果您正苦于以下问题:Java OFError.getXid方法的具体用法?Java OFError.getXid怎么用?Java OFError.getXid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openflow.protocol.OFError
的用法示例。
在下文中一共展示了OFError.getXid方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processErrorReply
import org.openflow.protocol.OFError; //导入方法依赖的package包/类
private void processErrorReply(OFError errorMsg) {
OFMessage offendingMsg = errorMsg.getOffendingMsg();
Integer xid;
if (offendingMsg != null) {
xid = offendingMsg.getXid();
} else {
xid = errorMsg.getXid();
}
/*
* the error can be a reply to a synchronous message or to a statistic
* request message
*/
Callable<?> worker = messageWaitingDone.remove(xid);
if (worker == null) {
return;
}
if (worker instanceof SynchronousMessage) {
((SynchronousMessage) worker).wakeup(errorMsg);
} else {
((StatisticsCollector) worker).wakeup(errorMsg);
}
}
示例2: handleErrorMessage
import org.openflow.protocol.OFError; //导入方法依赖的package包/类
private void handleErrorMessage(ISwitch sw, OFError errorMsg) {
Node node = NodeCreator.createOFNode(sw.getId());
OFMessage offendingMsg = errorMsg.getOffendingMsg();
Integer xid;
if (offendingMsg != null) {
xid = offendingMsg.getXid();
} else {
xid = errorMsg.getXid();
}
Long rid = getMessageRid(sw.getId(), xid);
/*
* Null or zero requestId indicates that the error message is meant for
* a sync message. It will be handled by the sync message worker thread.
* Hence we are done here.
*/
if ((rid == null) || (rid == 0)) {
return;
}
/*
* Notifies the caller that error has been reported for a previous flow
* programming request
*/
for (Map.Entry<String, IFlowProgrammerNotifier> containerNotifier : flowProgrammerNotifiers
.entrySet()) {
IFlowProgrammerNotifier notifier = containerNotifier.getValue();
notifier.flowErrorReported(node, rid, errorMsg);
}
}
示例3: deliverError
import org.openflow.protocol.OFError; //导入方法依赖的package包/类
/**
* Called if we receive an error message. If the xid matches the
* pending request we handle it otherwise we ignore it. We also
* set SWITCH_SUPPORTS_NX_ROLE to false.
*
* Note: since we only keep the last pending request we might get
* error messages for earlier role requests that we won't be able
* to handle
* @param xid
* @return true if the error was handled by us, false otherwise
* @throws SwitchStateException if the error was for the pending
* role request but was unexpected
*/
synchronized boolean deliverError(OFError error) {
if (!requestPending)
return false;
if (pendingXid == error.getXid()) {
boolean isBadRequestError =
(error.getErrorType() == OFError.OFErrorType.
OFPET_BAD_REQUEST.getValue());
if (isBadRequestError) {
counters.roleReplyErrorUnsupported.updateCounterWithFlush();
setSwitchRole(pendingRole, RoleRecvStatus.UNSUPPORTED);
} else {
// TODO: Is this the right thing to do if we receive
// some other error besides a bad request error?
// Presumably that means the switch did actually
// understand the role request message, but there
// was some other error from processing the message.
// OF 1.2 specifies a OFPET_ROLE_REQUEST_FAILED
// error code, but it doesn't look like the Nicira
// role request has that. Should check OVS source
// code to see if it's possible for any other errors
// to be returned.
// If we received an error the switch is not
// in the correct role, so we need to disconnect it.
// We could also resend the request but then we need to
// check if there are other pending request in which
// case we shouldn't resend. If we do resend we need
// to make sure that the switch eventually accepts one
// of our requests or disconnect the switch. This feels
// cumbersome.
String msg = String.format("Switch: [%s], State: [%s], "
+ "Unexpected error %s in respone to our "
+ "role request for %s.",
OFChannelHandler.this.getSwitchInfoString(),
OFChannelHandler.this.state.toString(),
getErrorString(error),
pendingRole);
throw new SwitchStateException(msg);
}
return true;
}
return false;
}
示例4: V6Error
import org.openflow.protocol.OFError; //导入方法依赖的package包/类
public V6Error(OFError e) {
this.length = (short)e.getLengthU();
this.errorType = e.getErrorType();
this.errorCode = e.getErrorCode();
this.xid = e.getXid();
}