import org.opendaylight.controller.sal.restconf.impl.RestconfError.ErrorType;
import org.opendaylight.yangtools.concepts.Codec;
import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.InstanceIdentifierBuilder;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifierWithPredicates;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.InstanceIdentifierBuilder;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
import org.opendaylight.yangtools.yang.model.api.AnyXmlSchemaNode;
import org.opendaylight.yangtools.yang.model.api.ChoiceCaseNode;
import org.opendaylight.yangtools.yang.model.api.ChoiceNode;
ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE);
}
- InstanceIdentifierBuilder builder = InstanceIdentifier.builder();
+ InstanceIdentifierBuilder builder = YangInstanceIdentifier.builder();
Module latestModule = this.getLatestModule(globalSchema, startModule);
InstanceIdWithSchemaNode iiWithSchemaNode = this.collectPathArguments(builder, pathArgs, latestModule, null,
toMountPointIdentifier);
module.getRevision());
}
- public DataNodeContainer getDataNodeContainerFor(final InstanceIdentifier path) {
+ public DataNodeContainer getDataNodeContainerFor(final YangInstanceIdentifier path) {
this.checkPreconditions();
final Iterable<PathArgument> elements = path.getPathArguments();
for (final PathArgument element : elements) {
QName _nodeType = element.getNodeType();
final DataSchemaNode potentialNode = ControllerContext.childByQName(node, _nodeType);
- if (potentialNode == null || !this.isListOrContainer(potentialNode)) {
+ if (potentialNode == null || !ControllerContext.isListOrContainer(potentialNode)) {
return null;
}
node = (DataNodeContainer) potentialNode;
return node;
}
- public String toFullRestconfIdentifier(final InstanceIdentifier path) {
+ public String toFullRestconfIdentifier(final YangInstanceIdentifier path) {
this.checkPreconditions();
final Iterable<PathArgument> elements = path.getPathArguments();
for (final PathArgument element : elements) {
QName _nodeType = element.getNodeType();
final DataSchemaNode potentialNode = ControllerContext.childByQName(node, _nodeType);
- if (!this.isListOrContainer(potentialNode)) {
+ if (!ControllerContext.isListOrContainer(potentialNode)) {
return null;
}
node = ((DataNodeContainer) potentialNode);
ErrorType.APPLICATION, ErrorTag.OPERATION_NOT_SUPPORTED);
}
- final InstanceIdentifier partialPath = builder.toInstance();
+ final YangInstanceIdentifier partialPath = builder.toInstance();
final MountInstance mount = mountService.getMountPoint(partialPath);
if (mount == null) {
LOG.debug("Instance identifier to missing mount point: {}", partialPath);
}
if (returnJustMountPoint) {
- InstanceIdentifier instance = InstanceIdentifier.builder().toInstance();
+ YangInstanceIdentifier instance = YangInstanceIdentifier.builder().toInstance();
return new InstanceIdWithSchemaNode(instance, mountPointSchema, mount);
}
if (strings.size() == 1) {
- InstanceIdentifier instance = InstanceIdentifier.builder().toInstance();
+ YangInstanceIdentifier instance = YangInstanceIdentifier.builder().toInstance();
return new InstanceIdWithSchemaNode(instance, mountPointSchema, mount);
}
}
List<String> subList = strings.subList(1, strings.size());
- return this.collectPathArguments(InstanceIdentifier.builder(), subList, moduleBehindMountPoint, mount,
+ return this.collectPathArguments(YangInstanceIdentifier.builder(), subList, moduleBehindMountPoint, mount,
returnJustMountPoint);
}
targetNode = potentialSchemaNodes.iterator().next();
}
- if (!this.isListOrContainer(targetNode)) {
+ if (!ControllerContext.isListOrContainer(targetNode)) {
throw new RestconfDocumentedException("URI has bad format. Node \"" + head
+ "\" must be Container or List yang type.", ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE);
}