Deprecated controller fine-grained sharding APIs
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / md / sal / dom / broker / impl / ShardRegistration.java
1 /*
2  * Copyright (c) 2015 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.md.sal.dom.broker.impl;
9
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;
14
15 /**
16  * @deprecated To be removed with {@link ShardedDOMDataTree}.
17  */
18 @Deprecated
19 final class ShardRegistration<T extends DOMDataTreeShard> extends AbstractListenerRegistration<T> {
20     private final DOMDataTreeIdentifier prefix;
21     private final ShardedDOMDataTree tree;
22
23     protected ShardRegistration(final ShardedDOMDataTree tree, final DOMDataTreeIdentifier prefix, final T shard) {
24         super(shard);
25         this.tree = Preconditions.checkNotNull(tree);
26         this.prefix = Preconditions.checkNotNull(prefix);
27     }
28
29     DOMDataTreeIdentifier getPrefix() {
30         return prefix;
31     }
32
33     @Override
34     protected void removeRegistration() {
35         tree.removeShard(this);
36     }
37 }

©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.