@Override public <R extends OFMessage> ListenableFuture<R> writeRequest(OFRequest<R> request) { if (!isConnected()) { return Futures.immediateFailedFuture(new SwitchDisconnectedException(getDatapathId())); } DeliverableListenableFuture<R> future = new DeliverableListenableFuture<R>(); xidDeliverableMap.put(request.getXid(), future); listener.messageWritten(this, request); this.write(request); return future; }
@Override public <R extends OFMessage> ListenableFuture<R> writeRequest(OFRequest<R> request) { RequestAndFuture<R> raf = new RequestAndFuture<>(request); messages.add(request); requests.put(request.getXid(), raf); return raf.getReplyFuture(); }
@Override public <R extends OFMessage> ListenableFuture<R> writeRequest(OFRequest<R> request) { if (!isConnected()) return Futures.immediateFailedFuture(new SwitchDisconnectedException(getDatapathId())); DeliverableListenableFuture<R> future = new DeliverableListenableFuture<R>(); xidDeliverableMap.put(request.getXid(), future); listener.messageWritten(this, request); write(request); return future; }
@Override public <R extends OFMessage> ListenableFuture<R> writeRequest(OFRequest<R> request) { if (!isConnected()) return Futures.immediateFailedFuture(new SwitchDisconnectedException(getDatapathId())); DeliverableListenableFuture<R> future = new DeliverableListenableFuture<R>(); xidDeliverableMap.put(request.getXid(), future); write(request); return future; }
@Override public <R extends OFMessage> ListenableFuture<R> writeRequest(OFRequest<R> request, LogicalOFMessageCategory category) { return getConnection(category).writeRequest(request); }
@Override public <R extends OFMessage> ListenableFuture<R> writeRequest(OFRequest<R> request) { return writeRequest(request, LogicalOFMessageCategory.MAIN); }
@Override public <R extends OFMessage> ListenableFuture<R> writeRequest(OFRequest<R> request) { return Futures.immediateFailedFuture(new SwitchDisconnectedException(getDatapathId())); }
@Override public <R extends OFMessage> ListenableFuture<R> writeRequest( OFRequest<R> request) { // TODO Auto-generated method stub return null; }
@Override public <R extends OFMessage> ListenableFuture<R> writeRequest( OFRequest<R> request, LogicalOFMessageCategory category) { // TODO Auto-generated method stub return null; }
public RequestAndFuture(OFRequest<R> request) { this.request = request; this.replyFuture = SettableFuture.create(); }
public OFRequest<R> getRequest() { return request; }
@Override public <R extends OFMessage> ListenableFuture<R> writeRequest(OFRequest<R> request) { return connections.get(OFAuxId.MAIN).writeRequest(request); }