Deprecate DOMDataTreeProducer-related classes
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / sharding / DistributedShardFactory.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.cluster.sharding;
9
10 import com.google.common.annotations.Beta;
11 import java.util.Collection;
12 import java.util.concurrent.CompletionStage;
13 import org.opendaylight.controller.cluster.access.concepts.MemberName;
14 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
15 import org.opendaylight.mdsal.dom.api.DOMDataTreeShardingConflictException;
16
17 /**
18  * A factory that handles addition of new clustered shard's based on a prefix. This factory is a QoL class that handles
19  * all the boilerplate that comes with registration of a new clustered shard into the system and creating the backend
20  * shard/replicas that come along with it.
21  */
22 @Beta
23 @Deprecated(forRemoval = true)
24 public interface DistributedShardFactory {
25     /**
26      * Register a new shard that is rooted at the desired prefix with replicas on the provided members.
27      * Note to register a shard without replicas you still need to provide at least one Member for the shard.
28      *
29      * @param prefix         Shard root
30      * @param replicaMembers Members that this shard is replicated on, has to have at least one Member even if the shard
31      *                       should not be replicated.
32      * @return A future that will be completed with a DistributedShardRegistration once the backend and frontend shards
33      *         are spawned.
34      * @throws DOMDataTreeShardingConflictException If the initial check for a conflict on the local node fails, the
35      *         sharding configuration won't be updated if this exception is thrown.
36      */
37     CompletionStage<DistributedShardRegistration>
38         createDistributedShard(DOMDataTreeIdentifier prefix, Collection<MemberName> replicaMembers)
39             throws DOMDataTreeShardingConflictException;
40 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.