Ray Milkey | 3595823 | 2015-07-29 11:19:28 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Ray Milkey | 3595823 | 2015-07-29 11:19:28 -0700 | [diff] [blame] | 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.store.service; |
| 17 | |
Ray Milkey | 2eb9167 | 2018-04-24 10:07:52 -0700 | [diff] [blame] | 18 | import org.onosproject.store.primitives.AsyncAtomicCounterAdapter; |
| 19 | |
Ray Milkey | 3595823 | 2015-07-29 11:19:28 -0700 | [diff] [blame] | 20 | public class TestStorageService extends StorageServiceAdapter { |
| 21 | |
| 22 | |
| 23 | @Override |
| 24 | public <K, V> EventuallyConsistentMapBuilder<K, V> eventuallyConsistentMapBuilder() { |
| 25 | return TestEventuallyConsistentMap.builder(); |
| 26 | } |
| 27 | |
| 28 | @Override |
| 29 | public <K, V> ConsistentMapBuilder<K, V> consistentMapBuilder() { |
Ray Milkey | 6f44033 | 2015-07-31 10:40:53 -0700 | [diff] [blame] | 30 | return TestConsistentMap.builder(); |
Ray Milkey | 3595823 | 2015-07-29 11:19:28 -0700 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | @Override |
| 34 | public <E> DistributedSetBuilder<E> setBuilder() { |
Brian Stanke | 81fe238 | 2016-03-03 15:54:32 -0500 | [diff] [blame] | 35 | return TestDistributedSet.builder(); |
Ray Milkey | 3595823 | 2015-07-29 11:19:28 -0700 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | @Override |
Ray Milkey | 3595823 | 2015-07-29 11:19:28 -0700 | [diff] [blame] | 39 | public AtomicCounterBuilder atomicCounterBuilder() { |
Ray Milkey | 2eb9167 | 2018-04-24 10:07:52 -0700 | [diff] [blame] | 40 | return AsyncAtomicCounterAdapter.builder(); |
Ray Milkey | 3595823 | 2015-07-29 11:19:28 -0700 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | @Override |
Jordan Halterman | 5a1053e | 2017-05-19 18:03:47 -0700 | [diff] [blame] | 44 | public AtomicIdGeneratorBuilder atomicIdGeneratorBuilder() { |
| 45 | return TestAtomicIdGenerator.builder(); |
| 46 | } |
| 47 | |
| 48 | @Override |
Ray Milkey | 3595823 | 2015-07-29 11:19:28 -0700 | [diff] [blame] | 49 | public <V> AtomicValueBuilder<V> atomicValueBuilder() { |
Yi Tseng | da70796 | 2020-09-18 11:10:47 -0700 | [diff] [blame] | 50 | return TestAtomicValue.builder(); |
Ray Milkey | 3595823 | 2015-07-29 11:19:28 -0700 | [diff] [blame] | 51 | } |
| 52 | |
| 53 | @Override |
| 54 | public TransactionContextBuilder transactionContextBuilder() { |
| 55 | throw new UnsupportedOperationException("transactionContextBuilder"); |
| 56 | } |
helenyrwu | a1c4115 | 2016-08-18 16:16:14 -0700 | [diff] [blame] | 57 | |
| 58 | @Override |
Jordi Ortiz | 6c84776 | 2017-01-30 17:13:05 +0100 | [diff] [blame] | 59 | public <K, V> ConsistentMultimapBuilder<K, V> consistentMultimapBuilder() { |
| 60 | return TestConsistentMultimap.builder(); |
| 61 | } |
| 62 | |
| 63 | @Override |
helenyrwu | a1c4115 | 2016-08-18 16:16:14 -0700 | [diff] [blame] | 64 | public <T> Topic<T> getTopic(String name, Serializer serializer) { |
| 65 | return new TestTopic(name); |
| 66 | } |
Pier Luigi | f094c61 | 2017-10-14 12:15:02 +0200 | [diff] [blame] | 67 | |
| 68 | @Override |
| 69 | public <K> AtomicCounterMapBuilder<K> atomicCounterMapBuilder() { |
| 70 | return TestAtomicCounterMap.builder(); |
| 71 | } |
Ray Milkey | 3595823 | 2015-07-29 11:19:28 -0700 | [diff] [blame] | 72 | } |