import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.opendaylight.controller.sal.core.api.mount.MountInstance;
+import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
import org.opendaylight.controller.sal.rest.impl.RestUtil;
import org.opendaylight.controller.sal.restconf.impl.IdentityValuesDTO.IdentityValue;
import org.opendaylight.controller.sal.restconf.impl.IdentityValuesDTO.Predicate;
}
public static final Codec<Object, Object> from(final TypeDefinition<?> typeDefinition,
- final MountInstance mountPoint) {
+ final DOMMountPoint mountPoint) {
return new ObjectCodec(typeDefinition, mountPoint);
}
private final TypeDefinition<?> type;
- private ObjectCodec(final TypeDefinition<?> typeDefinition, final MountInstance mountPoint) {
+ private ObjectCodec(final TypeDefinition<?> typeDefinition, final DOMMountPoint mountPoint) {
type = RestUtil.resolveBaseTypeFrom(typeDefinition);
if (type instanceof IdentityrefTypeDefinition) {
identityrefCodec = new IdentityrefCodecImpl(mountPoint);
private final Logger logger = LoggerFactory.getLogger(IdentityrefCodecImpl.class);
- private final MountInstance mountPoint;
+ private final DOMMountPoint mountPoint;
- public IdentityrefCodecImpl(final MountInstance mountPoint) {
+ public IdentityrefCodecImpl(final DOMMountPoint mountPoint) {
this.mountPoint = mountPoint;
}
public static class InstanceIdentifierCodecImpl implements InstanceIdentifierCodec<IdentityValuesDTO> {
private final Logger logger = LoggerFactory.getLogger(InstanceIdentifierCodecImpl.class);
- private final MountInstance mountPoint;
+ private final DOMMountPoint mountPoint;
- public InstanceIdentifierCodecImpl(final MountInstance mountPoint) {
+ public InstanceIdentifierCodecImpl(final DOMMountPoint mountPoint) {
this.mountPoint = mountPoint;
}
for (int i = 0; i < identities.size(); i++) {
IdentityValue identityValue = identities.get(i);
URI validNamespace = resolveValidNamespace(identityValue.getNamespace(), mountPoint);
- DataSchemaNode node = ControllerContext.getInstance().findInstanceDataChildByNameAndNamespace(
+ DataSchemaNode node = ControllerContext.findInstanceDataChildByNameAndNamespace(
parentContainer, identityValue.getValue(), validNamespace);
if (node == null) {
logger.info("'{}' node was not found in {}", identityValue, parentContainer.getChildNodes());
Map<QName, Object> predicatesMap = new HashMap<>();
for (Predicate predicate : identityValue.getPredicates()) {
validNamespace = resolveValidNamespace(predicate.getName().getNamespace(), mountPoint);
- DataSchemaNode listKey = ControllerContext.getInstance()
+ DataSchemaNode listKey = ControllerContext
.findInstanceDataChildByNameAndNamespace(listNode, predicate.getName().getValue(),
validNamespace);
predicatesMap.put(listKey.getQName(), predicate.getValue());
}
result.add(pathArgument);
if (i < identities.size() - 1) { // last element in instance-identifier can be other than
- // DataNodeContainer
+ // DataNodeContainer
if (node instanceof DataNodeContainer) {
parentContainer = (DataNodeContainer) node;
} else {
}
}
- private static Module getModuleByNamespace(final String namespace, final MountInstance mountPoint) {
+ private static Module getModuleByNamespace(final String namespace, final DOMMountPoint mountPoint) {
URI validNamespace = resolveValidNamespace(namespace, mountPoint);
Module module = null;
return module;
}
- private static URI resolveValidNamespace(final String namespace, final MountInstance mountPoint) {
+ private static URI resolveValidNamespace(final String namespace, final DOMMountPoint mountPoint) {
URI validNamespace;
if (mountPoint != null) {
validNamespace = ControllerContext.getInstance().findNamespaceByModuleName(mountPoint, namespace);