Madan Jampani | 619453b | 2015-07-22 23:47:09 -0700 | [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 | */ |
Ayaka Koshibe | 3a32156 | 2015-04-29 13:24:07 -0700 | [diff] [blame] | 16 | package org.onosproject.store.service; |
| 17 | |
| 18 | /** |
| 19 | * Interface definition for a transaction context builder. |
| 20 | */ |
| 21 | public 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 SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 37 | TransactionContextBuilder withPartitionsDisabled(); |
Ayaka Koshibe | 3a32156 | 2015-04-29 13:24:07 -0700 | [diff] [blame] | 38 | |
| 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 SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 46 | TransactionContext build(); |
Ayaka Koshibe | 3a32156 | 2015-04-29 13:24:07 -0700 | [diff] [blame] | 47 | } |