Aaron Kruglikov | 92511f2 | 2015-10-12 14:39:04 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Aaron Kruglikov | 92511f2 | 2015-10-12 14:39:04 -0700 | [diff] [blame] | 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 | |
| 17 | package org.onosproject.persistence; |
| 18 | |
| 19 | /** |
| 20 | * Service that allows for the creation of local disk backed map for instance specific values that persist across |
| 21 | * restarts. Empty maps and sets are deleted on shutdown. |
| 22 | */ |
| 23 | public interface PersistenceService { |
| 24 | /** |
| 25 | * A builder for the creation of local persistent maps backed by disk. |
| 26 | * |
| 27 | * @param <K> the type of keys in this map |
| 28 | * @param <V> the type of values in this map |
| 29 | * @return a persistent map builder |
| 30 | */ |
| 31 | <K, V> PersistentMapBuilder<K, V> persistentMapBuilder(); |
| 32 | |
| 33 | /** |
| 34 | * A builder for the creation of local persistent sets backed by disk. |
| 35 | * |
| 36 | * @param <E> the type of the elements |
| 37 | * @return a persistent set builder |
| 38 | */ |
| 39 | <E> PersistentSetBuilder<E> persistentSetBuilder(); |
| 40 | } |