blob: 17256764e6f273ecd593ce6d437b433c1dae25b0 [file] [log] [blame]
Esin Karaman971fb7f2017-12-28 13:44:52 +00001/*
2 * Copyright 2018-present Open Networking Foundation
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 *
16 */
17
18package org.onosproject.drivers.bmv2.mirror;
19
20import org.apache.felix.scr.annotations.Component;
21import org.apache.felix.scr.annotations.Service;
22import org.onlab.util.KryoNamespace;
23import org.onosproject.drivers.bmv2.api.runtime.Bmv2EntityType;
24import org.onosproject.drivers.bmv2.api.runtime.Bmv2PreGroup;
25import org.onosproject.drivers.bmv2.api.runtime.Bmv2PreGroupHandle;
26import org.onosproject.drivers.bmv2.api.runtime.Bmv2PreNode;
27import org.onosproject.drivers.bmv2.api.runtime.Bmv2PreNodes;
28import org.onosproject.store.serializers.KryoNamespaces;
29
30
31/**
32 * Distributed implementation of a BMv2 PRE group mirror.
33 * We need this mirror to preserve BMv2-specific identifiers of group
34 * and nodes for further operations on them after creation.
35 */
36@Component(immediate = true)
37@Service
38public class DistributedBmv2PreGroupMirror
39 extends AbstractDistributedBmv2Mirror<Bmv2PreGroupHandle, Bmv2PreGroup>
40 implements Bmv2PreGroupMirror {
41
42 private static final String DIST_MAP_NAME = "onos-bmv2-pre-group-mirror";
43
44 @Override
45 String mapName() {
46 return DIST_MAP_NAME;
47 }
48
49 @Override
50 KryoNamespace storeSerializer() {
51 return KryoNamespace.newBuilder()
52 .register(KryoNamespaces.API)
53 .register(Bmv2EntityType.class)
54 .register(Bmv2PreNode.class)
55 .register(Bmv2PreNodes.class)
56 .register(Bmv2PreGroup.class)
57 .build();
58 }
59}