Jian Li | 7564231 | 2017-01-19 14:23:05 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-present 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 | */ |
| 16 | package org.onosproject.mapping.impl; |
| 17 | |
Jian Li | 9291959 | 2017-02-27 17:10:47 +0900 | [diff] [blame] | 18 | import org.apache.felix.scr.annotations.Activate; |
| 19 | import org.apache.felix.scr.annotations.Component; |
| 20 | import org.apache.felix.scr.annotations.Deactivate; |
| 21 | import org.apache.felix.scr.annotations.Service; |
| 22 | import org.onosproject.mapping.Mapping; |
| 23 | import org.onosproject.mapping.MappingEvent; |
| 24 | import org.onosproject.mapping.MappingEntry; |
Jian Li | 7564231 | 2017-01-19 14:23:05 -0800 | [diff] [blame] | 25 | import org.onosproject.mapping.MappingStore; |
Jian Li | 95edb59 | 2017-01-29 08:42:07 +0900 | [diff] [blame] | 26 | import org.onosproject.mapping.MappingStoreDelegate; |
Jian Li | 9291959 | 2017-02-27 17:10:47 +0900 | [diff] [blame] | 27 | import org.onosproject.net.DeviceId; |
| 28 | import org.onosproject.store.AbstractStore; |
| 29 | import org.osgi.service.component.ComponentContext; |
| 30 | import org.slf4j.Logger; |
| 31 | |
| 32 | import static org.slf4j.LoggerFactory.getLogger; |
Jian Li | 7564231 | 2017-01-19 14:23:05 -0800 | [diff] [blame] | 33 | |
| 34 | /** |
| 35 | * Implementation of a distributed store for managing mapping information. |
| 36 | */ |
Jian Li | 9291959 | 2017-02-27 17:10:47 +0900 | [diff] [blame] | 37 | @Component(immediate = true) |
| 38 | @Service |
| 39 | public class DistributedMappingStore |
| 40 | extends AbstractStore<MappingEvent, MappingStoreDelegate> |
| 41 | implements MappingStore { |
| 42 | |
| 43 | private final Logger log = getLogger(getClass()); |
| 44 | |
| 45 | @Activate |
| 46 | public void activate(ComponentContext context) { |
| 47 | log.info("Started"); |
| 48 | } |
| 49 | |
| 50 | @Deactivate |
| 51 | public void deactivate(ComponentContext context) { |
| 52 | log.info("Stopped"); |
| 53 | } |
| 54 | |
Jian Li | 95edb59 | 2017-01-29 08:42:07 +0900 | [diff] [blame] | 55 | @Override |
| 56 | public void setDelegate(MappingStoreDelegate delegate) { |
| 57 | |
| 58 | } |
| 59 | |
| 60 | @Override |
| 61 | public void unsetDelegate(MappingStoreDelegate delegate) { |
| 62 | |
| 63 | } |
| 64 | |
| 65 | @Override |
| 66 | public boolean hasDelegate() { |
| 67 | return false; |
| 68 | } |
Jian Li | 9291959 | 2017-02-27 17:10:47 +0900 | [diff] [blame] | 69 | |
| 70 | @Override |
| 71 | public int getMappingCount(Type type) { |
| 72 | return 0; |
| 73 | } |
| 74 | |
| 75 | @Override |
| 76 | public MappingEntry getMappingEntry(Type type, Mapping mapping) { |
| 77 | return null; |
| 78 | } |
| 79 | |
| 80 | @Override |
| 81 | public Iterable<MappingEntry> getMappingEntries(Type type, DeviceId deviceId) { |
| 82 | return null; |
| 83 | } |
| 84 | |
| 85 | @Override |
| 86 | public void deleteMapping(Type type, Mapping mapping) { |
| 87 | |
| 88 | } |
| 89 | |
| 90 | @Override |
| 91 | public MappingEvent addOrUpdateMappingEntry(Type type, MappingEntry entry) { |
| 92 | return null; |
| 93 | } |
| 94 | |
| 95 | @Override |
| 96 | public MappingEvent removeMappingEntry(Type type, MappingEntry entry) { |
| 97 | return null; |
| 98 | } |
| 99 | |
| 100 | @Override |
| 101 | public MappingEvent pendingMappingEntry(Type type, MappingEntry entry) { |
| 102 | return null; |
| 103 | } |
| 104 | |
| 105 | @Override |
| 106 | public void purgeMappingEntries(Type type) { |
| 107 | |
| 108 | } |
Jian Li | 7564231 | 2017-01-19 14:23:05 -0800 | [diff] [blame] | 109 | } |