blob: 6a6c09e4a3cd3639e696a66e152adae2a90a3abc [file] [log] [blame]
Madan Jampania090a112016-01-18 16:38:17 -08001/*
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 */
16package org.onosproject.store.service;
17
18import org.onosproject.core.ApplicationId;
19
20/**
21 * Interface for all distributed primitives.
22 */
23public 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.
Jian Lidfba7392016-01-22 16:46:58 -080074 * @return application id
Madan Jampania090a112016-01-18 16:38:17 -080075 */
76 default ApplicationId applicationId() {
77 return null;
78 }
79}