blob: 71c22426af3a3bdba073c67bd5618b0dfdc251b5 [file] [log] [blame]
Madan Jampani837a3632016-01-21 16:47:26 -08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Madan Jampani837a3632016-01-21 16:47:26 -08003 *
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.primitives;
17
18import java.util.Set;
19
20import org.onosproject.cluster.NodeId;
21import org.onosproject.cluster.PartitionId;
22import org.onosproject.event.ListenerService;
23
24/**
25 * Service used for accessing information about storage partitions.
26 */
27public interface PartitionService extends ListenerService<PartitionEvent, PartitionEventListener> {
28
29 /**
30 * Returns the total number of partitions.
31 *
32 * @return number of partitions
33 */
34 int getNumberOfPartitions();
35
36 /**
37 * Returns the set of controller nodes configured to be members of a partition.
38 *
39 * @param partitionId partition identifier
40 * @return set of node identifiers
41 */
42 Set<NodeId> getConfiguredMembers(PartitionId partitionId);
43
44 /**
45 * Returns the set of controller nodes that are the current active members of a partition.
46 *
47 * @param partitionId partition identifier
48 * @return set of node identifiers
49 */
50 Set<NodeId> getActiveMembersMembers(PartitionId partitionId);
51
52 /**
53 * Returns the identifiers of all partitions.
54 *
55 * @return set of partition identifiers
56 */
57 Set<PartitionId> getAllPartitionIds();
58
59 /**
60 * Returns a DistributedPrimitiveCreator that can create primitives hosted on a partition.
61 *
62 * @param partitionId partition identifier
63 * @return distributed primitive creator
64 */
65 DistributedPrimitiveCreator getDistributedPrimitiveCreator(PartitionId partitionId);
66}