- InstanceIdentifierContext iiWithData = null;
- CompositeNode value = null;
- if (representsMountPointRootData(payload)) {
- // payload represents mount point data and URI represents path to the mount point
-
- if (endsWithMountPoint(identifier)) {
- throw new RestconfDocumentedException("URI has bad format. URI should be without \""
- + ControllerContext.MOUNT + "\" for POST operation.", ErrorType.PROTOCOL,
- ErrorTag.INVALID_VALUE);
- }
-
- final String completeIdentifier = addMountPointIdentifier(identifier);
- iiWithData = controllerContext.toInstanceIdentifier(completeIdentifier);
-
- value = this.normalizeNode(payload, iiWithData.getSchemaNode(), iiWithData.getMountPoint());
- } else {
- final InstanceIdentifierContext incompleteInstIdWithData = controllerContext
- .toInstanceIdentifier(identifier);
- final DataNodeContainer parentSchema = (DataNodeContainer) incompleteInstIdWithData.getSchemaNode();
- final DOMMountPoint mountPoint = incompleteInstIdWithData.getMountPoint();
- final Module module = findModule(mountPoint, payload);
- if (module == null) {
- throw new RestconfDocumentedException("Module was not found for \"" + payloadNS + "\"",
- ErrorType.PROTOCOL, ErrorTag.UNKNOWN_ELEMENT);
- }
-
- final String payloadName = getName(payload);
- final DataSchemaNode schemaNode = ControllerContext.findInstanceDataChildByNameAndNamespace(
- parentSchema, payloadName, module.getNamespace());
- value = this.normalizeNode(payload, schemaNode, mountPoint);