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.controller.md.sal.dom.broker.impl;
10 import com.google.common.base.Preconditions;
11 import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeIdentifier;
12 import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeShard;
13 import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
18 * @deprecated To be removed with {@link ShardedDOMDataTree}.
21 final class ShardRegistration<T extends DOMDataTreeShard> extends AbstractListenerRegistration<T> {
22 private final DOMDataTreeIdentifier prefix;
23 private final ShardedDOMDataTree tree;
25 protected ShardRegistration(final ShardedDOMDataTree tree, final DOMDataTreeIdentifier prefix, final T shard) {
27 this.tree = Preconditions.checkNotNull(tree);
28 this.prefix = Preconditions.checkNotNull(prefix);
31 DOMDataTreeIdentifier getPrefix() {
36 protected void removeRegistration() {
37 tree.removeShard(this);