2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.cluster.dom.api;
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;
16 * An extension to {@link DOMDataTreeProducer}, which allows users access
17 * to information about the backing shard.
19 * @author Robert Varga
22 public interface CDSDataTreeProducer extends DOMDataTreeProducer {
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.
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.
38 @Nonnull CDSShardAccess getShardAccess(@Nonnull DOMDataTreeIdentifier subtree);