2 * Copyright (c) 2016 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.spi.shard;
10 import static java.util.Objects.requireNonNull;
12 import com.google.common.annotations.Beta;
13 import java.util.ArrayList;
14 import java.util.Collection;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
17 import org.opendaylight.yangtools.concepts.Mutable;
20 * Specification of subshard producer context that's used for building modification factories that span into the
21 * subshards. This class is not thread-safe.
25 public final class SubshardProducerSpecification implements Mutable {
26 private final Collection<DOMDataTreeIdentifier> prefixes = new ArrayList<>(1);
27 private final ChildShardContext shard;
29 public SubshardProducerSpecification(final ChildShardContext subshard) {
30 this.shard = requireNonNull(subshard);
33 public void addPrefix(final DOMDataTreeIdentifier prefix) {
37 public DOMDataTreeShardProducer createProducer() {
38 return shard.getShard().createProducer(prefixes);
41 public DOMDataTreeIdentifier getPrefix() {
42 return shard.getPrefix();