blob: 034fe2580c2645d6591d5a5720043861e74405e0 [file] [log] [blame]
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -07001package net.onrc.onos.datagrid;
2
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -07003import java.util.Collection;
4
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -07005import net.floodlightcontroller.core.module.IFloodlightService;
Pavlin Radoslavov9a859022013-10-30 10:08:24 -07006import net.onrc.onos.ofcontroller.flowmanager.IFlowEventHandlerService;
Jonathan Hartd3003252013-11-15 09:44:46 -08007import net.onrc.onos.ofcontroller.proxyarp.ArpMessage;
Jonathan Hart18ad55c2013-11-11 22:49:55 -08008import net.onrc.onos.ofcontroller.proxyarp.IArpEventHandler;
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -07009import net.onrc.onos.ofcontroller.topology.TopologyElement;
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070010import net.onrc.onos.ofcontroller.util.FlowEntry;
11import net.onrc.onos.ofcontroller.util.FlowEntryId;
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070012import net.onrc.onos.ofcontroller.util.FlowId;
13import net.onrc.onos.ofcontroller.util.FlowPath;
14
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -070015/**
16 * Interface for providing Datagrid Service to other modules.
17 */
18public interface IDatagridService extends IFloodlightService {
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070019 /**
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070020 * Register Flow Event Handler Service for receiving Flow-related
Pavlin Radoslavov6b79f2b2013-10-26 21:31:10 -070021 * notifications.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070022 *
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070023 * NOTE: Only a single Flow Event Handler Service can be registered.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070024 *
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070025 * @param flowEventHandlerService the Flow Event Handler Service to register.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070026 */
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070027 void registerFlowEventHandlerService(IFlowEventHandlerService flowEventHandlerService);
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070028
29 /**
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070030 * De-register Flow Event Handler Service for receiving Flow-related
Pavlin Radoslavov6b79f2b2013-10-26 21:31:10 -070031 * notifications.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070032 *
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070033 * NOTE: Only a single Flow Event Handler Service can be registered.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070034 *
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070035 * @param flowEventHandlerService the Flow Event Handler Service to
Pavlin Radoslavov6b79f2b2013-10-26 21:31:10 -070036 * de-register.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070037 */
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070038 void deregisterFlowEventHandlerService(IFlowEventHandlerService flowEventHandlerService);
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070039
40 /**
Jonathan Hart18ad55c2013-11-11 22:49:55 -080041 * Register event handler for ARP events.
42 *
43 * @param arpEventHandler The ARP event handler to register.
44 */
45 public void registerArpEventHandler(IArpEventHandler arpEventHandler);
46
47 /**
48 * De-register event handler service for ARP events.
49 *
50 * @param arpEventHandler The ARP event handler to de-register.
51 */
52 public void deregisterArpEventHandler(IArpEventHandler arpEventHandler);
Pavlin Radoslavov379c9042013-11-26 15:40:49 -080053
Jonathan Hart18ad55c2013-11-11 22:49:55 -080054 /**
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070055 * Get all Flows that are currently in the datagrid.
56 *
57 * @return all Flows that are currently in the datagrid.
58 */
59 Collection<FlowPath> getAllFlows();
60
61 /**
Pavlin Radoslavov379c9042013-11-26 15:40:49 -080062 * Get a Flow for a given Flow ID.
63 *
64 * @param flowId the Flow ID of the Flow to get.
65 * @return the Flow if found, otherwise null.
66 */
67 FlowPath getFlow(FlowId flowId);
68
69 /**
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070070 * Send a notification that a Flow is added.
71 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070072 * @param flowPath the Flow that is added.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070073 */
74 void notificationSendFlowAdded(FlowPath flowPath);
75
76 /**
77 * Send a notification that a Flow is removed.
78 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070079 * @param flowId the Flow ID of the Flow that is removed.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070080 */
81 void notificationSendFlowRemoved(FlowId flowId);
82
83 /**
84 * Send a notification that a Flow is updated.
85 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070086 * @param flowPath the Flow that is updated.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070087 */
88 void notificationSendFlowUpdated(FlowPath flowPath);
89
90 /**
91 * Send a notification that all Flows are removed.
92 */
93 void notificationSendAllFlowsRemoved();
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -070094
95 /**
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070096 * Get all Flow Entries that are currently in the datagrid.
97 *
98 * @return all Flow Entries that are currently in the datagrid.
99 */
100 Collection<FlowEntry> getAllFlowEntries();
101
102 /**
Pavlin Radoslavov379c9042013-11-26 15:40:49 -0800103 * Get a Flow Entry for a given Flow Entry ID.
104 *
105 * @param flowEntryId the Flow Entry ID of the Flow Entry to get.
106 * @return the Flow Entry if found, otherwise null.
107 */
108 FlowEntry getFlowEntry(FlowEntryId flowEntryId);
109
110 /**
Pavlin Radoslavovb7506842013-10-29 17:46:54 -0700111 * Send a notification that a FlowEntry is added.
112 *
113 * @param flowEntry the FlowEntry that is added.
114 */
115 void notificationSendFlowEntryAdded(FlowEntry flowEntry);
116
117 /**
118 * Send a notification that a FlowEntry is removed.
119 *
120 * @param flowEntryId the FlowEntry ID of the FlowEntry that is removed.
121 */
122 void notificationSendFlowEntryRemoved(FlowEntryId flowEntryId);
123
124 /**
125 * Send a notification that a FlowEntry is updated.
126 *
127 * @param flowEntry the FlowEntry that is updated.
128 */
129 void notificationSendFlowEntryUpdated(FlowEntry flowEntry);
130
131 /**
132 * Send a notification that all Flow Entries are removed.
133 */
134 void notificationSendAllFlowEntriesRemoved();
135
136 /**
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -0700137 * Get all Topology Elements that are currently in the datagrid.
138 *
139 * @return all Topology Elements that are currently in the datagrid.
140 */
141 Collection<TopologyElement> getAllTopologyElements();
142
143 /**
144 * Send a notification that a Topology Element is added.
145 *
146 * @param topologyElement the Topology Element that is added.
147 */
148 void notificationSendTopologyElementAdded(TopologyElement topologyElement);
149
150 /**
151 * Send a notification that a Topology Element is removed.
152 *
153 * @param topologyElement the Topology Element that is removed.
154 */
155 void notificationSendTopologyElementRemoved(TopologyElement topologyElement);
156
157 /**
158 * Send a notification that a Topology Element is updated.
159 *
160 * @param topologyElement the Topology Element that is updated.
161 */
162 void notificationSendTopologyElementUpdated(TopologyElement topologyElement);
163
164 /**
165 * Send a notification that all Topology Elements are removed.
166 */
167 void notificationSendAllTopologyElementsRemoved();
Jonathan Hart18ad55c2013-11-11 22:49:55 -0800168
169 /**
170 * Send an ARP request to other ONOS instances
171 * @param arpRequest The request packet to send
172 */
Jonathan Hartd3003252013-11-15 09:44:46 -0800173 public void sendArpRequest(ArpMessage arpMessage);
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -0700174}