本文整理汇总了Java中org.openflow.protocol.OFMessage.getXid方法的典型用法代码示例。如果您正苦于以下问题:Java OFMessage.getXid方法的具体用法?Java OFMessage.getXid怎么用?Java OFMessage.getXid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openflow.protocol.OFMessage
的用法示例。
在下文中一共展示了OFMessage.getXid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: querySwitchFeaturesReply
import org.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public Future<OFFeaturesReply> querySwitchFeaturesReply()
throws IOException {
OFMessage request =
floodlightProvider.getOFMessageFactory().
getMessage(OFType.FEATURES_REQUEST);
request.setXid(getNextTransactionId());
OFFeaturesReplyFuture future =
new OFFeaturesReplyFuture(threadPool, this, request.getXid());
this.featuresFutureMap.put(request.getXid(), future);
List<OFMessage> msglist = new ArrayList<OFMessage>(1);
msglist.add(request);
this.write(msglist);
return future;
}
示例2: deliverFuture
import org.openflow.protocol.OFMessage; //导入方法依赖的package包/类
public void deliverFuture(IOFSwitch sw, OFMessage msg) {
if (transactionId == msg.getXid()) {
handleReply(sw, msg);
if (isFinished()) {
unRegister();
this.latch.countDown();
}
}
}
示例3: verifyUniqueXids
import org.openflow.protocol.OFMessage; //导入方法依赖的package包/类
/** make sure that the transaction ids in the given messages are
* not 0 and differ between each other.
* While it's not a defect per se if the xids are we want to ensure
* we use different ones for each message we send.
*/
void verifyUniqueXids(List<OFMessage> msgs) {
if (seenXids == null)
seenXids = new HashSet<Integer>();
for (OFMessage m: msgs) {
int xid = m.getXid();
assertTrue("Xid in messags is 0", xid != 0);
assertFalse("Xid " + xid + " has already been used",
seenXids.contains(xid));
seenXids.add(xid);
}
}