blob: 450c23b4003c5a66d95047dd197bd8f0394ca99d [file] [log] [blame]
Jonathan Hart4f60f982014-10-27 08:11:17 -07001/*
Ray Milkey34c95902015-04-15 09:47:53 -07002 * Copyright 2014-2015 Open Networking Laboratory
Jonathan Hart4f60f982014-10-27 08:11:17 -07003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.net.packet;
Jonathan Hart4f60f982014-10-27 08:11:17 -070017
Brian O'Connorabafb502014-12-02 22:26:20 -080018import org.onosproject.store.Store;
Jonathan Hart4f60f982014-10-27 08:11:17 -070019
alshabib42947782015-03-31 14:59:06 -070020import java.util.Set;
21
Jonathan Hart4f60f982014-10-27 08:11:17 -070022/**
23 * Manages routing of outbound packets.
24 */
25public interface PacketStore extends Store<PacketEvent, PacketStoreDelegate> {
26
27 /**
28 * Decides which instance should emit the packet and forwards the packet to
29 * that instance. The relevant PacketManager is notified via the
30 * PacketStoreDelegate that it should emit the packet.
31 *
32 * @param packet the packet to emit
33 */
34 void emit(OutboundPacket packet);
35
alshabib42947782015-03-31 14:59:06 -070036 /**
37 * Register a request for packets. If the registration
38 * is successful the manager can proceed, otherwise it should
39 * consider these packet already available in the system.
40 *
41 * @param request a packet request
42 * @return a boolean indicating registration state.
43 */
44 boolean requestPackets(PacketRequest request);
45
46 /**
47 * Obtains all existing requests in the system.
48 *
49 * @return a set of packet requests
50 */
51 Set<PacketRequest> existingRequests();
52
Jonathan Hart4f60f982014-10-27 08:11:17 -070053}