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;
16 * @deprecated To be removed with {@link ShardedDOMDataTree}.
19 final class ShardRegistration<T extends DOMDataTreeShard> extends AbstractListenerRegistration<T> {
20 private final DOMDataTreeIdentifier prefix;
21 private final ShardedDOMDataTree tree;
23 protected ShardRegistration(final ShardedDOMDataTree tree, final DOMDataTreeIdentifier prefix, final T shard) {
25 this.tree = Preconditions.checkNotNull(tree);
26 this.prefix = Preconditions.checkNotNull(prefix);
29 DOMDataTreeIdentifier getPrefix() {
34 protected void removeRegistration() {
35 tree.removeShard(this);