blob: 5ea04205c2abb149b1f6947c9c604b1ad2b6d130 [file] [log] [blame]
Madan Jampani25461112015-02-17 14:17:29 -08001/*
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 Jampani393e0f02015-02-12 07:35:39 +053017package 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 */
29public interface StorageService {
30
31 /**
Jonathan Hart6ec029a2015-03-24 17:12:35 -070032 * Creates a new EventuallyConsistentMapBuilder.
33 *
34 * @param <K> key type
35 * @param <V> value type
36 * @return builder for an eventually consistent map
37 */
38 <K, V> EventuallyConsistentMapBuilder<K, V> eventuallyConsistentMapBuilder();
39
Madan Jampanif1b8e172015-03-23 11:42:02 -070040 /**
Madan Jampanibff6d8f2015-03-31 16:53:47 -070041 * Creates a new ConsistentMapBuilder.
Madan Jampanif1b8e172015-03-23 11:42:02 -070042 *
43 * @param <K> key type
44 * @param <V> value type
Madan Jampanibff6d8f2015-03-31 16:53:47 -070045 * @return builder for a consistent map
Madan Jampanif1b8e172015-03-23 11:42:02 -070046 */
47 <K, V> ConsistentMapBuilder<K, V> consistentMapBuilder();
Madan Jampani08706ce2015-04-01 14:49:28 -070048
49 /**
50 * Creates a new distributed set builder.
51 *
52 * @param <E> set element type
53 * @return builder for an distributed set
54 */
55 <E> SetBuilder<E> setBuilder();
Madan Jampanibff6d8f2015-03-31 16:53:47 -070056
57 /**
58 * Creates a new transaction context.
59 *
60 * @return transaction context
61 */
62 TransactionContext createTransactionContext();
63}