Esin Karaman | 971fb7f | 2017-12-28 13:44:52 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
| 18 | package org.onosproject.drivers.bmv2.mirror; |
| 19 | |
Esin Karaman | 971fb7f | 2017-12-28 13:44:52 +0000 | [diff] [blame] | 20 | import org.onlab.util.KryoNamespace; |
| 21 | import org.onosproject.drivers.bmv2.api.runtime.Bmv2EntityType; |
| 22 | import org.onosproject.drivers.bmv2.api.runtime.Bmv2PreGroup; |
| 23 | import org.onosproject.drivers.bmv2.api.runtime.Bmv2PreGroupHandle; |
| 24 | import org.onosproject.drivers.bmv2.api.runtime.Bmv2PreNode; |
| 25 | import org.onosproject.drivers.bmv2.api.runtime.Bmv2PreNodes; |
| 26 | import org.onosproject.store.serializers.KryoNamespaces; |
Ray Milkey | d84f89b | 2018-08-17 14:54:17 -0700 | [diff] [blame^] | 27 | import org.osgi.service.component.annotations.Component; |
Esin Karaman | 971fb7f | 2017-12-28 13:44:52 +0000 | [diff] [blame] | 28 | |
| 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 Milkey | d84f89b | 2018-08-17 14:54:17 -0700 | [diff] [blame^] | 35 | @Component(immediate = true, service = Bmv2PreGroupMirror.class) |
Esin Karaman | 971fb7f | 2017-12-28 13:44:52 +0000 | [diff] [blame] | 36 | public 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 | } |