Madan Jampani | 2546111 | 2015-02-17 14:17:29 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 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 | |
Madan Jampani | 393e0f0 | 2015-02-12 07:35:39 +0530 | [diff] [blame] | 17 | package org.onosproject.store.service; |
| 18 | |
| 19 | /** |
| 20 | * Storage service. |
| 21 | * <p> |
| 22 | * This service provides operations for creating key-value stores. |
| 23 | * One can chose to create key-value stores with varying properties such |
| 24 | * as strongly consistent vs eventually consistent, durable vs volatile. |
| 25 | * <p> |
| 26 | * Various store implementations should leverage the data structures provided |
| 27 | * by this service |
| 28 | */ |
| 29 | public interface StorageService { |
| 30 | |
| 31 | /** |
Madan Jampani | 6468955 | 2015-02-17 10:00:27 -0800 | [diff] [blame] | 32 | * Creates a new transaction context. |
Jonathan Hart | 6ec029a | 2015-03-24 17:12:35 -0700 | [diff] [blame] | 33 | * |
Madan Jampani | 6468955 | 2015-02-17 10:00:27 -0800 | [diff] [blame] | 34 | * @return transaction context |
| 35 | */ |
| 36 | TransactionContext createTransactionContext(); |
Jonathan Hart | 6ec029a | 2015-03-24 17:12:35 -0700 | [diff] [blame] | 37 | |
| 38 | /** |
| 39 | * Creates a new EventuallyConsistentMapBuilder. |
| 40 | * |
| 41 | * @param <K> key type |
| 42 | * @param <V> value type |
| 43 | * @return builder for an eventually consistent map |
| 44 | */ |
| 45 | <K, V> EventuallyConsistentMapBuilder<K, V> eventuallyConsistentMapBuilder(); |
| 46 | |
Madan Jampani | f1b8e17 | 2015-03-23 11:42:02 -0700 | [diff] [blame] | 47 | /** |
| 48 | * Creates a new EventuallyConsistentMapBuilder. |
| 49 | * |
| 50 | * @param <K> key type |
| 51 | * @param <V> value type |
| 52 | * @return builder for an eventually consistent map |
| 53 | */ |
| 54 | <K, V> ConsistentMapBuilder<K, V> consistentMapBuilder(); |
Madan Jampani | 08706ce | 2015-04-01 14:49:28 -0700 | [diff] [blame] | 55 | |
| 56 | /** |
| 57 | * Creates a new distributed set builder. |
| 58 | * |
| 59 | * @param <E> set element type |
| 60 | * @return builder for an distributed set |
| 61 | */ |
| 62 | <E> SetBuilder<E> setBuilder(); |
Madan Jampani | f1b8e17 | 2015-03-23 11:42:02 -0700 | [diff] [blame] | 63 | } |