- /**
- * This is to be used in the future to register a custom shard strategy
- *
- * @param moduleName
- * @param shardStrategy
- */
- public static void registerShardStrategy(String moduleName, ShardStrategy shardStrategy){
- throw new UnsupportedOperationException("registering a custom shard strategy not supported yet");
- }
+ return shardStrategy;
+ }
+
+
+ private static String getModuleName(YangInstanceIdentifier path) {
+ String namespace = path.getPathArguments().iterator().next().getNodeType().getNamespace().toASCIIString();
+
+ Optional<String> optional =
+ configuration.getModuleNameFromNameSpace(namespace);
+
+ if(!optional.isPresent()){
+ return UNKNOWN_MODULE_NAME;
+ }
+
+ return optional.get();
+ }