Madan Jampani | a090a11 | 2016-01-18 16:38:17 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015-2016 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 | package org.onosproject.store.service; |
| 17 | |
| 18 | import org.onosproject.core.ApplicationId; |
| 19 | |
| 20 | /** |
| 21 | * Interface for all distributed primitives. |
| 22 | */ |
| 23 | public interface DistributedPrimitive { |
| 24 | |
| 25 | /** |
| 26 | * Type of distributed primitive. |
| 27 | */ |
| 28 | public enum Type { |
| 29 | /** |
| 30 | * Map with strong consistency semantics. |
| 31 | */ |
| 32 | CONSISTENT_MAP, |
| 33 | |
| 34 | /** |
| 35 | * Map with eventual consistency semantics. |
| 36 | */ |
| 37 | EVENTUALLY_CONSISTENT_MAP, |
| 38 | |
| 39 | /** |
| 40 | * distributed set. |
| 41 | */ |
| 42 | SET, |
| 43 | |
| 44 | /** |
| 45 | * atomic counter. |
| 46 | */ |
| 47 | COUNTER, |
| 48 | |
| 49 | /** |
| 50 | * Atomic value. |
| 51 | */ |
| 52 | VALUE, |
| 53 | |
| 54 | /** |
| 55 | * Distributed queue. |
| 56 | */ |
| 57 | QUEUE |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Returns the name of this primitive. |
| 62 | * @return name |
| 63 | */ |
| 64 | String name(); |
| 65 | |
| 66 | /** |
| 67 | * Returns the type of primitive. |
| 68 | * @return primitive type |
| 69 | */ |
| 70 | Type type(); |
| 71 | |
| 72 | /** |
| 73 | * Returns the application owning this primitive. |
| 74 | */ |
| 75 | default ApplicationId applicationId() { |
| 76 | return null; |
| 77 | } |
| 78 | } |