BUG-7407: Introduce API to request shard leader movement
[controller.git] / opendaylight / md-sal / cds-dom-api / src / main / java / org / opendaylight / controller / cluster / dom / api / CDSDataTreeProducer.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.dom.api;
9
10 import com.google.common.annotations.Beta;
11 import javax.annotation.Nonnull;
12 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
13 import org.opendaylight.mdsal.dom.api.DOMDataTreeProducer;
14
15 /**
16  * An extension to {@link DOMDataTreeProducer}, which allows users access
17  * to information about the backing shard.
18  *
19  * @author Robert Varga
20  */
21 @Beta
22 public interface CDSDataTreeProducer extends DOMDataTreeProducer {
23     /**
24      * Return a {@link CDSShardAccess} handle. This handle will remain valid
25      * as long as this producer is operational. Returned handle can be accessed
26      * independently from this producer and is not subject to the usual access
27      * restrictions imposed on DOMDataTreeProducer state.
28      *
29      * @param subtree One of the subtrees to which are currently under control of this producer
30      * @return A shard access handle.
31      * @throws NullPointerException when subtree is null
32      * @throws IllegalArgumentException if the specified subtree is not controlled by this producer
33      * @throws IllegalStateException if this producer is no longer operational
34      * @throws IllegalThreadStateException if the access rules to this producer
35      *         are violated, for example if this producer is bound and this thread
36      *         is currently not executing from a listener context.
37      */
38     @Nonnull CDSShardAccess getShardAccess(@Nonnull DOMDataTreeIdentifier subtree);
39 }
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.