2 * Copyright (c) 2015 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.mdsal.dom.broker;
10 import static java.util.Objects.requireNonNull;
12 import com.google.common.annotations.Beta;
13 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
14 import org.opendaylight.mdsal.dom.api.DOMDataTreeShard;
15 import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
18 public final class DOMDataTreeShardRegistration<T extends DOMDataTreeShard> extends AbstractListenerRegistration<T> {
19 private final DOMDataTreeIdentifier prefix;
20 private final ShardedDOMDataTree tree;
22 public DOMDataTreeShardRegistration(final ShardedDOMDataTree tree, final DOMDataTreeIdentifier prefix,
25 this.tree = requireNonNull(tree);
26 this.prefix = requireNonNull(prefix);
29 public DOMDataTreeIdentifier getPrefix() {
34 protected void removeRegistration() {
35 tree.removeShard(this);