Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 1 | package net.floodlightcontroller.flowcache; |
| 2 | |
| 3 | import java.util.ArrayList; |
| 4 | |
| 5 | /** |
| 6 | * Object to return flows in response to a query message to BigFlowCache. |
| 7 | * This object is passed in the flowQueryRespHandler() callback. |
| 8 | */ |
| 9 | public class FlowCacheQueryResp { |
| 10 | |
| 11 | /** query object provided by the caller, returned unchanged. */ |
| 12 | public FCQueryObj queryObj; |
| 13 | /** |
| 14 | * Set to true if more flows could be returned for this query in |
| 15 | * additional callbacks. Set of false in the last callback for the |
| 16 | * query. |
| 17 | */ |
| 18 | public boolean moreFlag; |
| 19 | |
| 20 | /** |
| 21 | * Set to true if the response has been sent to handler |
| 22 | */ |
| 23 | public boolean hasSent; |
| 24 | |
| 25 | /** |
| 26 | * The flow list. If there are large number of flows to be returned |
| 27 | * then they may be returned in multiple callbacks. |
| 28 | */ |
| 29 | public ArrayList<QRFlowCacheObj> qrFlowCacheObjList; |
| 30 | |
| 31 | /** |
| 32 | * Instantiates a new big flow cache query response. |
| 33 | * |
| 34 | * @param query the flow cache query object as given by the caller of |
| 35 | * flow cache submit query API. |
| 36 | */ |
| 37 | public FlowCacheQueryResp(FCQueryObj query) { |
| 38 | qrFlowCacheObjList = new ArrayList<QRFlowCacheObj>(); |
| 39 | queryObj = query; |
| 40 | moreFlag = false; |
| 41 | hasSent = false; |
| 42 | } |
| 43 | |
| 44 | /* (non-Javadoc) |
| 45 | * @see java.lang.Object#toString() |
| 46 | */ |
| 47 | @Override |
| 48 | public String toString() { |
| 49 | String s = queryObj.toString() + "; moreFlasg=" + moreFlag + |
| 50 | "; hasSent=" + hasSent; |
| 51 | s += "; FlowCount=" + Integer.toString(qrFlowCacheObjList.size()); |
| 52 | return s; |
| 53 | } |
| 54 | } |