blob: 9ba8780741d8bd83ee0328ed51bff169bdacf359 [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
Madan Jampanib5d72d52015-04-03 16:53:50 -070019
Madan Jampani393e0f02015-02-12 07:35:39 +053020/**
21 * Storage service.
22 * <p>
23 * This service provides operations for creating key-value stores.
24 * One can chose to create key-value stores with varying properties such
25 * as strongly consistent vs eventually consistent, durable vs volatile.
26 * <p>
27 * Various store implementations should leverage the data structures provided
28 * by this service
29 */
30public interface StorageService {
31
32 /**
Jonathan Hart6ec029a2015-03-24 17:12:35 -070033 * Creates a new EventuallyConsistentMapBuilder.
34 *
35 * @param <K> key type
36 * @param <V> value type
37 * @return builder for an eventually consistent map
38 */
39 <K, V> EventuallyConsistentMapBuilder<K, V> eventuallyConsistentMapBuilder();
40
Madan Jampanif1b8e172015-03-23 11:42:02 -070041 /**
Madan Jampanibff6d8f2015-03-31 16:53:47 -070042 * Creates a new ConsistentMapBuilder.
Madan Jampanif1b8e172015-03-23 11:42:02 -070043 *
44 * @param <K> key type
45 * @param <V> value type
Madan Jampanibff6d8f2015-03-31 16:53:47 -070046 * @return builder for a consistent map
Madan Jampanif1b8e172015-03-23 11:42:02 -070047 */
48 <K, V> ConsistentMapBuilder<K, V> consistentMapBuilder();
Madan Jampani08706ce2015-04-01 14:49:28 -070049
50 /**
51 * Creates a new distributed set builder.
52 *
53 * @param <E> set element type
54 * @return builder for an distributed set
55 */
Madan Jampani50589ac2015-06-08 11:38:46 -070056 <E> DistributedSetBuilder<E> setBuilder();
Madan Jampanibff6d8f2015-03-31 16:53:47 -070057
58 /**
Madan Jampani63c659f2015-06-11 00:52:58 -070059 * Creates a new distributed queue builder.
60 *
61 * @param <E> queue entry type
62 * @return builder for an distributed queue
63 */
64 <E> DistributedQueueBuilder<E> queueBuilder();
65
66 /**
Madan Jampanib5d72d52015-04-03 16:53:50 -070067 * Creates a new AtomicCounterBuilder.
68 *
69 * @return atomic counter builder
70 */
71 AtomicCounterBuilder atomicCounterBuilder();
72
73 /**
Madan Jampani762246d2015-07-21 15:40:59 -070074 * Creates a new AtomicValueBuilder.
75 *
76 * @param <V> atomic value type
77 * @return atomic value builder
78 */
79 <V> AtomicValueBuilder<V> atomicValueBuilder();
80
81 /**
Ayaka Koshibe3a321562015-04-29 13:24:07 -070082 * Creates a new transaction context builder.
Madan Jampanibff6d8f2015-03-31 16:53:47 -070083 *
Ayaka Koshibe3a321562015-04-29 13:24:07 -070084 * @return a builder for a transaction context.
Madan Jampanibff6d8f2015-03-31 16:53:47 -070085 */
Ayaka Koshibe3a321562015-04-29 13:24:07 -070086 TransactionContextBuilder transactionContextBuilder();
Madan Jampanibff6d8f2015-03-31 16:53:47 -070087}