blob: 93613410e57563719e0b86eacc893c7fbf3101cf [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);
53
54 /**
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 /**
62 * Send a notification that a Flow is added.
63 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070064 * @param flowPath the Flow that is added.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070065 */
66 void notificationSendFlowAdded(FlowPath flowPath);
67
68 /**
69 * Send a notification that a Flow is removed.
70 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070071 * @param flowId the Flow ID of the Flow that is removed.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070072 */
73 void notificationSendFlowRemoved(FlowId flowId);
74
75 /**
76 * Send a notification that a Flow is updated.
77 *
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070078 * @param flowPath the Flow that is updated.
Pavlin Radoslavov1308dc62013-10-25 15:54:31 -070079 */
80 void notificationSendFlowUpdated(FlowPath flowPath);
81
82 /**
83 * Send a notification that all Flows are removed.
84 */
85 void notificationSendAllFlowsRemoved();
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -070086
87 /**
Pavlin Radoslavovb7506842013-10-29 17:46:54 -070088 * Get all Flow Entries that are currently in the datagrid.
89 *
90 * @return all Flow Entries that are currently in the datagrid.
91 */
92 Collection<FlowEntry> getAllFlowEntries();
93
94 /**
95 * Send a notification that a FlowEntry is added.
96 *
97 * @param flowEntry the FlowEntry that is added.
98 */
99 void notificationSendFlowEntryAdded(FlowEntry flowEntry);
100
101 /**
102 * Send a notification that a FlowEntry is removed.
103 *
104 * @param flowEntryId the FlowEntry ID of the FlowEntry that is removed.
105 */
106 void notificationSendFlowEntryRemoved(FlowEntryId flowEntryId);
107
108 /**
109 * Send a notification that a FlowEntry is updated.
110 *
111 * @param flowEntry the FlowEntry that is updated.
112 */
113 void notificationSendFlowEntryUpdated(FlowEntry flowEntry);
114
115 /**
116 * Send a notification that all Flow Entries are removed.
117 */
118 void notificationSendAllFlowEntriesRemoved();
119
120 /**
Pavlin Radoslavovaaace7f2013-10-25 19:42:00 -0700121 * Get all Topology Elements that are currently in the datagrid.
122 *
123 * @return all Topology Elements that are currently in the datagrid.
124 */
125 Collection<TopologyElement> getAllTopologyElements();
126
127 /**
128 * Send a notification that a Topology Element is added.
129 *
130 * @param topologyElement the Topology Element that is added.
131 */
132 void notificationSendTopologyElementAdded(TopologyElement topologyElement);
133
134 /**
135 * Send a notification that a Topology Element is removed.
136 *
137 * @param topologyElement the Topology Element that is removed.
138 */
139 void notificationSendTopologyElementRemoved(TopologyElement topologyElement);
140
141 /**
142 * Send a notification that a Topology Element is updated.
143 *
144 * @param topologyElement the Topology Element that is updated.
145 */
146 void notificationSendTopologyElementUpdated(TopologyElement topologyElement);
147
148 /**
149 * Send a notification that all Topology Elements are removed.
150 */
151 void notificationSendAllTopologyElementsRemoved();
Jonathan Hart18ad55c2013-11-11 22:49:55 -0800152
153 /**
154 * Send an ARP request to other ONOS instances
155 * @param arpRequest The request packet to send
156 */
Jonathan Hartd3003252013-11-15 09:44:46 -0800157 public void sendArpRequest(ArpMessage arpMessage);
Pavlin Radoslavov1eee2c82013-10-15 02:30:32 -0700158}