Open Kilda Java Documentation
OfPendingMessage.java
Go to the documentation of this file.
1 /* Copyright 2018 Telstra Open Source
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 package org.openkilda.floodlight.service.batch;
17 
18 import org.projectfloodlight.openflow.protocol.OFMessage;
19 import org.projectfloodlight.openflow.types.DatapathId;
20 
21 public class OfPendingMessage {
22  private final DatapathId dpId;
23  private final OFMessage request;
24  private long xid;
25  private OFMessage response = null;
26  private boolean pending = true;
27 
28  public OfPendingMessage(DatapathId dpId, OFMessage request) {
29  this.dpId = dpId;
30  this.request = request;
31  this.xid = request.getXid();
32  }
33 
34  public boolean isPending() {
35  return pending;
36  }
37 
38  public long getXid() {
39  return xid;
40  }
41 
42  public DatapathId getDpId() {
43  return dpId;
44  }
45 
46  public OFMessage getRequest() {
47  return request;
48  }
49 
50  public OFMessage getResponse() {
51  return response;
52  }
53 
54  public void setResponse(OFMessage response) {
55  pending = false;
56  this.response = response;
57  }
58 }
OfPendingMessage(DatapathId dpId, OFMessage request)