blob: 3f4048075d02d93238289136e5665f511abf9b25 [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 Hart18ad55c2013-11-11 22:49:55 -08007import net.onrc.onos.ofcontroller.proxyarp.IArpEventHandler;
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -07008import net.onrc.onos.ofcontroller.topology.TopologyElement;
Pavlin Radoslavovb7506842013-10-29 17:46:54 -07009import net.onrc.onos.ofcontroller.util.FlowEntry;
10import net.onrc.onos.ofcontroller.util.FlowEntryId;
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070011import net.onrc.onos.ofcontroller.util.FlowId;
12import net.onrc.onos.ofcontroller.util.FlowPath;
13
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -070014/**
15 * Interface for providing Datagrid Service to other modules.
16 */
17public interface IDatagridService extends IFloodlightService {
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070018 /**
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070019 * Register Flow Event Handler Service for receiving Flow-related
Pavlin Radoslavov6b79f2b2013-10-26 21:31:10 -070020 * notifications.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070021 *
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070022 * NOTE: Only a single Flow Event Handler Service can be registered.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070023 *
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070024 * @param flowEventHandlerService the Flow Event Handler Service to register.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070025 */
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070026 void registerFlowEventHandlerService(IFlowEventHandlerService flowEventHandlerService);
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070027
28 /**
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070029 * De-register Flow Event Handler Service for receiving Flow-related
Pavlin Radoslavov6b79f2b2013-10-26 21:31:10 -070030 * notifications.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070031 *
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070032 * NOTE: Only a single Flow Event Handler Service can be registered.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070033 *
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070034 * @param flowEventHandlerService the Flow Event Handler Service to
Pavlin Radoslavov6b79f2b2013-10-26 21:31:10 -070035 * de-register.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070036 */
Pavlin Radoslavov9a859022013-10-30 10:08:24 -070037 void deregisterFlowEventHandlerService(IFlowEventHandlerService flowEventHandlerService);
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070038
39 /**
Jonathan Hart18ad55c2013-11-11 22:49:55 -080040 * Register event handler for ARP events.
41 *
42 * @param arpEventHandler The ARP event handler to register.
43 */
44 public void registerArpEventHandler(IArpEventHandler arpEventHandler);
45
46 /**
47 * De-register event handler service for ARP events.
48 *
49 * @param arpEventHandler The ARP event handler to de-register.
50 */
51 public void deregisterArpEventHandler(IArpEventHandler arpEventHandler);
52
53 /**
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070054 * Get all Flows that are currently in the datagrid.
55 *
56 * @return all Flows that are currently in the datagrid.
57 */
58 Collection<FlowPath> getAllFlows();
59
60 /**
61 * Send a notification that a Flow is added.
62 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070063 * @param flowPath the Flow that is added.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070064 */
65 void notificationSendFlowAdded(FlowPath flowPath);
66
67 /**
68 * Send a notification that a Flow is removed.
69 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070070 * @param flowId the Flow ID of the Flow that is removed.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070071 */
72 void notificationSendFlowRemoved(FlowId flowId);
73
74 /**
75 * Send a notification that a Flow is updated.
76 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070077 * @param flowPath the Flow that is updated.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070078 */
79 void notificationSendFlowUpdated(FlowPath flowPath);
80
81 /**
82 * Send a notification that all Flows are removed.
83 */
84 void notificationSendAllFlowsRemoved();
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -070085
86 /**
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070087 * Get all Flow Entries that are currently in the datagrid.
88 *
89 * @return all Flow Entries that are currently in the datagrid.
90 */
91 Collection<FlowEntry> getAllFlowEntries();
92
93 /**
94 * Send a notification that a FlowEntry is added.
95 *
96 * @param flowEntry the FlowEntry that is added.
97 */
98 void notificationSendFlowEntryAdded(FlowEntry flowEntry);
99
100 /**
101 * Send a notification that a FlowEntry is removed.
102 *
103 * @param flowEntryId the FlowEntry ID of the FlowEntry that is removed.
104 */
105 void notificationSendFlowEntryRemoved(FlowEntryId flowEntryId);
106
107 /**
108 * Send a notification that a FlowEntry is updated.
109 *
110 * @param flowEntry the FlowEntry that is updated.
111 */
112 void notificationSendFlowEntryUpdated(FlowEntry flowEntry);
113
114 /**
115 * Send a notification that all Flow Entries are removed.
116 */
117 void notificationSendAllFlowEntriesRemoved();
118
119 /**
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -0700120 * Get all Topology Elements that are currently in the datagrid.
121 *
122 * @return all Topology Elements that are currently in the datagrid.
123 */
124 Collection<TopologyElement> getAllTopologyElements();
125
126 /**
127 * Send a notification that a Topology Element is added.
128 *
129 * @param topologyElement the Topology Element that is added.
130 */
131 void notificationSendTopologyElementAdded(TopologyElement topologyElement);
132
133 /**
134 * Send a notification that a Topology Element is removed.
135 *
136 * @param topologyElement the Topology Element that is removed.
137 */
138 void notificationSendTopologyElementRemoved(TopologyElement topologyElement);
139
140 /**
141 * Send a notification that a Topology Element is updated.
142 *
143 * @param topologyElement the Topology Element that is updated.
144 */
145 void notificationSendTopologyElementUpdated(TopologyElement topologyElement);
146
147 /**
148 * Send a notification that all Topology Elements are removed.
149 */
150 void notificationSendAllTopologyElementsRemoved();
Jonathan Hart18ad55c2013-11-11 22:49:55 -0800151
152 /**
153 * Send an ARP request to other ONOS instances
154 * @param arpRequest The request packet to send
155 */
156 public void sendArpRequest(byte[] arpRequest);
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -0700157}