blob: 3013f5abc8917c9d59f8c01448b9d7f026145f51 [file] [log] [blame]
Naoki Shiota81dbe302013-11-21 15:35:38 -08001package net.onrc.onos.ofcontroller.flowprogrammer;
2
3import java.util.concurrent.TimeUnit;
4
5import org.openflow.protocol.OFBarrierReply;
6import org.openflow.protocol.OFMessage;
7import org.openflow.protocol.OFType;
8
9import net.floodlightcontroller.core.IOFSwitch;
10import net.floodlightcontroller.core.internal.OFMessageFuture;
11import net.floodlightcontroller.threadpool.IThreadPoolService;
12
13public class OFBarrierReplyFuture extends OFMessageFuture<OFBarrierReply> {
14
15 protected volatile boolean finished;
16
17 public OFBarrierReplyFuture(IThreadPoolService tp,
18 IOFSwitch sw, int transactionId) {
19 super(tp, sw, OFType.FEATURES_REPLY, transactionId);
20 init();
21 }
22
23 public OFBarrierReplyFuture(IThreadPoolService tp,
24 IOFSwitch sw, int transactionId, long timeout, TimeUnit unit) {
25 super(tp, sw, OFType.FEATURES_REPLY, transactionId, timeout, unit);
26 init();
27 }
28
29 private void init() {
30 this.finished = false;
31 this.result = null;
32 }
33
34 @Override
35 protected void handleReply(IOFSwitch sw, OFMessage msg) {
36 this.result = (OFBarrierReply) msg;
37 this.finished = true;
38 }
39
40 @Override
41 protected boolean isFinished() {
42 return finished;
43 }
44
45 @Override
46 protected void unRegister() {
47 super.unRegister();
48 }
49}