Search in sources :

Example 1 with DeserializationException

use of org.opendaylight.yangtools.yang.data.impl.codec.DeserializationException in project controller by opendaylight.

the class AbstractForwardedDataBroker method toBinding.

protected Set<InstanceIdentifier<?>> toBinding(final InstanceIdentifier<?> path, final Set<YangInstanceIdentifier> normalized) {
    final Set<InstanceIdentifier<?>> hashSet = new HashSet<>();
    for (final YangInstanceIdentifier normalizedPath : normalized) {
        try {
            final Optional<InstanceIdentifier<? extends DataObject>> potential = getCodec().toBinding(normalizedPath);
            if (potential.isPresent()) {
                final InstanceIdentifier<? extends DataObject> binding = potential.get();
                hashSet.add(binding);
            } else if (normalizedPath.getLastPathArgument() instanceof YangInstanceIdentifier.AugmentationIdentifier) {
                hashSet.add(path);
            }
        } catch (final DeserializationException e) {
            LOG.warn("Failed to transform {}, omitting it", normalizedPath, e);
        }
    }
    return hashSet;
}
Also used : DataObject(org.opendaylight.yangtools.yang.binding.DataObject) YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier) DeserializationException(org.opendaylight.yangtools.yang.data.impl.codec.DeserializationException) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 DataObject (org.opendaylight.yangtools.yang.binding.DataObject)1 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)1 YangInstanceIdentifier (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)1 DeserializationException (org.opendaylight.yangtools.yang.data.impl.codec.DeserializationException)1