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
9 package org.opendaylight.controller.cluster.datastore.shardstrategy;
11 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
14 * Shard Strategy that resolves a path to a prefix shard name.
16 public class PrefixShardStrategy implements ShardStrategy {
18 public static final String NAME = "prefix";
20 private final String shardName;
21 private final YangInstanceIdentifier prefix;
23 public PrefixShardStrategy(final String shardName,
24 final YangInstanceIdentifier prefix) {
25 this.shardName = shardName != null ? shardName : DefaultShardStrategy.DEFAULT_SHARD;
30 public String findShard(final YangInstanceIdentifier path) {
35 public YangInstanceIdentifier getPrefixForPath(YangInstanceIdentifier path) {