blob: e9f3a0206c48c31e27ba0c5050cdc9ec1872e88c [file] [log] [blame]
Madan Jampani619453b2015-07-22 23:47:09 -07001/*
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 */
Ayaka Koshibe3a321562015-04-29 13:24:07 -070016package org.onosproject.store.service;
17
18/**
19 * Interface definition for a transaction context builder.
20 */
21public interface TransactionContextBuilder {
22
23 /**
24 * Disables distribution of map entries across multiple database partitions.
25 * <p>
26 * When partitioning is disabled, the returned map will have a single
27 * partition that spans the entire cluster. Furthermore, the changes made to
28 * the map are ephemeral and do not survive a full cluster restart.
29 * </p>
30 * <p>
31 * Note: By default, partitions are enabled. This feature is intended to
32 * simplify debugging.
33 * </p>
34 *
35 * @return this TransactionalContextBuilder
36 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070037 TransactionContextBuilder withPartitionsDisabled();
Ayaka Koshibe3a321562015-04-29 13:24:07 -070038
39 /**
40 * Builds a TransactionContext based on configuration options supplied to this
41 * builder.
42 *
43 * @return a new TransactionalContext
44 * @throws java.lang.RuntimeException if a mandatory parameter is missing
45 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070046 TransactionContext build();
Ayaka Koshibe3a321562015-04-29 13:24:07 -070047}