blob: fd6231f23821321feda2323489db3370817881da [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
Esin Karaman971fb7f2017-12-28 13:44:52 +000020import org.onlab.util.KryoNamespace;
21import org.onosproject.drivers.bmv2.api.runtime.Bmv2EntityType;
22import org.onosproject.drivers.bmv2.api.runtime.Bmv2PreGroup;
23import org.onosproject.drivers.bmv2.api.runtime.Bmv2PreGroupHandle;
24import org.onosproject.drivers.bmv2.api.runtime.Bmv2PreNode;
25import org.onosproject.drivers.bmv2.api.runtime.Bmv2PreNodes;
26import org.onosproject.store.serializers.KryoNamespaces;
Ray Milkeyd84f89b2018-08-17 14:54:17 -070027import org.osgi.service.component.annotations.Component;
Esin Karaman971fb7f2017-12-28 13:44:52 +000028
29
30/**
31 * Distributed implementation of a BMv2 PRE group mirror.
32 * We need this mirror to preserve BMv2-specific identifiers of group
33 * and nodes for further operations on them after creation.
34 */
Ray Milkeyd84f89b2018-08-17 14:54:17 -070035@Component(immediate = true, service = Bmv2PreGroupMirror.class)
Esin Karaman971fb7f2017-12-28 13:44:52 +000036public class DistributedBmv2PreGroupMirror
37 extends AbstractDistributedBmv2Mirror<Bmv2PreGroupHandle, Bmv2PreGroup>
38 implements Bmv2PreGroupMirror {
39
40 private static final String DIST_MAP_NAME = "onos-bmv2-pre-group-mirror";
41
42 @Override
43 String mapName() {
44 return DIST_MAP_NAME;
45 }
46
47 @Override
48 KryoNamespace storeSerializer() {
49 return KryoNamespace.newBuilder()
50 .register(KryoNamespaces.API)
51 .register(Bmv2EntityType.class)
52 .register(Bmv2PreNode.class)
53 .register(Bmv2PreNodes.class)
54 .register(Bmv2PreGroup.class)
55 .build();
56 }
57}