blob: 1aacb8b3adba31ea20cdb5f5162d9aabc1a95b41 [file] [log] [blame]
Jonathan Hart4f60f982014-10-27 08:11:17 -07001/*
2 * Copyright 2014 Open Networking Laboratory
3 *
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 */
16package org.onlab.onos.store.trivial.impl;
17
18import org.apache.felix.scr.annotations.Component;
19import org.apache.felix.scr.annotations.Service;
20import org.onlab.onos.net.packet.OutboundPacket;
21import org.onlab.onos.net.packet.PacketEvent;
22import org.onlab.onos.net.packet.PacketEvent.Type;
23import org.onlab.onos.net.packet.PacketStore;
24import org.onlab.onos.net.packet.PacketStoreDelegate;
25import org.onlab.onos.store.AbstractStore;
26
27/**
28 * Simple single instance implementation of the packet store.
29 */
30@Component(immediate = true)
31@Service
32public class SimplePacketStore
33 extends AbstractStore<PacketEvent, PacketStoreDelegate>
34 implements PacketStore {
35
36 @Override
37 public void emit(OutboundPacket packet) {
38 notifyDelegate(new PacketEvent(Type.EMIT, packet));
39 }
40
41}