BUG-2138: DistributedShardListeners support for nested shards
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / sharding / messages / NotifyProducerRemoved.java
1 /*
2  * Copyright (c) 2016 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
9 package org.opendaylight.controller.cluster.sharding.messages;
10
11 import com.google.common.annotations.Beta;
12 import com.google.common.base.Preconditions;
13 import com.google.common.collect.ImmutableList;
14 import java.io.Serializable;
15 import java.util.Collection;
16 import org.opendaylight.controller.cluster.sharding.ShardedDataTreeActor;
17 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
18
19 /**
20  * Message sent to remote {@link ShardedDataTreeActor}'s when attempting
21  * to close a producer. The remote node should attempt to close a producer in the local sharding service and reply
22  * with success/failure based on the attempt result. If the producer doesn't exist on this node report Success.
23  */
24 @Beta
25 public class NotifyProducerRemoved implements Serializable {
26     private static final long serialVersionUID = 1L;
27     private final Collection<DOMDataTreeIdentifier> subtrees;
28
29     public NotifyProducerRemoved(final Collection<DOMDataTreeIdentifier> subtrees) {
30         this.subtrees = ImmutableList.copyOf(Preconditions.checkNotNull(subtrees));
31     }
32
33     public Collection<DOMDataTreeIdentifier> getSubtrees() {
34         return subtrees;
35     }
36 }